This is a test version of Biostars. For the public version, visit https://www.biostars.org.
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

fastq

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

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

Log in to answer this question.