[Biopython-dev] python newbies blast problem
jeffrey_chang at stanfordalumni.org
Tue Jul 13 23:47:32 EDT 2004
This is because the NCBI website is not really meant to be queried by
computer scripts. It looks like a recent change has broken the
NCBIWWW.blast function. Fortunately, NCBI does have a computer
friendly BLAST API called QBLAST. I added an interface to QBLAST into
biopython called NCBIWWW.qblast. Please get the updated version of the
NCBIWWW.py from CVS, and replace NCBIWWW.blast with NCBIWWW.qblast in
your script, and see if that fixes things.
The anonymous CVS is at:
On Jul 13, 2004, at 9:56 AM, h.j.tipney at stud.man.ac.uk wrote:
> I posted this to the other mailing list and got no response so I'm
> hoping you guys can help me. I'm very new to programming and
> even newer to python, so I apologise in advance if this is a simple
> problem with an obvious solution but there are no python
> near to help me. Anyway, I inherited the script below and have been
> using it on and off as part of a larger workflow. It has been running
> fine, but I ran it again last week and it didn't give the output I
> expected - it returned the 'your results will be updated in X seconds'
> page rather than the actual results. It has been a while since I had
> used this program and both blast and biopython had been updated
> I've now got the new biopython release (1.30) but I still get the
> 'wrong' output. I'm using python 2.3.3 on solaris, if that helps. Any
> help would be greatly appreciated! Thank you in advance Hannah
> from Bio import Fasta
> from Bio.Blast import NCBIWWW
> import sys
> import getopt
> opts, args =
> print sys.argv
> print opts
> if len(args)==0:
> print "no file given"
> program = "blastn"
> database = "nr"
> format = "Text"
> #"Homo sapiens [ORGN]"
> for o,a in opts:
> print o,a
> if o == "--program":
> program = a
> if o == "--database":
> database = a
> if o == "--format":
> format = a
> if o == "--entrez_query":
> short_query = a
> if short_query=="human":
> query="Homo sapiens [ORGN]"
> print "program = %s , database = %s, query = %s" %
> file_for_blast = open(args, 'r')
> f_iterator = Fasta.Iterator(file_for_blast)
> f_record = f_iterator.next()
> b_results = NCBIWWW.blast(program, database,
> f_record,format_type=format, entrez_query=query,timeout=60)
> blast_results = b_results.read()
> ------- End of forwarded message -------
> Hannah Tipney
> Manchester University,
> Academic Unit of Medical Genetics,
> St Mary's Hospital,
> Hathersage Road,
> Manchester. M13 0JH.
> tel: +44 (0)161 276 6602
> fax: +44 (0)161 276 6606
> Biopython-dev mailing list
> Biopython-dev at biopython.org
More information about the Biopython-dev