Skip to content

Commit

Permalink
performance optimization in clean_alignments
Browse files Browse the repository at this point in the history
  • Loading branch information
jchang committed Dec 18, 2001
1 parent 87bb250 commit 1831e03
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Bio/Align/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,12 @@ def find_local_best(score_matrix):
return _find_best(positions)

def clean_alignments(alignments):
alignments.sort()
alignments = listfns.items(alignments) # Get rid of duplicates
i = 0
while i < len(alignments):
# Get rid of duplicates.
if i < len(alignments)-1 and alignments[i] == alignments[i+1]:
del alignments[i]
continue
seqA, seqB, score, begin, end = alignments[i]
# Make sure end is set reasonably.
if end == None: # global alignment
if end is None: # global alignment
end = len(seqA)
elif end < 0:
end = end + len(seqA)
Expand Down

0 comments on commit 1831e03

Please sign in to comment.