blast against genomes in biopython

折月煮酒 提交于 2019-12-02 19:46:06

问题


from Bio.Blast import NCBIXML
from Bio.Blast import NCBIWWW

result_handle = NCBIWWW.qblast(
    "blastn",
    "nr",
    "CACTTATTTAGTTAGCTTGCAACCCTGGATTTTTGTTTACTGGAGAGGCC",
    entrez_query='"Beutenbergia cavernae DSM 12333" [Organism]')

blast_records = NCBIXML.parse(result_handle)

for blast_record in blast_records:
    for alignment in blast_record.alignments:
        for hsp in alignment.hsps:
            print(hsp.query[0:75] + '...')
            print(hsp.match[0:75] + '...')
            print(hsp.sbjct[0:75] + '...')

this does not give me an output, although the sequence is actually a sequence of the genome, so i must get a result. where is the error? the query is correct?


回答1:


Your query isn't returning any results. The default parameters for blast are the cause. These parameters work better in this particular case of small length queries:

result_handle = NCBIWWW.qblast(
    "blastn",
    "nr",
    "CACTTATTTAGTTAGCTTGCAACCCTGGATTTTTGTTTACTGGAGAGGCC",
    megablast=False,
    expect=1000,
    word_size=7,
    nucl_reward=1,
    nucl_penalty=-3,
    gapcosts="5 2",
    entrez_query='Beutenbergia cavernae DSM 12333 [Organism]')

Particularly the expect parameter plays a major role here.



来源:https://stackoverflow.com/questions/24695028/blast-against-genomes-in-biopython

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!