From f166cfa7c98c19ed11345fe3c4331705ef16d713 Mon Sep 17 00:00:00 2001 From: Nick Croucher Date: Tue, 8 Oct 2024 12:00:16 +0100 Subject: [PATCH] Fix selection of between strain cluster --- PopPUNK/bgmm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PopPUNK/bgmm.py b/PopPUNK/bgmm.py index 7da7c49f..fac52eca 100644 --- a/PopPUNK/bgmm.py +++ b/PopPUNK/bgmm.py @@ -66,7 +66,7 @@ def findBetweenLabel_bgmm(means, assignments): most_dists[mixture_component] = np.count_nonzero(assignments == mixture_component) sorted_dists = sorted(most_dists.items(), key=operator.itemgetter(1), reverse=True) - return(sorted_dists[rank][0]) + return(sorted_dists[0][0]) def findWithinLabel(means, assignments, rank = 0): """Identify within-strain links