Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用python格式解析BLAST.xml需要小写字符串_Python_Xml_Blast - Fatal编程技术网

使用python格式解析BLAST.xml需要小写字符串

使用python格式解析BLAST.xml需要小写字符串,python,xml,blast,Python,Xml,Blast,返回值错误:searchIO_utils.py的get_processor中的第25行需要格式(小写字符串)。 AtCBL1_CDS.txt是一个包含fasta格式蛋白质序列的文件。 我想知道如何正确访问我的BLAST输出 from Bio.Blast import NCBIWWW from Bio.Blast import NCBIXML from Bio import SearchIO #open query file as fasta_file fasta_file= open("AtCB

返回值错误:searchIO_utils.py的get_processor中的第25行需要格式(小写字符串)。
AtCBL1_CDS.txt是一个包含fasta格式蛋白质序列的文件。
我想知道如何正确访问我的BLAST输出

from Bio.Blast import NCBIWWW
from Bio.Blast import NCBIXML
from Bio import SearchIO
#open query file as fasta_file
fasta_file= open("AtCBL1_CDS.txt").read()

#set up blast parameters
result = NCBIWWW.qblast ("blastp", "prot", fasta_file)


#run and create my_blast as output file
with open("my_blast.xml", "w") as out_handle:
    out_handle.write(result.read())

#close file
result.close()
out_handle.close()

result_handle=open("my_blast.xml")

blastp_result=SearchIO.read(result_handle)
print(blastp_result)

SearchIO.read的第二个参数应该是小写的格式参数:

  • format—表示支持的格式之一的小写字符串。例如,xml blast格式的blast xml
在您的情况下,该行应为:

blastp_result=SearchIO.read(result_handle,'blast-xml')