[Biopython-dev] Changes in WWW BLAST format
Brad Chapman
chapmanb at arches.uga.edu
Fri Oct 13 11:58:45 EDT 2000
Jeff:
> Could you send the output? I'd like to add it to the suite of blast
tests.
Surely, it's attached. There is also an example in Doc/examples
(www_blast.py) which will give it you as well (I found the format change
when writing that example).
[patch with no respect for back-compatibility]
Jeff:
> I don't know for sure, but wouldn't this break compatibility with
> older formats?
*slaps self in forehead* Doh! Respect for old formats. Sorry, I guess I
was just too excited that I actually figured out how to fix the blast
parser :-).
Here's a better patch which supports the new change, and passes all of
the tests with the old formats. Let me know if there are any better ways
to do things. Thanks for catching my mistake. Now I remember why you are
the master of blast (not that I really needed any reminding :-).
Brad
*** NCBIWWW.py.orig Sat Aug 12 16:23:24 2000
--- NCBIWWW.py Fri Oct 13 11:47:12 2000
***************
*** 149,154 ****
--- 149,155 ----
attempt_read_and_call(uhandle, consumer.noevent, start='RID')
# Read the Query lines and the following blank line.
+ read_and_call_until(uhandle, consumer.noevent,
contains='Query=')
read_and_call(uhandle, consumer.query_info, contains='Query=')
read_and_call_until(uhandle, consumer.query_info, blank=1)
read_and_call_while(uhandle, consumer.noevent, blank=1)
***************
*** 203,212 ****
start='Sequences producing')
read_and_call(uhandle, consumer.noevent, blank=1)
! # Read the descriptions and the following blank line.
! read_and_call_until(uhandle, consumer.description, blank=1)
! read_and_call_while(uhandle, consumer.noevent, blank=1)
!
consumer.end_descriptions()
def _scan_alignments(self, uhandle, consumer):
--- 204,220 ----
start='Sequences producing')
read_and_call(uhandle, consumer.noevent, blank=1)
! # Read the descriptions
! read_and_call_while(uhandle, consumer.description,
! blank = 0, contains = '<a')
!
! # two choices here, either blanks lines or a </PRE>
! if attempt_read_and_call(uhandle, consumer.noevent, blank = 1):
! read_and_call_while(uhandle, consumer.noevent, blank = 1)
! # otherwise we've got a </PRE> (introduced in 2.1.1)
! else:
! read_and_call_while(uhandle, consumer.noevent, contains =
'</PRE>')
!
consumer.end_descriptions()
def _scan_alignments(self, uhandle, consumer):
-------------- next part --------------
A non-text attachment was scrubbed...
Name: m_cold_blast.out
Type: application/x-unknown
Size: 19423 bytes
Desc: not available
Url : http://portal.open-bio.org/pipermail/biopython-dev/attachments/20001013/2e58541a/m_cold_blast.bin
More information about the Biopython-dev
mailing list