Entering edit mode
12 months ago
truecorder
•
0
Is there a python program where I can put in a fastq file and the output will be all of the quality scores
Is there a python program where I can put in a fastq file and the output will be all of the quality scores
Since the quality scores are every 4th line starting from the 4th line, you could just use sed.
sed -n '4~4p' input.fastq
A Python program that prints out qualities could be as simple as:
stream = open("reads.fq")
for line in stream:
next(stream)
next(stream)
print(next(stream), end='')
Though the sed
answer by rpolicastro is probably the way to go
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Biopython would be the robust way to handle this. https://biopython.org/DIST/docs/tutorial/Tutorial.html#sec2016