Codebase list fastaq / 21955d0
Imported Upstream version 3.13.0 Sascha Steinbiss 7 years ago
4 changed file(s) with 19 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
0 language: python
1 python:
2 - "3.4"
3 sudo: false
4 script:
5 - "python setup.py test"
1111
1212
1313 Alternatively, you can download the latest release from this github repository,
14 or clone the repository. Then run the tests:
14 or clone the repository. Then run the tests:
1515
1616 python3 setup.py test
1717
2424 -----
2525
2626 The installation will put a single script called `fastaq` in your path.
27 The usage is:
27 The usage is:
2828
2929 fastaq <command> [options]
3030
108108 print(count)
109109
110110 Hopefully you get the idea and there are plenty of examples in tasks.py. Detection of the input file type and whether gzipped or not is automatic. See help(sequences) for the various methods already defined in the classes Fasta and Fastq.
111
112 ---------------------------------
113
114 Build status: [![Build Status](https://travis-ci.org/sanger-pathogens/Fastaq.svg?branch=master)](https://travis-ci.org/sanger-pathogens/Fastaq)
115
116
88 'from a mates file. Ouptut is interleaved if mates file given',
99 usage = 'fastaq to_random_subset [options] <infile> <outfile> <percent>')
1010 parser.add_argument('--mate_file', help='Name of mates file')
11 parser.add_argument('--seed', help='Seed for random number generator. If not given, python\'s default is used', metavar='INT')
1112 parser.add_argument('infile', help='Name of input file')
1213 parser.add_argument('outfile', help='Name of output file')
13 parser.add_argument('percent', type=int, help='Per cent probability of keeping any given read (pair) in [0,100]', metavar='INT')
14 parser.add_argument('percent', type=float, help='Per cent probability of keeping any given read (pair) in [0,100]', metavar='FLOAT')
1415 options = parser.parse_args()
1516
17 random.seed(a=options.seed)
1618 seq_reader = sequences.file_reader(options.infile)
1719 fout = utils.open_file_write(options.outfile)
1820
2628 except StopIteration:
2729 print('Error! Didn\'t get mate for read', seq.id, file=sys.stderr)
2830 sys.exit(1)
29 if random.randint(0, 100) <= options.percent:
31 if 100 * random.random() <= options.percent:
3032 print(seq, file=fout)
3133 if options.mate_file:
3234 print(mate_seq, file=fout)
33
44 setup(
55 name='pyfastaq',
6 version='3.12.1',
6 version='3.13.0',
77 description='Script to manipulate FASTA and FASTQ files, plus API for developers',
88 packages = find_packages(),
99 author='Martin Hunt',