Debian Codegraph @

pyfastaq/runners/make_random_contigs.py

raw
1 import argparse
2 from pyfastaq import tasks
3
4 def run(description):
5 parser = argparse.ArgumentParser(
6 description = 'Makes a multi-FASTA file of random sequences, all of the same length. Each base has equal chance of being A,C,G or T',
7 usage = 'fastaq make_random_contigs [options] <contigs> <length> <outfile>')
8 parser.add_argument('--first_number', type=int, help='If numbering the sequences, the first sequence gets this number [%(default)s]', default=1)
9 parser.add_argument('--name_by_letters', action='store_true', help='Name the contigs A,B,C,... will start at A again if you get to Z')
10 parser.add_argument('--prefix', help='Prefix to add to start of every sequence name', default='')
11 parser.add_argument('--seed', type=int, help='Seed for random number generator. Default is to use python\'s default', default=None)
12 parser.add_argument('contigs', type=int, help='Number of contigs to make')
13 parser.add_argument('length', type=int, help='Length of each contig')
14 parser.add_argument('outfile', help='Name of output file')
15 options = parser.parse_args()
16 tasks.make_random_contigs(
17 options.contigs,
18 options.length,
19 options.outfile,
20 name_by_letters=options.name_by_letters,
21 prefix=options.prefix,
22 seed=options.seed,
23 first_number=options.first_number
24 )