From 981848f78e64bdcb183b48a7bd0ecf806c162168 Mon Sep 17 00:00:00 2001 From: kapoorlab Date: Sat, 30 Dec 2023 22:51:04 +0100 Subject: [PATCH] add dendrogram --- src/napatrackmater/Trackvector.py | 8 ++++++-- src/napatrackmater/_version.py | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/napatrackmater/Trackvector.py b/src/napatrackmater/Trackvector.py index 225c86b1..2e5707cc 100644 --- a/src/napatrackmater/Trackvector.py +++ b/src/napatrackmater/Trackvector.py @@ -744,13 +744,17 @@ def create_analysis_tracklets( dividing_track_ids = subset_dividing["Track ID"].unique() dividing_count = len(dividing_track_ids) non_dividing_count = len(non_dividing_track_ids) - if non_dividing_count > dividing_count: + if non_dividing_count > dividing_count and class_ratio > 0: non_dividing_track_ids = random.sample( list(non_dividing_track_ids), int(min(non_dividing_count, dividing_count * class_ratio)), ) else: - dividing_track_ids = random.sample(list(dividing_track_ids), non_dividing_count) + dividing_track_ids = random.sample(list(dividing_track_ids), dividing_count) + non_dividing_track_ids = random.sample( + list(non_dividing_track_ids), non_dividing_count + ) + print( f"Analysis data Dividing track counts {len(dividing_track_ids)}, Non Dividing track counts {len(non_dividing_track_ids)}" ) diff --git a/src/napatrackmater/_version.py b/src/napatrackmater/_version.py index a0ca980a..1cc46d2f 100644 --- a/src/napatrackmater/_version.py +++ b/src/napatrackmater/_version.py @@ -1,2 +1,2 @@ -__version__ = version = "4.7.0" -__version_tuple__ = version_tuple = (4, 7, 0) +__version__ = version = "4.7.1" +__version_tuple__ = version_tuple = (4, 7, 1)