Skip to content

Commit

Permalink
add dendrogram
Browse files Browse the repository at this point in the history
  • Loading branch information
kapoorlab committed Dec 30, 2023
1 parent b9c30d0 commit 981848f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/napatrackmater/Trackvector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}"
)
Expand Down
4 changes: 2 additions & 2 deletions src/napatrackmater/_version.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 981848f

Please sign in to comment.