Skip to content

Commit

Permalink
Merge branch 'release-1.3.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
tzok committed Dec 3, 2021
2 parents f131dfe + 6888651 commit df0d228
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/eltetrado/compute/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.3
1.3.4
13 changes: 11 additions & 2 deletions src/eltetrado/compute/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,12 +791,21 @@ def is_next_sequentially(nt1, nt2):
best_score = 0
best_order = tj.nucleotides

for nts2 in itertools.permutations(tj.nucleotides):
n1, n2, n3, n4 = tj.nucleotides
viable_permutations = [(n1, n2, n3, n4), (n2, n3, n4, n1), (n3, n4, n1, n2), (n4, n1, n2, n3),
(n1, n4, n3, n2), (n4, n3, n2, n1), (n3, n2, n1, n4), (n2, n1, n4, n3)]

for nts2 in viable_permutations:
score = 0
for i in range(4):
if is_next_by_stacking(nts1[i], nts2[i]) or is_next_sequentially(nts1[i], nts2[i]):
score += 1
if score > best_score:
if score == best_score:
score_stacking = sum(1 for i in range(4) if is_next_by_stacking(nts1[i], nts2[i]))
score_sequential = sum(1 for i in range(4) if is_next_sequentially(nts1[i], nts2[i]))
if score_sequential > score_stacking:
best_order = nts2
elif score > best_score:
best_score = score
best_order = nts2
if best_score == 4:
Expand Down

0 comments on commit df0d228

Please sign in to comment.