Question: Import the quality scores from a FASTQ file in Python 3 Biopython
0
gravatar for cristian
2.0 years ago by
cristian230
cristian230 wrote:

Hi,

I would like to import the FASTQ scores in Python. I have figured the 'seq' attribute from the records in a FASTQ object but does anybody know how to extract the quality score as well, please?

from Bio import SeqIO
records = SeqIO.parse("assembly.fastq", "fastq")
for i, record in enumerate(records):
    if i == 1:
        print(record.seq)
        break

Thanks.

Best, C.

ADD COMMENTlink modified 2.0 years ago by lakhujanivijay4.4k • written 2.0 years ago by cristian230
3
gravatar for lakhujanivijay
2.0 years ago by
lakhujanivijay4.4k
India
lakhujanivijay4.4k wrote:

Try this:

from Bio import SeqIO
for record in SeqIO.parse(input_file, "fastq"):
    score=record.letter_annotations["phred_quality"]
ADD COMMENTlink written 2.0 years ago by lakhujanivijay4.4k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 657 users visited in the last hour