Debian Codegraph @

pyfastaq/runners/sort_by_size.py

raw
1 import argparse
2 from pyfastaq import tasks
3
4 def run(description):
5 parser = argparse.ArgumentParser(
6 description = description,
7 usage = 'fastaq sort_by_size [options] <infile> <outfile>')
8 parser.add_argument('infile', help='Name of input file')
9 parser.add_argument('outfile', help='Name of output file')
10 parser.add_argument('-r', '--reverse', action='store_true', help='Sort by shortest first instead of the default of longest first')
11 options = parser.parse_args()
12 tasks.sort_by_size(
13 options.infile,
14 options.outfile,
15 smallest_first=options.reverse
16 )