[Biopython-dev] warning in NCBIWWW.py

Andrew Dalke dalke at dalkescientific.com
Thu Aug 18 18:21:19 EDT 2005


Using NCBIWWW.py I get

Bio/Blast/NCBIWWW.py:1070: UserWarning: qblast works only with blastn 
and blastp for now.
   warnings.warn("qblast works only with blastn and blastp for now.")

I'm using blastp.  Do I really need that warning?  Jeff commented


     # Is this warning useful?  If the program is blastn or blastp, the
     # warning is not necessary because the program is supported.  If
     # it is not, the script will raise an exception anyway.
     # - Jeff
     import warnings
     warnings.warn("qblast works only with blastn and blastp for now.")
     assert program == 'blastn' or program == 'blastp'


That should more likely be

   if program not in ("blastn", "blastp"):
       raise AssertionError("qblast only supports 'blastn' and 'blastp' "
                            "applications, not %r" % (program,))

assert errors are turned off if Python is run with -O so I only
use them to double check internal invariants, not as a way to
validate user input.

Also, like someone mentioned earlier, qblast uses the lower-level
httplib instead of urllib/urlib2 to do the HTTP connection to qblast.
That doesn't work on sites that depend on proxies to talk to
the outside world.

					Andrew
					dalke at dalkescientific.com



More information about the Biopython-dev mailing list