Skip to content

Commit

Permalink
refactor: Remove cgat[core] imports and dependencies
Browse files Browse the repository at this point in the history
Removing unused imports and switching to `argparse.ArgumentParse` in `all_introns_counts_and_info.py` means we can now
remove the import and dependency on `cgat` and `cgatcore`.
  • Loading branch information
ns-rse committed Dec 4, 2024
1 parent 3f91561 commit 33c329b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
18 changes: 2 additions & 16 deletions isoslam/all_introns_counts_and_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@
about it's event assignment, number of conversions, coverage etc.
"""

from argparse import ArgumentParser
import sys
from collections import defaultdict

import cgat.GTF as GTF
import cgatcore.experiment as E
import cgatcore.iotools as iotools
import pandas as pd
import pysam as pysam

from isoslam import isoslam, io

Expand All @@ -31,25 +27,20 @@ def main(argv=None):
if argv is None:
argv = sys.argv

# setup command line parser
parser = E.ArgumentParser(description=__doc__)

parser = ArgumentParser(description=__doc__)
parser.add_argument(
"-b",
"--bam",
dest="infile_bam",
type=str,
help="Supply a path to the bam file that has undergone read assignment with featureCounts",
)

parser.add_argument(
"-g", "--gtf", dest="gtf_path", type=str, help="Supply a path to the transcript assembly gtf file"
)

parser.add_argument(
"-bed", dest="utron_bed", type=str, help="Supply a path to the utron bed file. Must be bed6 format"
)

parser.add_argument(
"-o",
"--out",
Expand All @@ -58,7 +49,6 @@ def main(argv=None):
help="""Supply a path to the output file. This file will contain
conversions per pair, accounting for stranding""",
)

parser.add_argument("-vcf", "--vcf", dest="vcf_path", type=str, help="""Supply a path to the VCF.gz file""")

argv_as_dictionary = vars(argv)
Expand Down Expand Up @@ -118,8 +108,6 @@ def fragment_iterator(read_iterator):
i_progress += 1

if i_progress == 10000:
# E.debug(str(i_total_progress) + " pairs processed")
# E.debug(str(i) + "spliced/retained pairs processed")
i_progress = 0

read1_start = read1.reference_start
Expand Down Expand Up @@ -506,8 +494,6 @@ def fragment_iterator(read_iterator):
results = pd.concat([results, row])

return results.sort_values(by=["read_uid", "transcript_id", "chr", "start", "end"])
# write footer and output benchmark information.
# E.stop()


if __name__ == "__main__":
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,13 @@ keywords = [
]
dependencies = [
"apsw",
# "cgat",
# "cgatcore",
"gevent",
"loguru",
"matplotlib",
"numpy",
"pandas",
"pysam",
"ruamel.yaml",
# "ruffus",
"sqlalchemy",
]

Expand Down

0 comments on commit 33c329b

Please sign in to comment.