我有下面给出的代码:
for pileupcolumn in samfile.pileup(max_depth = 1000000) :
X.append(pileupcolumn.n)
for pileupread in pileupcolumn.pileups:
if (pileupread.alignment.mapping_quality <= 15):
continue
if not pileupread.is_del and not pileupread.is_refskip:
if pileupread.alignment.query_qualities[pileupread.query_position] < 30:
# Skip entries with base phred scores < 10
continue
if pileupread.alignment.is_reverse: #negative
ReverseList[pileupcolumn.pos] += pileupread.alignment.query_sequence[pileupread.query_position]
else:
ForwardList[pileupcolumn.pos] += pileupread.alignment.query_sequence[pileupread.query_position]
上面的代码花费了很多时间,我想用 join 替换第 11 行和第 13 行的连接。有什么办法吗?