Skip to content

Commit

Permalink
slidingWindow optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
TahiriNadia authored Nov 8, 2023
1 parent 88877fd commit f1c00cd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions aphylogeo/alignement.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,15 +757,16 @@ def slidingWindow(self):
for i in range(0, seq_len, step):
if i + step < seq_len:
windowed_alignment[f"{i}_{i + step - 1}"] = {key: val[i : i + step - 1] for key, val in paddedMSA.items()}
combinations = itertools.combinations(windowed_alignment[f"{i}_{i + step - 1}"].values(),2)
combinations = itertools.combinations(windowed_alignment[f"{i}_{i + step - 1}"].values(),2)
df = pd.DataFrame(list(combinations))
if self.rate_similarity[0] < self.similarity(df):
windowed_alignment.pop(f"{i}_{i + step - 1}")
else:
windowed_alignment[f"{i}_{seq_len-1}"] = {key: val[i : i + seq_len - 1] for key, val in paddedMSA.items()}
combinations = itertools.combinations(windowed_alignment[f"{i}_{seq_len-1}"].values(),2)
df = pd.DataFrame(list(combinations))

#if self.rate_similarity[0] < self.similarity(df):
# windowed_alignment.pop(f"{i}_{seq_len-1}")
# print(self.rate_similarity)
df = pd.DataFrame(list(combinations))
if self.rate_similarity[0] < self.similarity(df):
windowed_alignment.pop(f"{i}_{seq_len-1}")

# JUST TO MAKE THE DEBUG FILES
if self.makeDebugFiles:
Expand Down

0 comments on commit f1c00cd

Please sign in to comment.