From eb56f9c849fdd2b819a17cdc7e7795eeb5e0b6b9 Mon Sep 17 00:00:00 2001 From: kapoorlab Date: Fri, 26 Jul 2024 12:30:12 +0000 Subject: [PATCH] lower numpy version --- setup.cfg | 2 +- src/napatrackmater/Trackmate.py | 9 +++++++-- src/napatrackmater/Trackvector.py | 8 ++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/setup.cfg b/setup.cfg index e0f4d27..e99b727 100644 --- a/setup.cfg +++ b/setup.cfg @@ -46,7 +46,7 @@ install_requires = pymesh torchsummary statsmodels - numpy<=1.25.0 + numpy<=1.24.0 python_requires = >=3.8 diff --git a/src/napatrackmater/Trackmate.py b/src/napatrackmater/Trackmate.py index 6d777e1..51f681b 100644 --- a/src/napatrackmater/Trackmate.py +++ b/src/napatrackmater/Trackmate.py @@ -2046,7 +2046,7 @@ def _update_spot_fate(self, TrackIds, fate_label): {self.fate_key: fate_label} ) - def _get_trackmate_ids_by_location(self, dataframe): + def _get_trackmate_ids_by_location(self, dataframe, tracklet_length = None): trackmate_track_ids = [] t = int(self.tend) for index, row in dataframe.iterrows(): @@ -2070,7 +2070,12 @@ def _get_trackmate_ids_by_location(self, dataframe): spot_properties_dict = self.unique_spot_properties[spot_id] if self.trackid_key in spot_properties_dict.keys(): trackmate_track_id = spot_properties_dict[self.trackid_key] - trackmate_track_ids.append(trackmate_track_id) + if tracklet_length is None: + trackmate_track_ids.append(trackmate_track_id) + else: + track_duration = spot_properties_dict[self.track_duration_key] + if track_duration > tracklet_length: + trackmate_track_ids.append(trackmate_track_id) return trackmate_track_ids diff --git a/src/napatrackmater/Trackvector.py b/src/napatrackmater/Trackvector.py index 3fbb391..1737975 100644 --- a/src/napatrackmater/Trackvector.py +++ b/src/napatrackmater/Trackvector.py @@ -4103,7 +4103,7 @@ def get_most_frequent_prediction(predictions): return "UnClassified" -def save_cell_type_predictions(tracks_dataframe, cell_map, predictions, save_dir): +def save_cell_type_predictions(tracks_dataframe, cell_map, predictions, save_dir, channel): cell_type = {} for value in cell_map.values(): @@ -4129,11 +4129,11 @@ def save_cell_type_predictions(tracks_dataframe, cell_map, predictions, save_dir save_name = f"{value}_inception" if "Goblet" in value: - save_name = "goblet_cells_annotations_inception" + save_name = f"goblet_cells_{channel}annotations_inception" if "Radial" in value: - save_name = "radially_intercalating_cells_annotations_inception" + save_name = f"radially_intercalating_cells_{channel}annotations_inception" if "Basal" in value: - save_name = "basal_cells_annotations_inception" + save_name = f"basal_cells_{channel}annotations_inception" filename = os.path.join(save_dir, f"{save_name}.csv") df.to_csv(filename, index=True)