This is a test version of Biostars. For the public version, visit https://www.biostars.org.
blast against genomes in biopython
from Bio import Entrez, SeqIO
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?

genome blast qblast biopython

Are you sure you get a result? I guess that your result is empty, print the number of records and alignments received.

did you try "nt" instead of nr? try to remove/edit entrez_query.

in blast interface i get a result... the sequence is actually a sequence of

Beutenbergia cavernae DSM 12333 genome.. when i remove entrez_query it return result... i thing the entrz_query is wrong..

There is no alignment.

This is cross-posted on SO. Either answer this yourself or delete it, so that it will not waste others' time.

Hello halima.loulou!

We believe that this post is does not fit the main topic of this site.

closing

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

0 answers

No answers yet.

Log in to answer this question.