from version import VERSION VERSION = '%s' % (VERSION, ) from os.path import join, dirname, realpath, split try: scriptdir = dirname(realpath(__file__)) except NameError: scriptdir = dirname(realpath(sys.argv[0])) sys.path.append(join(scriptdir, '..', '..', 'common', 'src')) from optparse_gui import OptionParser, OptionGroup, ProgressText parser = OptionParser(version=VERSION) regexs = OptionGroup(parser, "Filename Matching") parser.add_option("--counts", type="file", dest="counts", default=None, help="Output file from readCounts. Required.", notNone=True, filetypes=[("readCount Output", "*.tsv")]) parser.add_option("--cosmic", type="file", dest="cosmic", default=None, help="COSMIC Mutants.", filetypes=[("COSMIC Annotations", "*.tsv;*.tsv.gz")]) parser.add_option("--darned",
atexit.register(cleanup) if not GUI() and len(sys.argv) == 2 and sys.argv[1] == '--GUI': from optparse_gui.needswx import * sys.exit(1) if GUI() and len(sys.argv) == 1: from optparse_gui import OptionParserGUI parser = OptionParserGUI(version=VERSION) error_kwargs = {'exit': False} sys.excepthook = excepthook else: parser = OptionParser(version=VERSION) error_kwargs = {} advanced = OptionGroup(parser, "Advanced") parser.add_option("-s", "--snvs", type="files", dest="snvs", default=None, help="Single-Nucleotide-Variant files. Required.", name="SNV Files", notNone=True, remember=True, filetypes=[("SNV Files", "*.vcf;*.csv;*.tsv;*.xls;*.xlsx;*.txt")]) parser.add_option("-r", "--readalignments", type="files", dest="alignments", default=None, help="Read alignment files in indexed BAM format. Required.", name="Read Alignment Files", notNone=True, remember=True, filetypes=[("Read Alignment Files (indexed BAM)", "*.bam")]) advanced.add_option("-m", "--minreads", type="int", dest="minreads", default=10, remember=True, help="Minimum number of good reads at SNV locus per alignment file. Default=10.", name="Min. Reads") advanced.add_option("-M", "--maxreads", type="float", dest="maxreads", default=None, remember=True, help="Scale read counts at high-coverage loci to ensure at most this many good reads at SNV locus per alignment file. Values greater than 1 indicate absolute read counts, otherwise the value indicates the coverage distribution percentile. Default=No maximum.", name="Max. Reads") advanced.add_option("-F", "--full", action="store_true", dest="full", default=False, remember=True, help="Output extra diagnostic read count fields. Default=False.", name="All Fields") advanced.add_option("-f", "--alignmentfilter", action="store_false", dest="filter", default=True, remember=True,
atexit.register(cleanup) if not GUI() and len(sys.argv) == 2 and sys.argv[1] == '--GUI': from optparse_gui.needswx import * sys.exit(1) if GUI() and len(sys.argv) == 1: from optparse_gui import OptionParserGUI parser = OptionParserGUI(version=VERSION) error_kwargs = {'exit': False} sys.excepthook = excepthook else: parser = OptionParser(version=VERSION) error_kwargs = {} advanced = OptionGroup(parser, "Advanced") parser.add_option("-s", "--snvs", type="files", dest="snvs", default=None, help="Single-Nucleotide-Variant files. Required.", name="SNV Files", notNone=True, remember=True, filetypes=[("SNV Files", "*.vcf;*.csv;*.tsv;*.xls;*.xlsx;*.txt")]) parser.add_option("-r", "--readalignments", type="files", dest="alignments",
atexit.register(cleanup) if not GUI() and len(sys.argv) == 2 and sys.argv[1] == '--GUI': from optparse_gui.needswx import * sys.exit(1) if GUI() and len(sys.argv) == 1: from optparse_gui import OptionParserGUI parser = OptionParserGUI(version=VERSION) error_kwargs = {'exit': False} sys.excepthook = excepthook else: parser = OptionParser(version=VERSION) error_kwargs = {} advanced = OptionGroup(parser, "Advanced") parser.add_option("-s", "--snvs", type="files", dest="snvs", default=None, help="Single-Nucleotide-Variant files. Required.", name="SNV Files", notNone=True, remember=True, filetypes=[("SNV Files", "*.vcf;*.csv;*.tsv;*.xls;*.xlsx;*.txt")]) parser.add_option("-r", "--readalignments", type="files", dest="alignments",
atexit.register(cleanup) if not GUI() and len(sys.argv) == 2 and sys.argv[1] == '--GUI': from optparse_gui.needswx import * sys.exit(1) if GUI() and len(sys.argv) == 1: from optparse_gui import OptionParserGUI parser = OptionParserGUI(version=VERSION) error_kwargs = {'exit': False} else: parser = OptionParser(version=VERSION) error_kwargs = {} advanced = OptionGroup(parser, "Advanced") parser.add_option("-s", "--snvs", type="files", dest="snvs", default=None, help="Single-Nucleotide-Variant files. Required.", name="SNVs", notNone=True, remember=True, filetypes=[("SNVs", "*.vcf;*.csv;*.tsv;*.xls;*.xlsx;*.txt")]) parser.add_option("-r", "--readalignments", type="files", dest="alignments", default=None,
atexit.register(cleanup) if not GUI() and len(sys.argv) == 2 and sys.argv[1] == '--GUI': from optparse_gui.needswx import * sys.exit(1) if GUI() and len(sys.argv) == 1: from optparse_gui import OptionParserGUI parser = OptionParserGUI(version=VERSION) error_kwargs = {'exit': False} sys.excepthook = excepthook else: parser = OptionParser(version=VERSION) error_kwargs = {} exfilt = OptionGroup(parser, "Filtering") readcounts = OptionGroup(parser, "Read Counting") regexs = OptionGroup(parser, "Filename Matching") snvannot = OptionGroup(parser, "SNV Annotation") parser.add_option("-s", "--snvs", type="files", dest="snvs", default=None, help="Single-Nucleotide-Variant files. Required.", name="SNV Files", notNone=True, remember=True, filetypes=[("SNV Files", "*.vcf;*.csv;*.tsv;*.xls;*.xlsx;*.txt")]) parser.add_option("-r", "--readalignments", type="files", dest="alignments", default=None, help="Read alignment files in indexed BAM format. Required.", name="Read Alignment Files", notNone=True, remember=True, filetypes=[("Read Alignment Files (Indexed BAM)", "*.bam")]) exfilt.add_option("-e", "--exoncoords", type="file", dest="exoncoords", default=None, help="Exon coordinates for SNV filtering. Optional.", name="Exon Coords.", remember=True, filetypes=[("Exonic Coordinates", "*.txt")])
shutil.rmtree(d, ignore_errors=True) atexit.register(cleanup) if not GUI() and len(sys.argv) == 2 and sys.argv[1] == '--GUI': from optparse_gui.needswx import * sys.exit(1) if GUI() and len(sys.argv) == 1: from optparse_gui import OptionParserGUI parser = OptionParserGUI(version=VERSION) error_kwargs = {'exit': False} else: parser = OptionParser(version=VERSION) error_kwargs = {} advanced = OptionGroup(parser, "Advanced") parser.add_option("-s", "--snps", type="files", dest="snps", default=None, help="Single-Nucleotide-Polymophisms. Required.", name="SNPs", notNone=True, remember=True, filetypes=[("SNPs", "*.vcf;*.csv;*.tsv;*.xls;*.xlsx;*.txt")]) parser.add_option("-j", "--junctions", type="files", dest="junctions", default=None, help="Splice junctions. Required.", name="Splice Junctions", notNone=True, remember=True, filetypes=[("Splice Junctions (BED Format)", "*.bed")]) parser.add_option("-r", "--readalignments", type="files", dest="alignments", default=None, help="Read alignments in BAM/SAM format. Required.", name="Read Alignments", notNone=True, remember=True, filetypes=[("Read Alignments (BAM/SAM Format)", "*.bam;*.sam")]) advanced.add_option("-d", "--distance", type="int", dest="dist", default=50, remember=True, help="Upper bound on the distance between SNP locus and splice junction. Default: 50.", name="Distance Bound")
import re from collections import defaultdict from version import VERSION VERSION = '1.0.6 (%s)' % (VERSION,) from os.path import join, dirname, realpath, split try: scriptdir = dirname(realpath(__file__)) except NameError: scriptdir = dirname(realpath(sys.argv[0])) sys.path.append(join(scriptdir, '..', '..', 'common', 'src')) from optparse_gui import OptionParser, OptionGroup, ProgressText parser = OptionParser(version=VERSION) regexs = OptionGroup(parser, "Filename Matching") parser.add_option("--counts", type="file", dest="counts", default=None, help="Output file from readCounts. Required.", notNone=True, filetypes=[("readCount Output", "*.tsv")]) parser.add_option("--cosmic", type="file", dest="cosmic", default=None, help="COSMIC Mutants.", filetypes=[("COSMIC Annotations", "*.tsv;*.tsv.gz")]) parser.add_option("--darned", type="file", dest="darned", default=None, help="DARNED annotations.", filetypes=[("DARNED Annotations", "*.txt")]) regexs.add_option("--normaldnare", type="str", dest="normaldnare", default=r'GDNA', help="Germline/Normal DNA filename regular expression. Default: GDNA.", remember=True, name="Germline DNA RE") regexs.add_option("--normaltransre", type="str", dest="normaltransre", default=r'NRNA', help="Normal transcriptome filename regular expression. Default: NRNA.",
atexit.register(cleanup) if not GUI() and len(sys.argv) == 2 and sys.argv[1] == '--GUI': from optparse_gui.needswx import * sys.exit(1) if GUI() and len(sys.argv) == 1: from optparse_gui import OptionParserGUI parser = OptionParserGUI(version=VERSION) error_kwargs = {'exit': False} else: parser = OptionParser(version=VERSION) error_kwargs = {} advanced = OptionGroup(parser, "Advanced") parser.add_option("-s", "--snps", type="files", dest="snps", default=None, help="Single-Nucleotide-Polymophisms. Required.", name="SNPs", notNone=True, remember=True, filetypes=[("SNPs", "*.vcf;*.csv;*.tsv;*.xls;*.xlsx;*.txt")]) parser.add_option("-j", "--junctions", type="files", dest="junctions", default=None,
if not GUI() and len(sys.argv) == 2 and sys.argv[1] == "--GUI": from optparse_gui.needswx import * sys.exit(1) if GUI() and len(sys.argv) == 1: from optparse_gui import OptionParserGUI parser = OptionParserGUI(version=VERSION) error_kwargs = {"exit": False} else: parser = OptionParser(version=VERSION) error_kwargs = {} advanced = OptionGroup(parser, "Advanced") parser.add_option( "-s", "--snvs", type="files", dest="snvs", default=None, help="Single-Nucleotide-Variant files. Required.", name="SNVs", notNone=True, remember=True, filetypes=[("SNVs", "*.vcf;*.csv;*.tsv;*.xls;*.xlsx;*.txt")], ) parser.add_option( "-r", "--readalignments",
parser = OptionParser(version=VERSION) error_kwargs = {} filterFactory = ReadFilterFactory() filterOptions = [t[0] for t in filterFactory.list()] groupFactory = ReadGroupFactory() groupOptions = [""] + [t[0] for t in groupFactory.list()] minreads_default = 5 maxreads_default = None tpb_default = 0 filter_default = "Basic" readgroup_default = "UMI-tools" advanced = OptionGroup(parser, "Advanced") parser.add_option("-s", "--snvs", type="files", dest="snvs", default=None, help="Single-Nucleotide-Variant files. Required.", name="SNV Files", notNone=True, remember=True, filetypes=[("SNV Files", "*.vcf;*.csv;*.tsv;*.xls;*.xlsx;*.txt")]) parser.add_option("-r", "--readalignments", type="files", dest="alignments",
atexit.register(cleanup) if not GUI() and len(sys.argv) == 2 and sys.argv[1] == '--GUI': from optparse_gui.needswx import * sys.exit(1) if GUI() and len(sys.argv) == 1: from optparse_gui import OptionParserGUI parser = OptionParserGUI(version=VERSION) error_kwargs = {'exit': False} sys.excepthook = excepthook else: parser = OptionParser(version=VERSION) error_kwargs = {} exfilt = OptionGroup(parser, "Filtering") readcounts = OptionGroup(parser, "Read Counting") regexs = OptionGroup(parser, "Filename Matching") snvannot = OptionGroup(parser, "SNV Annotation") parser.add_option("-s", "--snvs", type="files", dest="snvs", default=None, help="Single-Nucleotide-Variant files. Required.", name="SNV Files", notNone=True, remember=True, filetypes=[("SNV Files", "*.vcf;*.csv;*.tsv;*.xls;*.xlsx;*.txt")]) parser.add_option("-r", "--readalignments", type="files", dest="alignments", default=None, help="Read alignment files in indexed BAM format. Required.", name="Read Alignment Files", notNone=True, remember=True, filetypes=[("Read Alignment Files (Indexed BAM)", "*.bam")]) exfilt.add_option("-e", "--exoncoords", type="file", dest="exoncoords", default=None, help="Exon coordinates for SNV filtering. Optional.", name="Exon Coords.", remember=True, filetypes=[("Exonic Coordinates", "*.txt")])