def test_init_raise(self): tests = [('a', check_choice(['b', 'c'])), (9, check_choice(range(8))), (1, check_range(2, 6))] for v, f in tests: with self.assertRaises(ValueError): OptionParam('-i', value=v, action=f)
def test_check_choice(self): checker = check_choice(range(3)) val = 1 self.assertEqual(val, checker(val)) val = 5 with self.assertRaises(ValueError): checker(val)
OptionParam('-i', 'query', help='FASTA/Genbank input file (default reads from stdin).'), OptionParam('-a', help='File to store protein translations.'), OptionParam('-d', help='File to store nuc sequence of predicted gene.'), OptionParam( '-s', help='Write all potential genes (with scores) to the selected file.'), OptionParam('-t', help=('Write a training file (if none exists); ' 'otherwise, read and use the specified training file.')), OptionParam('-o', 'output', help='output file (default writes to stdout).'), OptionParam('-f', 'fmt', action=check_choice(('gbk', 'gff', 'sco')), help='output format (gbk, gff, or sco). Default is gbk.'), OptionParam('-g', help='translation table to use (default 11).'), OptionParam( '-m', help= 'Treat runs of N as masked sequence; do not build genes across them.'), OptionParam('-p', 'mode', action=check_choice(('single', 'meta')), help='Select procedure (single or meta). Default is single.'), OptionParam('-c', help='Closed ends. Do not allow genes to run off edges.'), OptionParam('-v', help='Print version number and exit.'), OptionParam('-q', help='Run quietly (suppress normal stderr output).'), OptionParam('-h', help='Print help menu and exit.'),
help=('Path to query input file in FASTA or FASTQ format ' '(may be gzip compressed).'))] makedb_params = [ OptionParam('--threads', '-p', name='cpus'), OptionParam('--in', name='fasta', help='protein reference database file in FASTA format (may be gzip compressed)'), OptionParam('--db', '-d', help='DIAMOND database file.'), OptionParam('--block-size', help='Block size in billions of sequence letters to be processed at a time.')] view_params = [ OptionParam('--outfmt', name='fmt', action=check_choice(('tab', 'sam')), help=('Format of output file. (tab = BLAST tabular format;' 'sam = SAM format)')), OptionParam('--daa', '-a', help='Path to DAA file.'), OptionParam('--out', '-o', help='Path to output file.'), OptionParam('--compress', action=check_choice((0, 1)), help='Compression for output file (0=none, 1=gzip).')] def run_blast(query, daa, aligner='blastp', **kwargs): '''Search query sequences against the database. Parameters ----------
from ..parsers.embl import _parse_records params = [ OptionParam("-i", "query", help="FASTA/Genbank input file (default reads from stdin)."), OptionParam("-a", help="File to store protein translations."), OptionParam("-d", help="File to store nuc sequence of predicted gene."), OptionParam("-s", help="Write all potential genes (with scores) to the selected file."), OptionParam( "-t", help=("Write a training file (if none exists); " "otherwise, read and use the specified training file.") ), OptionParam("-o", "output", help="output file (default writes to stdout)."), OptionParam( "-f", "fmt", action=check_choice(("gbk", "gff", "sco")), help="output format (gbk, gff, or sco). Default is gbk.", ), OptionParam("-g", help="translation table to use (default 11)."), OptionParam("-m", help="Treat runs of N as masked sequence; do not build genes across them."), OptionParam( "-p", "mode", action=check_choice(("single", "meta")), help="Select procedure (single or meta). Default is single.", ), OptionParam("-c", help="Closed ends. Do not allow genes to run off edges."), OptionParam("-v", help="Print version number and exit."), OptionParam("-q", help="Run quietly (suppress normal stderr output)."), OptionParam("-h", help="Print help menu and exit."), OptionParam("-n", help="Bypass Shine-Dalgarno trainer and force a full motif scan."),
def test_check_choice_iter(self): checker = check_choice((i for i in 'a')) val = 'a' self.assertEqual(val, checker(val)) val = 'a' self.assertEqual(val, checker(val))
name='fasta', help= 'protein reference database file in FASTA format (may be gzip compressed)' ), OptionParam('--db', '-d', help='DIAMOND database file.'), OptionParam( '--block-size', help= 'Block size in billions of sequence letters to be processed at a time.' ) ] view_params = [ OptionParam('--outfmt', name='fmt', action=check_choice(('tab', 'sam')), help=('Format of output file. (tab = BLAST tabular format;' 'sam = SAM format)')), OptionParam('--daa', '-a', help='Path to DAA file.'), OptionParam('--out', '-o', help='Path to output file.'), OptionParam('--compress', action=check_choice((0, 1)), help='Compression for output file (0=none, 1=gzip).') ] def run_blast(query, daa, aligner='blastp', **kwargs): '''Search query sequences against the database. Parameters ----------