[Biopython-dev] Follow up to bug incoming/75

daishi at egcrc.net daishi at egcrc.net
Mon Jul 15 19:15:44 EDT 2002


I believe that the following patch fixes the problem that
I mentioned in the bug report (side note: I couldn't seem
to find a way to follow up on the bug report through the
web interface provided - did I miss something?)

I'm not entirely sure that I understood all of the code,
however, so please consider the patch with that in mind.
In particular, I didn't entirely understand the code at
L332-333 in the CVS version 1.3 of fastpairwise.py.
I had to comment them out in my patch to get things to
work properly.

Daishi


*** /usr/local/src/biopython/Bio/Align/fastpairwise.py	Tue Jul  9 15:08:53 2002
--- fastpairwise.py	Mon Jul 15 16:03:05 2002
***************
*** 302,308 ****
           else:
               # Since the length of the alignment is unknown, set an
               # offset from the end of the alignment.
!             begin, end = 0, -len(seqA)
               if not end:
                   end = None
           x = seqA, seqB, score, begin, end, row, col, []
--- 302,308 ----
           else:
               # Since the length of the alignment is unknown, set an
               # offset from the end of the alignment.
!             begin, end = None, -len(seqA)
               if not end:
                   end = None
           x = seqA, seqB, score, begin, end, row, col, []
***************
*** 329,341 ****
                   nbegin = begin
                   nseqA = cseqA[:-taillen] + seqA
                   nseqB = cseqB[:-taillen] + seqB
!                 if nbegin < cbegin:
!                     nbegin = cbegin
                   x = nseqA, nseqB, score, nbegin, end, -1, -1, path
                   in_process.append(x)
           elif row < 0 and col < 0:
               # This one is done.  Put it into the tracebacks list and
               # continue.
               tracebacks.append((seqA, seqB, score, begin, end))
               path.pop()   # Don't cache the last step.
               # Update the cache.
--- 329,343 ----
                   nbegin = begin
                   nseqA = cseqA[:-taillen] + seqA
                   nseqB = cseqB[:-taillen] + seqB
! #                if nbegin < cbegin:
! #                    nbegin = cbegin
                   x = nseqA, nseqB, score, nbegin, end, -1, -1, path
                   in_process.append(x)
           elif row < 0 and col < 0:
               # This one is done.  Put it into the tracebacks list and
               # continue.
+             if not begin:
+                 begin = 0
               tracebacks.append((seqA, seqB, score, begin, end))
               path.pop()   # Don't cache the last step.
               # Update the cache.
***************
*** 347,360 ****
           elif row < 0:
               nseqA = gap_char + seqA
               nseqB = sequenceB[col:col+1] + seqB
!             if not global_alignment:
                   begin = col + 1
               x = nseqA, nseqB, score, begin, end, row, col-1, path
               in_process.append(x)
           elif col < 0:
               nseqA = sequenceA[row:row+1] + seqA
               nseqB = gap_char + seqB
!             if not global_alignment:
                   begin = row + 1
               x = nseqA, nseqB, score, begin, end, row-1, col, path
               in_process.append(x)
--- 349,362 ----
           elif row < 0:
               nseqA = gap_char + seqA
               nseqB = sequenceB[col:col+1] + seqB
!             if not (global_alignment or begin):
                   begin = col + 1
               x = nseqA, nseqB, score, begin, end, row, col-1, path
               in_process.append(x)
           elif col < 0:
               nseqA = sequenceA[row:row+1] + seqA
               nseqB = gap_char + seqB
!             if not (global_alignment or begin):
                   begin = row + 1
               x = nseqA, nseqB, score, begin, end, row-1, col, path
               in_process.append(x)




More information about the Biopython-dev mailing list