[Biopython-dev] bug in Martel-0.4

Andrew Dalke dalke at acm.org
Wed Dec 6 03:12:29 EST 2000


There's a bug in Martel-0.4 and earlier versions.

Suppose you have  ([<>][ABC])+[<>]?
and want to match it against

   <A<B<

The "<A" matches the first [<>][ABC].  The "<B" matches
the second [<>][ABC].  The parser tries to match the final
"<" against [<>][ABC] and should fail then try to match
the "<" against [<>]? .

The bug was that it would match the "<" against the [<>] in
[<>][ABC] and fail at that point.  It gives an assertion error
about "l" being greater than "r".

Here's the patch.  The only consequence should be a small hit
in performance.

Index: Generate.py
===================================================================
RCS file: /home/dalke/cvsroot/Martel/Generate.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -r1.18 -r1.19
271c271
<         result.append( (None, TT.SubTable, tuple(tagtable)) )
---
>         result.append( (">ignore", TT.Table, tuple(tagtable)) )
275c275
<         result.append( (None, TT.SubTable, tuple(tagtable),
---
>         result.append( (">ignore", TT.Table, tuple(tagtable),


(Okay, there are other bugs, but this is one which is part
of the core code and is hard to figure out or work around.)

                    Andrew





More information about the Biopython-dev mailing list