我试着在网络上运行ncbi在python上的爆炸。
from Bio.Blast import NCBIWWW
from Bio.Blast import NCBIXML
from Bio import SeqIO
record = SeqIO.read(r"C:\Users\loops\Downloads\biopy_resources\Section1\Chap8\buccal_swab.unmapped1.fasta",format="fasta")
handle = NCBIWWW.qblast("blastn","nt",record.seq)
blast_records = NCBIXML.parse(handle)
E_VALUE_THRESH = 0.0001
for blast_record in blast_records:
for alignment in blast_record.alignments:
for hsp in alignment.hsps:
if hsp.expect < E_VALUE_THRESH:
print(alignment.title)
print(alignment.length)
print(hsp.expect)
print(hsp.query[0:75])
print(hsp.match[0:75])
print(hsp.sbjct[0:75]) 读取fasta文件成功,但没有显示结果。我想它卡在这里了: handle = NCBIWWW.qblast("blastn","nt",record.seq)
from Bio.Blast import NCBIWWW
handle = NCBIWWW.qblast("blastn","nt","8332116")这也不管用。
发布于 2022-11-08 12:54:27
如果没有错误,可能没有结果,因为e值是否超过阈值?您可以禁用if条件或可能与最终在python中缓慢运行的问题有关:NCBIWWW.qblast parsing xml files
https://stackoverflow.com/questions/74360808
复制相似问题