def get_bin(fq, sizeRange):
'''
Loop over the fastq file
Extract list of nucleotides and list of quality scores in tuples in list
Only select those reads of which the length is within the size range
'''
logging.info("Extracting nucleotides and quality scores of selected bin.")
return [(list(rec.seq), list(rec.letter_annotations["phred_quality"]))
for rec in SeqIO.parse(fq, "fastq") if sizeRange[0] < len(rec) < sizeRange[1]]
评论列表
文章目录