我只是在命令行上运行了psiblast,并将结果保存在我的_output.xml中。我现在正试图使用Biopython解析xml文件,这样我就可以迭代每一轮psiblast生成的结果,但这给我带来了一些问题。这是我的密码:
from Bio.Blast import NCBIXML
result_handle = open('my_output.xml', 'r')
blast_records = NCBIXML.parse(result_handle)
for blast_record in blast_records:
print blast_record.rounds
我得到的错误是:
Traceback (most recent call last):
File "parse_psiblast_output.py", line 10, in <module>
print blast_record.rounds
AttributeError: 'Blast' object has no attribute 'rounds'
我想做的是: 对于每个查询序列,从该查询的最终psiblast迭代中获取所有命中率
我将假设您正在尝试解析当前NCBI Blast+包的输出,而不是任何遗留Blast包(现在已经过时了)
考虑到这一点,您应该使用
Bio.SearchIO
模块我还注意到,您可能正在使用Python2.7,因为
print
语句中缺少大括号。如果可能的话,您真的应该使用Python3+。自2020年起,Biopython将放弃对Python 2.7的支持相关问题 更多 >
编程相关推荐