[pygr-notify] Issue 42 in pygr: KeyError for BLAST results that return no hits

codesite-noreply at google.com codesite-noreply at google.com
Fri Dec 12 11:20:11 PST 2008


Updates:
	Status: Fixed
	Owner: cjlee112
	Cc: ti... at idyll.org
	Labels: Milestone-Release0.8

Comment #1 on issue 42 by cjlee112: KeyError for BLAST results that return  
no hits
http://code.google.com/p/pygr/issues/detail?id=42

Hi Kenny,
thanks for reporting this.  To my mind, the problem is that the NLMSA  
interface gave
no easy way to see if the alignment was empty.  My resolution was to create  
a new
exception (EmptyAlignmentError, a subclass of ValueError), which is raised  
by NLMSA
if the user attempts to build() an alignment with no intervals.  Thus, if  
there are
no BLAST results, this exception would be raised during the blast()  
method.  If the
user wishes, he can ignore this by placing the blast() call within a  
try-except
block, like this:

from pygr.nlmsa_utils import EmptyAlignmentError
try:
     r = genome.blast(s, maxseq=1)
except EmptyAlignmentError:
     pass
else:
     # analyze the alignment results in r...

I guess we should also do something to improve the error message that you  
hit, to
explain the situation more clearly.  Presumably that error message should  
also be
changed to EmptyAlignmentError.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings



More information about the pygr-notify mailing list