我正在尝试使用核苷酸序列进行 BLAST 搜索并打印最佳匹配命中,但不确定我应该使用哪个选项/命令。有max_hpsp
和之类的选项best_hit_overhang
。我不知道它们的差异,我只想打印 1 个命中。(最佳匹配)我应该使用 max_hpsp 1
吗?
我写了这段代码,但它仍然没有用。如果你能告诉我,我错在哪里以及应该怎么做,我将不胜感激:) 谢谢!
from Bio.Blast import NCBIWWW
seq = Seq("GTTGA......CT")
def best_matching_hit(seq):
try:
result_handle = NCBIWWW.qblast("blastn", "nt", seq)
except:
print('BLAST run failed!')
return None
blast_record = NCBIXML.read(result_handle)
for hit in blast_record.alignments:
for hsp in hit.hsps:
if hsp.expect == max_hsps 1:
print(hit.title)
print(hsp.sbjct)
best_matching_hit(seq)