[Biopython] BLAST against mouse genome only

Peter biopython at maubp.freeserve.co.uk
Fri Jun 19 08:07:04 EDT 2009


On Thu, Jun 18, 2009 at 6:51 PM, Peter Saffrey<pzs at dcs.gla.ac.uk> wrote:
>
> Thanks for the help - I'm still not quite there with this. The first suggestion
> was to add and entrez_query="mouse[orgn]" argument. This works, but it
> gives me everything in the mouse database - bacterial clones and all sorts.

Yes, the entrez_query just filters against the selected database (which was nr).

> I just want the matches against the reference sequence. Can I tune this further?
>
> The second suggestion was to use a database from the list here:
>
> http://www.ncbi.nlm.nih.gov/staff/tao/URLAPI/remote_blastdblist.html
>
> I've tried doing a query like this:
>
> result_handle = NCBIWWW.qblast("blastn", "gpipe/10090/ref_contig", seq)
>
> and it gives me urllib2.HTTPError 404s. I've also tried the database as
> "10090/refcontig" and using "refcontig" as the database with the
> entrez_query - they give blank results or internal server errors.

That should work - at least it does for me:

from Bio.Blast import NCBIWWW
fasta_string = open("m_cold.fasta").read()

#Blast against NR,
#result_handle = NCBIWWW.qblast("blastn", "nr", fasta_string)

#Blast against mouse data in NR,
#result_handle = NCBIWWW.qblast("blastn", "nr", fasta_string,
entrez_query="mouse[orgn]")
#Or,
#result_handle = NCBIWWW.qblast("blastn", "nr", fasta_string,
entrez_query="mouse[orgn]")

#See http://www.ncbi.nlm.nih.gov/staff/tao/URLAPI/remote_blastdblist.html
#Blast against "gpipe/10090/ref_contig" (getting XML data back)
#result_handle = NCBIWWW.qblast("blastn", "gpipe/10090/ref_contig",
fasta_string)

#If you want plain text, and to limit the output a bit
result_handle = NCBIWWW.qblast("blastn", "gpipe/10090/ref_contig", fasta_string,
                               alignments=20, descriptions=20,
format_type="Text")
print result_handle.read()


Maybe you caught the NCBI during a busy period?

Peter


More information about the Biopython mailing list