File: dump_fastq.py

package info (click to toggle)
python-screed 1.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 820 kB
  • sloc: python: 3,356; makefile: 169; sh: 32; javascript: 16
file content (31 lines) | stat: -rw-r--r-- 838 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/env python

# Copyright (c) 2008, Michigan State University.
# Copyright (c) 2016, The Regents of the University of California.

from __future__ import print_function
from screed import ToFastq
import argparse
import sys
import os


# Shell interface to the ToFastq screed conversion function
def main(args):
    parser = argparse.ArgumentParser(
        description="Convert a screed database to a FASTA file")
    parser.add_argument('dbfile')
    parser.add_argument('outputfile', default='/dev/stdout', nargs='?')
    args = parser.parse_args(args)

    if not os.path.isfile(args.dbfile):
        print("No such file: %s" % args.dbfile)
        exit(1)

    n = ToFastq(args.dbfile, args.outputfile)

    sys.stderr.write('Wrote {} records in FASTQ format.\n'.format(n))


if __name__ == '__main__':
    main(sys.argv[1])