Skip to content

Commit 3cf32ef

Browse files
author
lala8
committed
fix bug in edit distance calculation for unequal length sequences
1 parent f15d0fd commit 3cf32ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/polygraph/sequence.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ def groupwise_mean_edit_dist(seqs, group_col="Group"):
201201
for g1 in groups:
202202
for g2 in groups:
203203
dist = (
204-
dist_matrix[seqs[group_col] == g1, seqs[group_col] == g2].mean().mean()
204+
dist_matrix[seqs[group_col] == g1, :][:, seqs[group_col] == g2]
205+
.mean()
206+
.mean()
205207
)
206208
group_dist.append((g1, g2, dist))
207209

0 commit comments

Comments
 (0)