我正在尝试使用后缀 /1 和 /2 更改 fastq 标头并写回新的 fie。但是,我收到了这个错误:
No suitable quality scores found in letter_annotations of SeqRecord
有没有办法解决这个问题?我是否需要修改质量分数信息以匹配更改的 fastq 标头?
import sys
from Bio.Seq import Seq
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord
file = sys.argv[1]
final_records=[]
for seq_record in SeqIO.parse(file, "fastq"):
print seq_record.format("fastq")
#read header
header =seq_record.id
#add /1 at the end
header ="{0}/1".format(header)
# print(repr(seq_record.seq))
record = SeqRecord(seq_record.seq,id=header,description=seq_record.description)
final_records.append(record)
SeqIO.write(final_records, "my_example.fastq", "fastq")