Skip to content

Commit 9de9dc8

Browse files
author
Aditya Ambati
authored
Update FASTQ_to_FASTA.py
1 parent 46b4dd2 commit 9de9dc8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

FASTQ_to_FASTA.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ def main(fastq, fasta, gz):
4242
outfile.write(fasta_line)
4343
fastas += 1
4444
else:
45-
fasta_header = line.replace('@', '>')
46-
line_id += 1
47-
outfile.write(fasta_header)
45+
if '@' not in line:
46+
print 'are you sure this is a fastq ??'
47+
else:
48+
fasta_header = line.replace('@', '>')
49+
line_id += 1
50+
outfile.write(fasta_header)
4851
outfile.close()
4952
print 'FASTA records written', fastas, 'average length of fasta sequences ', float(fasta_length//fastas)
5053

0 commit comments

Comments
 (0)