Skip to content

Commit

Permalink
Merge pull request #20 from Bornlex/fix/align
Browse files Browse the repository at this point in the history
fix: __str__ call to remove self.align and make sure both _alseq lists…
  • Loading branch information
scastlara authored Jul 12, 2024
2 parents 83aab21 + e48a68b commit 988f4ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions minineedle/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ def __init__(self, seq1: Sequence[ItemToAlign], seq2: Sequence[ItemToAlign]) ->
self._is_iterable(self.seq2)

def __str__(self) -> str:
if not self._alseq1:
self.align()
return "Alignment of {} and {}:\n\t{}\n\t{}\n".format(
"SEQUENCE 1",
"SEQUENCE 2",
Expand Down Expand Up @@ -213,6 +211,8 @@ def _fill_matrices(self) -> None:
self._check_best_score(diagscore, topscore, leftscore, irow, jcol)

def _trace_back_alignment(self, irow: int, jcol: int) -> None:
self._alseq1, self._alseq2 = [], []

while True:
if self._pmatrix[irow][jcol] == "diag":
self._alseq1.append(self.seq1[jcol - 1])
Expand Down

0 comments on commit 988f4ed

Please sign in to comment.