1 |
#!/usr/bin/env python |
2 |
|
3 |
""" |
4 |
sra_to_solid.py |
5 |
""" |
6 |
|
7 |
import sys |
8 |
|
9 |
use_message = ''' |
10 |
convert SOLiD sequences downloaded from SRA FTP (not via the web interface) to a format TopHat processes. |
11 |
the script simply removes one primer quality value '!' from the sequences. |
12 |
|
13 |
Usage: |
14 |
sra_to_solid input.fastq > output.fastq |
15 |
''' |
16 |
|
17 |
if __name__ == "__main__": |
18 |
if len(sys.argv) == 2: |
19 |
input_file = open(sys.argv[-1], 'r') |
20 |
expect_qual = 0 |
21 |
for line in input_file: |
22 |
line = line.rstrip('\n') |
23 |
if expect_qual % 4 == 3: |
24 |
line = line[1:] |
25 |
|
26 |
print line |
27 |
expect_qual = (expect_qual + 1) % 4 |
28 |
|
29 |
else: |
30 |
print use_message; |