Printing quality scores from fastq file
Is there a python program where I can put in a fastq file and the output will be all of the quality scores
• 1,439 views
•
link
2 answers
Since the quality scores are every 4th line starting from the 4th line, you could just use sed.
sed -n '4~4p' input.fastq
• 0 views
•
link
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
• 0 views
•
link
Log in to answer this question.
Biopython would be the robust way to handle this. https://biopython.org/DIST/docs/tutorial/Tutorial.html#sec2016