天天看點

使用Biopython讀取fastq檔案使用Biopython讀取fastq檔案

文章目錄

  • 使用Biopython讀取fastq檔案
    • 讀取fastq檔案,輸出堿基序列和預測的準确度
    • 這裡是具體代碼的結果

使用Biopython讀取fastq檔案

讀取fastq檔案,輸出堿基序列和預測的準确度

from Bio import SeqIO

with open("./data2/ERR000020_2.fastq") as handle:
    record = SeqIO.parse(handle,"fastq")
    for lin in record:
        print("line information \n")
        print(lin.id)
        print(lin.seq)
        print(len(lin.letter_annotations['phred_quality']))
        q = lin.letter_annotations['phred_quality']
        num = [1- 10**(qi/(-10.0)) for qi in q]
        print(num)
           

這裡是具體代碼的結果

使用Biopython讀取fastq檔案使用Biopython讀取fastq檔案