def register_args(main_func):
    subparser = add_subcommand('example_subcommand', main_func, help='run example_subcommand')
    # The "-1" argument below is only for this subcommand (and other subcommands
    # that expressly define it).  If you wish to expose it for every subcommand,
    # define it under argparser._add_shared_subcommand_args.
    subparser.add_argument('-1',
                           '--one',
                           action='store_const',
                           const=1,
                           dest='test_value',
                           help="set test_value to 1")
    return main_func
Beispiel #2
0
def register_args(main_func):
    subparser = add_subcommand(
        'aws_batch_submit',
        main_func,
        help=
        f"submit command to run under AWS Batch, keeping records under {opsdir}"
    )
    subparser.add_argument(
        '--batch_command',
        dest='batch_command',
        required=False,
        help="Command to run in AWS Batch container after installing iggtools")
    subparser.set_defaults(batch_command="iggtools --help")
    return main_func
Beispiel #3
0
def register_args(main_func):
    subparser = add_subcommand('annotate_genes',
                               main_func,
                               help='annotate selected genomes with prokka')
    subparser.add_argument(
        '--genomes',
        dest='genomes',
        required=False,
        help=
        "genome[,genome...] to import;  alternatively, slice in format idx:modulus, e.g. 1:30, meaning annotate genomes whose ids are 1 mod 30; or, the special keyword 'all' meaning all genomes"
    )
    subparser.add_argument(
        '--zzz_slave_toc', dest='zzz_slave_toc', required=False, help=SUPPRESS
    )  # "reserved to pass table of contents from master to slave"
    return main_func
def register_args(main_func):
    subparser = add_subcommand('build_marker_genes', main_func, help='identify marker genes for  given genomes')
    subparser.add_argument('--genomes',
                           dest='genomes',
                           required=False,
                           help="genome[,genome...] to import;  alternatively, slice in format idx:modulus, e.g. 1:30, meaning import genomes whose ids are 1 mod 30; or, the special keyword 'all' meaning all genomes")
    subparser.add_argument('--zzz_slave_toc',
                           dest='zzz_slave_toc',
                           required=False,
                           help=SUPPRESS) # "reserved to pass table of contents from master to slave"
    subparser.add_argument('--zzz_slave_marker_genes_hmm',
                           dest='zzz_slave_marker_genes_hmm',
                           required=False,
                           help=SUPPRESS) # "reserved to common database from master to slave"
    return main_func
Beispiel #5
0
def register_args(main_func):
    subparser = add_subcommand('build_pangenome',
                               main_func,
                               help='build pangenome for specified species')
    subparser.add_argument(
        '-s',
        '--species',
        dest='species',
        required=False,
        help=
        "species[,species...] whose pangenome(s) to build;  alternatively, species slice in format idx:modulus, e.g. 1:30, meaning build species whose ids are 1 mod 30; or, the special keyword 'all' meaning all species"
    )
    subparser.add_argument(
        '--zzz_slave_toc', dest='zzz_slave_toc', required=False, help=SUPPRESS
    )  # "reserved to pass table of contents from master to slave"
    return main_func
Beispiel #6
0
def register_args(main_func):
    subparser = add_subcommand('midas_run_species', main_func, help='compute species abundance profile for given sample(s)')
    subparser.add_argument('outdir',
                           type=str,
                           help="""Path to directory to store results.  Name should correspond to unique sample identifier.""")
    subparser.add_argument('-1',
                           dest='r1',
                           required=True,
                           help="FASTA/FASTQ file containing 1st mate if using paired-end reads.  Otherwise FASTA/FASTQ containing unpaired reads.")
    subparser.add_argument('-2',
                           dest='r2',
                           help="FASTA/FASTQ file containing 2nd mate if using paired-end reads.")
    subparser.add_argument('--word_size',
                           dest='word_size',
                           default=DEFAULT_WORD_SIZE,
                           type=int,
                           metavar="INT",
                           help=f"Word size for BLAST search ({DEFAULT_WORD_SIZE}).  Use word sizes > 16 for greatest efficiency.")
    subparser.add_argument('--aln_mapid',
                           dest='aln_mapid',
                           type=float,
                           metavar="FLOAT",
                           help=f"Discard reads with alignment identity < ALN_MAPID.  Values between 0-100 accepted.  By default gene-specific species-level cutoffs are used, as specifeid in {params.inputs.marker_genes_hmm_cutoffs}")
    subparser.add_argument('--aln_cov',
                           dest='aln_cov',
                           default=DEFAULT_ALN_COV,
                           type=float,
                           metavar="FLOAT",
                           help=f"Discard reads with alignment coverage < ALN_COV ({DEFAULT_ALN_COV}).  Values between 0-1 accepted.")
    subparser.add_argument('--max_reads',
                           dest='max_reads',
                           type=int,
                           metavar="INT",
                           help=f"Number of reads to use from input file(s).  (All)")
    if False:
        # This is not currently in use.
        subparser.add_argument('--read_length',
                               dest='read_length',
                               type=int,
                               metavar="INT",
                               help=f"Trim reads to READ_LENGTH and discard reads with length < READ_LENGTH.  By default, reads are not trimmed or filtered")
    return main_func
Beispiel #7
0
def register_args(main_func):
    add_subcommand('init',
                   main_func,
                   help=f"initialize target {outputs.genomes}",
                   epilog=init.__doc__)
    return main_func
Beispiel #8
0
def register_args(main_func):
    subparser = add_subcommand(
        'midas_run_snps',
        main_func,
        help='single-nucleotide-polymorphism prediction')
    subparser.add_argument(
        'outdir',
        type=str,
        help=
        """Path to directory to store results.  Name should correspond to unique sample identifier."""
    )
    subparser.add_argument(
        '-1',
        dest='r1',
        required=True,
        help=
        "FASTA/FASTQ file containing 1st mate if using paired-end reads.  Otherwise FASTA/FASTQ containing unpaired reads."
    )
    subparser.add_argument(
        '-2',
        dest='r2',
        help="FASTA/FASTQ file containing 2nd mate if using paired-end reads.")
    subparser.add_argument(
        '--max_reads',
        dest='max_reads',
        type=int,
        metavar="INT",
        help=f"Number of reads to use from input file(s).  (All)")
    subparser.add_argument(
        '--species_cov',
        type=float,
        dest='species_cov',
        metavar='FLOAT',
        default=DEFAULT_SPECIES_COVERAGE,
        help=f"Include species with >X coverage ({DEFAULT_SPECIES_COVERAGE})")
    if False:
        # This is unused.
        subparser.add_argument('--species_topn',
                               type=int,
                               dest='species_topn',
                               metavar='INT',
                               help='Include top N most abundant species')

    # Alignment flags
    subparser.add_argument(
        '--aln_speed',
        type=str,
        dest='aln_speed',
        default='very-sensitive',
        choices=['very-fast', 'fast', 'sensitive', 'very-sensitive'],
        help=
        'Alignment speed/sensitivity (very-sensitive).  If aln_mode is local (default) this automatically issues the corresponding very-sensitive-local, etc flag to bowtie2.'
    )
    subparser.add_argument(
        '--aln_mode',
        type=str,
        dest='aln_mode',
        default='global',
        choices=['local', 'global'],
        help=
        'Global/local read alignment (local, corresponds to the bowtie2 --local; global corresponds to the bowtie2 default --end-to-end).'
    )
    subparser.add_argument(
        '--aln_interleaved',
        action='store_true',
        default=False,
        help=
        'FASTA/FASTQ file in -1 are paired and contain forward AND reverse reads'
    )

    #  Pileup flags (samtools, or postprocessing)
    subparser.add_argument(
        '--aln_mapid',
        dest='aln_mapid',
        type=float,
        metavar="FLOAT",
        default=DEFAULT_ALN_MAPID,
        help=
        f"Discard reads with alignment identity < MAPID.  Values between 0-100 accepted.  ({DEFAULT_ALN_MAPID})"
    )
    subparser.add_argument(
        '--aln_mapq',
        dest='aln_mapq',
        type=int,
        metavar="INT",
        default=DEFAULT_ALN_MAPQ,
        help=f"Discard reads with mapping quality < MAPQ. ({DEFAULT_ALN_MAPQ})"
    )
    subparser.add_argument(
        '--aln_readq',
        dest='aln_readq',
        type=int,
        metavar="INT",
        default=DEFAULT_ALN_READQ,
        help=f"Discard reads with mean quality < READQ ({DEFAULT_ALN_READQ})")
    subparser.add_argument(
        '--aln_cov',
        dest='aln_cov',
        default=DEFAULT_ALN_COV,
        type=float,
        metavar="FLOAT",
        help=
        f"Discard reads with alignment coverage < ALN_COV ({DEFAULT_ALN_COV}).  Values between 0-1 accepted."
    )
    subparser.add_argument(
        '--aln_baseq',
        dest='aln_baseq',
        default=DEFAULT_ALN_BASEQ,
        type=int,
        metavar="INT",
        help=f"Discard bases with quality < ALN_BASEQ ({DEFAULT_ALN_BASEQ})")
    subparser.add_argument(
        '--aln_trim',
        dest='aln_trim',
        default=DEFAULT_ALN_TRIM,
        type=int,
        metavar="INT",
        help=
        f"Trim ALN_TRIM base-pairs from 3'right end of read ({DEFAULT_ALN_TRIM})"
    )
    if False:
        # This is unused.
        subparser.add_argument('--aln_discard',
                               dest='aln_baq',
                               default=False,
                               help='Discard discordant read-pairs (False)')
        subparser.add_argument(
            '--aln_baq',
            dest='aln_baq',
            default=False,
            help='Enable BAQ: per-base alignment quality (False)')
        subparser.add_argument('--aln_adjust_mq',
                               dest='aln_adjust_mq',
                               default=False,
                               help='Adjust MAPQ (False)')
    subparser.add_argument('--sparse',
                           dest='sparse',
                           default=False,
                           help=f"Omit zero rows from output.")
    return main_func
Beispiel #9
0
def register_args(main_func):
    subparser = add_subcommand('midas_run_genes', main_func, help='metagenomic pan-genome profiling')
    subparser.add_argument('outdir',
                           type=str,
                           help="""Path to directory to store results.  Name should correspond to unique sample identifier.""")
    subparser.add_argument('-1',
                           dest='r1',
                           required=True,
                           help="FASTA/FASTQ file containing 1st mate if using paired-end reads.  Otherwise FASTA/FASTQ containing unpaired reads.")
    subparser.add_argument('-2',
                           dest='r2',
                           help="FASTA/FASTQ file containing 2nd mate if using paired-end reads.")
    subparser.add_argument('--max_reads',
                           dest='max_reads',
                           type=int,
                           metavar="INT",
                           help=f"Number of reads to use from input file(s).  (All)")
    subparser.add_argument('--species_cov',
                           type=float,
                           dest='species_cov',
                           metavar='FLOAT',
                           default=DEFAULT_SPECIES_COVERAGE,
                           help=f"Include species with >X coverage ({DEFAULT_SPECIES_COVERAGE})")
    if False:
        # This is unused.
        subparser.add_argument('--species_topn',
                               type=int,
                               dest='species_topn',
                               metavar='INT',
                               help='Include top N most abundant species')

    #  Alignment flags (bowtie, or postprocessing)
    subparser.add_argument('--aln_cov',
                           dest='aln_cov',
                           default=DEFAULT_ALN_COV,
                           type=float,
                           metavar="FLOAT",
                           help=f"Discard reads with alignment coverage < ALN_COV ({DEFAULT_ALN_COV}).  Values between 0-1 accepted.")
    subparser.add_argument('--aln_readq',
                           dest='aln_readq',
                           type=int,
                           metavar="INT",
                           default=DEFAULT_ALN_READQ,
                           help=f"Discard reads with mean quality < READQ ({DEFAULT_ALN_READQ})")
    subparser.add_argument('--aln_mapid',
                           dest='aln_mapid',
                           type=float,
                           metavar="FLOAT",
                           default=DEFAULT_ALN_MAPID,
                           help=f"Discard reads with alignment identity < MAPID.  Values between 0-100 accepted.  ({DEFAULT_ALN_MAPID})")
    subparser.add_argument('--aln_mapq',
                           dest='aln_mapq',
                           type=int,
                           metavar="INT",
                           default=DEFAULT_ALN_MAPQ,
                           help=f"Discard reads with DEFAULT_ALN_MAPQ < MAPQ. ({DEFAULT_ALN_MAPQ})")
    subparser.add_argument('--aln_speed',
                           type=str,
                           dest='aln_speed',
                           default='very-sensitive',
                           choices=['very-fast', 'fast', 'sensitive', 'very-sensitive'],
                           help='Alignment speed/sensitivity (very-sensitive).  If aln_mode is local (default) this automatically issues the corresponding very-sensitive-local, etc flag to bowtie2.')
    subparser.add_argument('--aln_mode',
                           type=str,
                           dest='aln_mode',
                           default='local',
                           choices=['local', 'global'],
                           help='Global/local read alignment (local, corresponds to the bowtie2 --local).  Global corresponds to the bowtie2 default --end-to-end.')
    subparser.add_argument('--aln_interleaved',
                           action='store_true',
                           default=False,
                           help='FASTA/FASTQ file in -1 are paired and contain forward AND reverse reads')

    return main_func
Beispiel #10
0
def register_args(main_func):
    add_subcommand(
        'aws_batch_init',
        main_func,
        help="init AWS Batch instance (never run outside AWS Batch)")
    return main_func
def register_args(main_func):
    add_subcommand('collate_repgenome_markers',
                   main_func,
                   help='collate marker genes for repgresentative genomes')
    return main_func