1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
#!/usr/bin/env python
# Copyright (c) 2016, The Regents of the University of California.
from __future__ import absolute_import, print_function
import argparse
import sys
from . import createscreed
from . import dump_fasta
from . import dump_fastq
class ScreedCommands(object):
def __init__(self):
parser = argparse.ArgumentParser(
description="",
usage='''screed <command> [<args>]
Available:
db <filename> Creates a screed database.
dump_fasta <db> <output> Convert a screed database to a FASTA file
dump_fastq <db> <output> Convert a screed database to a FASTQ file
''')
commands = {
'db': createscreed.main,
'dump_fasta': dump_fasta.main,
'dump_fastq': dump_fastq.main,
}
parser.add_argument('command')
args = parser.parse_args(sys.argv[1:2])
if args.command not in commands:
print('Unrecognized command')
parser.print_help()
sys.exit(1)
cmd = commands[args.command]
cmd(sys.argv[2:])
def main():
ScreedCommands()
return 0
if __name__ == "__main__":
main()
|