Ejemplo n.º 1
0
 def generate_argparser():
     """Generate argparse parser
     """
     parser = MvfArgumentParser()
     parser.addarg_mvf()
     parser.addarg_out()
     parser.add_argument("--gff",
                         type=os.path.abspath,
                         help=("Input GFF3 file. If GFF3 not provided, "
                               "alignments are assumed to be "
                               "in-frame coding sequences."))
     parser.add_argument("--output-data",
                         "--outputdata",
                         choices=['protein', 'codon'],
                         default="codon",
                         help=("protein=single data column "
                               "of protein alleles; "
                               "codon=four columns with: "
                               "protein frame1 frame2 frame3"))
     parser.add_argument("--filter-annotation",
                         "--filterannotation",
                         help=("skip GFF entries with text "
                               "matching this in their 'Notes' field"))
     parser.addarg_linebuffer()
     parser.addarg_overwrite()
     return parser
Ejemplo n.º 2
0
 def generate_argparser():
     """Generate argparse parser
     """
     parser = MvfArgumentParser()
     parser.add_argument("--mvf",
                         nargs="*",
                         type=os.path.abspath,
                         required=True,
                         help="One or more mvf files.")
     parser.addarg_out()
     parser.add_argument(
         "--new-contigs",
         "--newcontigs",
         action="store_true",
         help=("By default, contigs are matched between files "
               "using their text labels in the header. "
               "Use this option to turn matching off and treat "
               "each file's contigs as distinct."))
     parser.add_argument(
         "--newsamples",
         action="store_true",
         help=("By default, samples are matched between files "
               "using their text labels in the header. "
               "Use this option to turn matching off and treat "
               "each file's sample columns as distinct."))
     parser.add_argument(
         "--main_header_file",
         "--mainheaderfile",
         help=("Output file will use same headers as "
               "this input file (default=first in list)."))
     parser.addarg_linebuffer()
     parser.addarg_overwrite()
     return parser
Ejemplo n.º 3
0
 def generate_argparser():
     """Generate argparse parser
     """
     parser = MvfArgumentParser()
     parser.addarg_mvf()
     parser.addarg_out()
     parser.addarg_gff()
     parser.add_argument("--filter-annotation",
                         "--filterannotation",
                         help=("Skip entries in the GFF file that "
                               "contain this string in their 'Notes'"))
     parser.add_argument(
         "--nongenic-mode",
         "--nongenicmode",
         action="store_true",
         help=("Instead of returning annotated genes, "
               "return the non-genic regions without "
               "without changing contigs or coordinates"))
     parser.add_argument(
         "--nongenic-margin",
         "--nongenicmargin",
         type=int,
         default=0,
         help=("for --unnanotated-mode, only retain "
               "positions that are this number of bp away "
               "from an annotated region boundary"))
     parser.addarg_linebuffer()
     parser.addarg_overwrite()
     return parser
Ejemplo n.º 4
0
 def generate_argparser():
     """Generate argparse parser
     """
     parser = MvfArgumentParser()
     parser.addarg_mvf()
     parser.addarg_out()
     parser.add_argument(
         "--actions",
         nargs='*',
         help=("set of actions:args to perform, "
               "note these are done in order as listed"))
     parser.add_argument("--labels",
                         action="store_true",
                         help="use sample labels instead of indices")
     parser.add_argument("--test",
                         help="manually input a line for testing")
     parser.add_argument("--test-nchar",
                         "--textnchar",
                         type=int,
                         help="total number of samples for test string")
     parser.add_argument(
         "--more-help",
         "--morehelp",
         action="store_true",
         help="prints full module list and descriptions")
     parser.addarg_linebuffer()
     parser.add_argument("--verbose",
                         action="store_true",
                         help="report every line (for debugging)")
     parser.addarg_overwrite()
     return parser
Ejemplo n.º 5
0
        def generate_argparser():
            """Generate argparse parser
            """
            parser = MvfArgumentParser()
            parser.add_argument(
                "--maf",
                help="input MAF file",
                required=True,
                type=os.path.abspath,
            )
            parser.add_argument("--out",
                                help="output MVF file",
                                type=os.path.abspath,
                                required=True)
            parser.add_argument("--ref-tag",
                                "--reftag",
                                help="old reference tag")
            parser.add_argument(
                "--mvf-ref-label",
                "--mvfreflabel",
                default="REF",
                help=("new label for reference sample (default='REF')"))
            parser.add_argument(
                "--sample-tags",
                "--sampletags",
                nargs="*",
                required=True,
                help=("one or more TAG:NEWLABEL or TAG, items, "
                      "if TAG found in sample label, replace with "
                      "NEW (or TAG if NEW not specified) "
                      "NEW and TAG must each be unique."))

            parser.addarg_linebuffer()
            parser.addarg_overwrite()
            return parser
Ejemplo n.º 6
0
 def generate_argparser():
     """Generate argparse parser
     """
     parser = MvfArgumentParser()
     parser.addarg_mvf()
     parser.addarg_out()
     parser.add_argument("--gff",
                         type=os.path.abspath,
                         help=("Input GFF3 file. If GFF3 not provided, "
                               "alignments are assumed to be "
                               "in-frame coding sequences."))
     parser.add_argument("--output-data",
                         "--outputdata",
                         choices=['protein', 'codon'],
                         default="codon",
                         help=("protein=single data column "
                               "of protein alleles; "
                               "codon=four columns with: "
                               "protein frame1 frame2 frame3"))
     parser.add_argument("--filter-annotation",
                         "--filterannotation",
                         help=("skip GFF entries with text "
                               "matching this in their 'Notes' field"))
     parser.add_argument("--parent-gene-prefix",
                         "--parentgeneprefix",
                         default="gene:",
                         help=("Parent genes prefix when interpreting"
                               "GFF files.  For GFF3 files, 'gene:' "
                               "is standard, but for older or custom "
                               "GFF files this may vary.  Use 'none' "
                               "to make empty."))
     parser.addarg_linebuffer()
     parser.addarg_overwrite()
     parser.add_argument(
         "--verbose",
         action="store_true",
         help="""Output excessive data to screen for debugging""")
     return parser
Ejemplo n.º 7
0
 def generate_argparser():
     """Generate argparse parser
     """
     parser = MvfArgumentParser()
     parser.addarg_mvf()
     parser.addarg_out()
     parser.addarg_gff()
     parser.add_argument("--filter-annotation",
                         "--filterannotation",
                         help=("Skip entries in the GFF file that "
                               "contain this string in their 'Notes'"))
     parser.add_argument(
         "--nongenic-mode",
         "--nongenicmode",
         action="store_true",
         help=("Instead of returning annotated genes, "
               "return the non-genic regions without "
               "without changing contigs or coordinates"))
     parser.add_argument(
         "--nongenic-margin",
         "--nongenicmargin",
         type=int,
         default=0,
         help=("for --unnanotated-mode, only retain "
               "positions that are this number of bp away "
               "from an annotated region boundary"))
     parser.add_argument("--gene-prefix",
                         "--geneprefix",
                         default="mRNA:",
                         help=("Gene entry prefix when interpreting"
                               "GFF files.  For GFF3 files, 'mRNA:' "
                               "is standard, but for older or custom "
                               "GFF files this may vary.  Use 'none' "
                               "to make empty."))
     parser.addarg_linebuffer()
     parser.addarg_overwrite()
     return parser
Ejemplo n.º 8
0
 def generate_argparser():
     """Generate argparse parser
     """
     parser = MvfArgumentParser()
     parser.add_argument("--vcf",
                         type=os.path.abspath,
                         help="VCF input file")
     parser.add_argument("--out", required=True, help="output MVF file")
     parser.add_argument(
         "--out-flavor",
         "--outflavor",
         default="dna",
         choices=['dna', 'dnaqual', 'dnaqual-indel', 'dna-indel'],
         help=("choose output MVF flavor to include "
               "quality scores and/or indels"))
     parser.add_argument("--mask-depth",
                         "--maskdepth",
                         type=int,
                         default=1,
                         help="below this read depth mask with N/n")
     parser.add_argument(
         "--low-depth",
         "--lowdepth",
         type=int,
         default=3,
         help=("below this read depth coverage, "
               "convert to lower case set to 0 to disable"))
     parser.add_argument(
         "--mask-qual",
         "--maskqual",
         type=int,
         default=3,
         help=("low quality cutoff, bases replaced by N/- "
               "set to 0 to disable"))
     parser.add_argument(
         "--low-qual",
         "--lowqual",
         type=int,
         default=20,
         help=("below this quality convert to lower case "
               "set to 0 to disable"))
     parser.add_argument(
         "--contig-ids",
         "--contigids",
         nargs='*',
         help=("manually specify one or more contig ids "
               "as ID;VCFLABE;MVFLABEL, note that "
               "VCFLABEL must match EXACTLY the contig string "
               "labels in the VCF file"))
     parser.add_argument(
         "--sample-replace",
         "--samplereplace",
         nargs="*",
         help=("one or more TAG:NEWLABEL or TAG, items, "
               "if TAG found in sample label, replace with "
               "NEW (or TAG if NEW not specified) "
               "NEW and TAG must each be unique"))
     parser.add_argument(
         "--ref-label",
         "--reflabel",
         default="REF",
         help="label for reference sample (default='REF')")
     parser.add_argument("--alleles-from",
                         "--allelesfrom",
                         default=None,
                         help="""get additional alignment columns
         from INFO fields (:-separated)""")
     parser.addarg_linebuffer()
     parser.add_argument(
         "--no-autoindex",
         "--noautoindex",
         action="store_true",
         help="do not automatically index contigs from the VCF")
     parser.add_argument(
         "--field-sep",
         "--fieldsep",
         default="TAB",
         choices=['TAB', 'SPACE', 'DBLSPACE', 'COMMA', 'MIXED'],
         help="""VCF field separator (default='TAB')""")
     parser.add_argument(
         "--qual",
         action="store_true",
         help="""Include Phred genotype quality (GQ) scores""")
     parser.addarg_overwrite()
     return parser