Printing quality scores from fastq file
2
0
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

fastq • 766 views
ADD COMMENT
1
Entering edit mode

Biopython would be the robust way to handle this. https://biopython.org/DIST/docs/tutorial/Tutorial.html#sec2016

ADD REPLY
2
Entering edit mode
12 months ago

Since the quality scores are every 4th line starting from the 4th line, you could just use sed.

sed -n '4~4p' input.fastq
ADD COMMENT
1
Entering edit mode
12 months ago

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

ADD COMMENT

Login before adding your answer.

Traffic: 1911 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6