Mercurial > repos > peterjc > sample_seqs
comparison tools/sample_seqs/sample_seqs.py @ 3:02c13ef1a669 draft
Uploaded v0.2.1, fixed missing test file, more tests.
| author | peterjc |
|---|---|
| date | Fri, 27 Mar 2015 09:34:27 -0400 |
| parents | da64f6a9e32b |
| children | 6b71ad5d43fb |
comparison
equal
deleted
inserted
replaced
| 2:da64f6a9e32b | 3:02c13ef1a669 |
|---|---|
| 62 default=False, action="store_true", | 62 default=False, action="store_true", |
| 63 help="Show version and quit") | 63 help="Show version and quit") |
| 64 options, args = parser.parse_args() | 64 options, args = parser.parse_args() |
| 65 | 65 |
| 66 if options.version: | 66 if options.version: |
| 67 print("v0.2.0") | 67 print("v0.2.1") |
| 68 sys.exit(0) | 68 sys.exit(0) |
| 69 | 69 |
| 70 in_file = options.input | 70 in_file = options.input |
| 71 out_file = options.output | 71 out_file = options.output |
| 72 interleaved = options.interleaved | 72 interleaved = options.interleaved |
| 170 except: | 170 except: |
| 171 sys_exit("Bad -c count argument %r" % options.count) | 171 sys_exit("Bad -c count argument %r" % options.count) |
| 172 if N < 1: | 172 if N < 1: |
| 173 sys_exit("Bad -c count argument %r" % options.count) | 173 sys_exit("Bad -c count argument %r" % options.count) |
| 174 total = count_sequences(in_file, seq_format) | 174 total = count_sequences(in_file, seq_format) |
| 175 print("Input file has %i sequences" % total) | 175 sys.stderr.write("Input file has %i sequences\n" % total) |
| 176 if interleaved: | 176 if interleaved: |
| 177 # Paired | 177 # Paired |
| 178 if total % 2: | 178 if total % 2: |
| 179 sys_exit("Paired mode, but input file has an odd number of sequences: %i" | 179 sys_exit("Paired mode, but input file has an odd number of sequences: %i" |
| 180 % total) | 180 % total) |
