celldetective 1.4.0__py3-none-any.whl → 1.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- celldetective/_version.py +1 -1
- celldetective/exceptions.py +11 -0
- celldetective/filters.py +7 -1
- celldetective/gui/InitWindow.py +4 -1
- celldetective/gui/__init__.py +2 -9
- celldetective/gui/about.py +2 -2
- celldetective/gui/base_annotator.py +786 -0
- celldetective/gui/classifier_widget.py +18 -13
- celldetective/gui/configure_new_exp.py +51 -30
- celldetective/gui/control_panel.py +10 -7
- celldetective/gui/{signal_annotator.py → event_annotator.py} +473 -1437
- celldetective/gui/generic_signal_plot.py +2 -1
- celldetective/gui/gui_utils.py +5 -2
- celldetective/gui/help/neighborhood.json +2 -2
- celldetective/gui/layouts.py +21 -11
- celldetective/gui/{signal_annotator2.py → pair_event_annotator.py} +3 -1
- celldetective/gui/process_block.py +129 -91
- celldetective/gui/processes/downloader.py +37 -34
- celldetective/gui/processes/measure_cells.py +14 -8
- celldetective/gui/processes/segment_cells.py +21 -6
- celldetective/gui/processes/track_cells.py +12 -13
- celldetective/gui/settings/__init__.py +7 -0
- celldetective/gui/settings/_settings_base.py +70 -0
- celldetective/gui/{retrain_signal_model_options.py → settings/_settings_event_model_training.py} +35 -91
- celldetective/gui/{measurement_options.py → settings/_settings_measurements.py} +28 -81
- celldetective/gui/{neighborhood_options.py → settings/_settings_neighborhood.py} +1 -1
- celldetective/gui/settings/_settings_segmentation.py +49 -0
- celldetective/gui/{retrain_segmentation_model_options.py → settings/_settings_segmentation_model_training.py} +33 -79
- celldetective/gui/{signal_annotator_options.py → settings/_settings_signal_annotator.py} +73 -95
- celldetective/gui/{btrack_options.py → settings/_settings_tracking.py} +64 -87
- celldetective/gui/styles.py +2 -1
- celldetective/gui/survival_ui.py +1 -1
- celldetective/gui/tableUI.py +25 -0
- celldetective/gui/table_ops/__init__.py +0 -0
- celldetective/gui/table_ops/merge_groups.py +118 -0
- celldetective/gui/viewers.py +3 -5
- celldetective/gui/workers.py +0 -2
- celldetective/io.py +98 -55
- celldetective/links/zenodo.json +145 -144
- celldetective/measure.py +31 -26
- celldetective/preprocessing.py +34 -21
- celldetective/regionprops/_regionprops.py +16 -5
- celldetective/scripts/measure_cells.py +5 -5
- celldetective/scripts/measure_relative.py +16 -11
- celldetective/scripts/segment_cells.py +4 -4
- celldetective/scripts/segment_cells_thresholds.py +3 -3
- celldetective/scripts/track_cells.py +7 -7
- celldetective/scripts/train_segmentation_model.py +10 -1
- celldetective/tracking.py +10 -4
- celldetective/utils.py +59 -58
- {celldetective-1.4.0.dist-info → celldetective-1.4.1.dist-info}/METADATA +1 -1
- celldetective-1.4.1.dist-info/RECORD +123 -0
- tests/gui/__init__.py +0 -0
- tests/gui/test_new_project.py +228 -0
- tests/{test_qt.py → gui/test_project.py} +22 -26
- tests/test_preprocessing.py +2 -2
- celldetective/models/segmentation_effectors/ricm_bf_all_last/config_input.json +0 -79
- celldetective/models/segmentation_effectors/ricm_bf_all_last/ricm_bf_all_last +0 -0
- celldetective/models/segmentation_effectors/ricm_bf_all_last/training_instructions.json +0 -37
- celldetective/models/segmentation_effectors/test-transfer/config_input.json +0 -39
- celldetective/models/segmentation_effectors/test-transfer/test-transfer +0 -0
- celldetective/models/signal_detection/NucCond/classification_loss.png +0 -0
- celldetective/models/signal_detection/NucCond/classifier.h5 +0 -0
- celldetective/models/signal_detection/NucCond/config_input.json +0 -1
- celldetective/models/signal_detection/NucCond/log_classifier.csv +0 -126
- celldetective/models/signal_detection/NucCond/log_regressor.csv +0 -282
- celldetective/models/signal_detection/NucCond/regression_loss.png +0 -0
- celldetective/models/signal_detection/NucCond/regressor.h5 +0 -0
- celldetective/models/signal_detection/NucCond/scores.npy +0 -0
- celldetective/models/signal_detection/NucCond/test_confusion_matrix.png +0 -0
- celldetective/models/signal_detection/NucCond/test_regression.png +0 -0
- celldetective/models/signal_detection/NucCond/validation_confusion_matrix.png +0 -0
- celldetective/models/signal_detection/NucCond/validation_regression.png +0 -0
- celldetective-1.4.0.dist-info/RECORD +0 -131
- {celldetective-1.4.0.dist-info → celldetective-1.4.1.dist-info}/WHEEL +0 -0
- {celldetective-1.4.0.dist-info → celldetective-1.4.1.dist-info}/entry_points.txt +0 -0
- {celldetective-1.4.0.dist-info → celldetective-1.4.1.dist-info}/licenses/LICENSE +0 -0
- {celldetective-1.4.0.dist-info → celldetective-1.4.1.dist-info}/top_level.txt +0 -0
celldetective/utils.py
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
1
|
import numpy as np
|
|
3
2
|
import pandas as pd
|
|
4
3
|
import matplotlib.pyplot as plt
|
|
5
|
-
import re
|
|
6
4
|
import os
|
|
7
5
|
from scipy.ndimage import shift, zoom
|
|
8
6
|
os.environ['TF_CPP_MIN_VLOG_LEVEL'] = '3'
|
|
@@ -31,11 +29,11 @@ from scipy.stats import ks_2samp
|
|
|
31
29
|
from cliffs_delta import cliffs_delta
|
|
32
30
|
from stardist.models import StarDist2D
|
|
33
31
|
from cellpose.models import CellposeModel
|
|
34
|
-
from pathlib import PosixPath, PurePosixPath, WindowsPath
|
|
32
|
+
from pathlib import PosixPath, PurePath, PurePosixPath, WindowsPath, Path
|
|
35
33
|
from prettytable import PrettyTable
|
|
34
|
+
from typing import List, Dict, Union, Optional
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
def is_integer_array(arr):
|
|
36
|
+
def is_integer_array(arr: np.ndarray) -> bool:
|
|
39
37
|
|
|
40
38
|
# Mask out NaNs
|
|
41
39
|
non_nan_values = arr[arr==arr].flatten()
|
|
@@ -46,7 +44,7 @@ def is_integer_array(arr):
|
|
|
46
44
|
else:
|
|
47
45
|
return False
|
|
48
46
|
|
|
49
|
-
def get_config(experiment):
|
|
47
|
+
def get_config(experiment: Union[str,Path]) -> str:
|
|
50
48
|
|
|
51
49
|
"""
|
|
52
50
|
Retrieves the path to the configuration file for a given experiment.
|
|
@@ -94,7 +92,7 @@ def get_config(experiment):
|
|
|
94
92
|
return config
|
|
95
93
|
|
|
96
94
|
|
|
97
|
-
def _remove_invalid_cols(df):
|
|
95
|
+
def _remove_invalid_cols(df: pd.DataFrame) -> pd.DataFrame:
|
|
98
96
|
|
|
99
97
|
"""
|
|
100
98
|
Removes invalid columns from a DataFrame.
|
|
@@ -120,7 +118,7 @@ def _remove_invalid_cols(df):
|
|
|
120
118
|
df = df.dropna(axis=1, how='all')
|
|
121
119
|
return df
|
|
122
120
|
|
|
123
|
-
def _extract_coordinates_from_features(df, timepoint):
|
|
121
|
+
def _extract_coordinates_from_features(df: pd.DataFrame, timepoint: int) -> pd.DataFrame:
|
|
124
122
|
|
|
125
123
|
"""
|
|
126
124
|
Re-format coordinates from a regionprops table to tracking/measurement table format.
|
|
@@ -161,7 +159,7 @@ def _extract_coordinates_from_features(df, timepoint):
|
|
|
161
159
|
|
|
162
160
|
return coords
|
|
163
161
|
|
|
164
|
-
def _mask_intensity_measurements(df, mask_channels):
|
|
162
|
+
def _mask_intensity_measurements(df: pd.DataFrame, mask_channels: Optional[List[str]]):
|
|
165
163
|
|
|
166
164
|
"""
|
|
167
165
|
Removes columns from a DataFrame that match specific channel name patterns.
|
|
@@ -210,7 +208,7 @@ def _mask_intensity_measurements(df, mask_channels):
|
|
|
210
208
|
df = df.drop(cols_to_drop, axis=1)
|
|
211
209
|
return df
|
|
212
210
|
|
|
213
|
-
def _rearrange_multichannel_frame(frame, n_channels=None):
|
|
211
|
+
def _rearrange_multichannel_frame(frame: np.ndarray, n_channels: Optional[int] = None) -> np.ndarray:
|
|
214
212
|
|
|
215
213
|
"""
|
|
216
214
|
Rearranges the axes of a multi-channel frame to ensure the channel axis is at the end.
|
|
@@ -271,7 +269,7 @@ def _rearrange_multichannel_frame(frame, n_channels=None):
|
|
|
271
269
|
|
|
272
270
|
return frame
|
|
273
271
|
|
|
274
|
-
def _fix_no_contrast(frames, value=1):
|
|
272
|
+
def _fix_no_contrast(frames: np.ndarray, value: Union[float,int] = 1):
|
|
275
273
|
|
|
276
274
|
"""
|
|
277
275
|
Ensures that frames with no contrast (i.e., containing only a single unique value) are adjusted.
|
|
@@ -310,7 +308,7 @@ def _fix_no_contrast(frames, value=1):
|
|
|
310
308
|
frames[0,0,k] += value
|
|
311
309
|
return frames
|
|
312
310
|
|
|
313
|
-
def zoom_multiframes(frames, zoom_factor):
|
|
311
|
+
def zoom_multiframes(frames: np.ndarray, zoom_factor: float) -> np.ndarray:
|
|
314
312
|
|
|
315
313
|
"""
|
|
316
314
|
Applies zooming to each frame (channel) in a multi-frame image.
|
|
@@ -1153,27 +1151,24 @@ def demangle_column_name(name):
|
|
|
1153
1151
|
|
|
1154
1152
|
def extract_cols_from_query(query: str):
|
|
1155
1153
|
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
variables = {}
|
|
1154
|
+
backtick_pattern = r'`([^`]+)`'
|
|
1155
|
+
backticked = set(re.findall(backtick_pattern, query))
|
|
1159
1156
|
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
# Try creating a Expr object with the query string and dictionary of globals.
|
|
1163
|
-
# This will raise an error as long as the dictionary of globals is incomplete.
|
|
1164
|
-
env = pd.core.computation.scope.ensure_scope(level=0, global_dict=variables)
|
|
1165
|
-
pd.core.computation.eval.Expr(query, env=env)
|
|
1157
|
+
# 2. Remove backtick sections so they don't get double-counted
|
|
1158
|
+
cleaned_query = re.sub(backtick_pattern, "", query)
|
|
1166
1159
|
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
# This relies on the format defined here: https://github.com/pandas-dev/pandas/blob/965ceca9fd796940050d6fc817707bba1c4f9bff/pandas/errors/__init__.py#L401
|
|
1171
|
-
name = re.findall("name '(.+?)' is not defined", str(e))[0]
|
|
1160
|
+
# 3. Extract bare identifiers from the remaining string
|
|
1161
|
+
identifier_pattern = r'\b([A-Za-z_]\w*)\b'
|
|
1162
|
+
bare = set(re.findall(identifier_pattern, cleaned_query))
|
|
1172
1163
|
|
|
1173
|
-
|
|
1174
|
-
|
|
1164
|
+
# 4. Remove Python keywords, operators, and pandas builtins
|
|
1165
|
+
blacklist = set(dir(pd)) | set(dir(__builtins__)) | {
|
|
1166
|
+
"and", "or", "not", "in", "True", "False"
|
|
1167
|
+
}
|
|
1168
|
+
bare = {c for c in bare if c not in blacklist}
|
|
1169
|
+
cols = backticked | bare
|
|
1175
1170
|
|
|
1176
|
-
return [demangle_column_name(
|
|
1171
|
+
return list([demangle_column_name(c) for c in cols])
|
|
1177
1172
|
|
|
1178
1173
|
def create_patch_mask(h, w, center=None, radius=None):
|
|
1179
1174
|
|
|
@@ -1280,7 +1275,7 @@ def rename_intensity_column(df, channels):
|
|
|
1280
1275
|
sections = np.array(re.split('-|_', intensity_cols[k]))
|
|
1281
1276
|
test_digit = np.array([False for s in sections])
|
|
1282
1277
|
for j,s in enumerate(sections):
|
|
1283
|
-
if s.isdigit():
|
|
1278
|
+
if str(s).isdigit():
|
|
1284
1279
|
if int(s)<len(channel_names):
|
|
1285
1280
|
test_digit[j] = True
|
|
1286
1281
|
|
|
@@ -1813,8 +1808,8 @@ def _extract_channel_indices(channels, required_channels):
|
|
|
1813
1808
|
|
|
1814
1809
|
return channel_indices
|
|
1815
1810
|
|
|
1816
|
-
def
|
|
1817
|
-
|
|
1811
|
+
def config_section_to_dict(path: Union[str,PurePath,Path], section: str) -> Union[Dict,None]:
|
|
1812
|
+
|
|
1818
1813
|
"""
|
|
1819
1814
|
Parse the config file to extract experiment parameters
|
|
1820
1815
|
following https://wiki.python.org/moin/ConfigParserExamples
|
|
@@ -1837,7 +1832,7 @@ def ConfigSectionMap(path,section):
|
|
|
1837
1832
|
--------
|
|
1838
1833
|
>>> config = "path/to/config_file.ini"
|
|
1839
1834
|
>>> section = "Channels"
|
|
1840
|
-
>>> channel_dictionary =
|
|
1835
|
+
>>> channel_dictionary = config_section_to_dict(config,section)
|
|
1841
1836
|
>>> print(channel_dictionary)
|
|
1842
1837
|
# {'brightfield_channel': '0',
|
|
1843
1838
|
# 'live_nuclei_channel': 'nan',
|
|
@@ -1861,7 +1856,7 @@ def ConfigSectionMap(path,section):
|
|
|
1861
1856
|
try:
|
|
1862
1857
|
dict1[option] = Config.get(section, option)
|
|
1863
1858
|
if dict1[option] == -1:
|
|
1864
|
-
|
|
1859
|
+
print("skip: %s" % option)
|
|
1865
1860
|
except:
|
|
1866
1861
|
print("exception on %s!" % option)
|
|
1867
1862
|
dict1[option] = None
|
|
@@ -1915,7 +1910,7 @@ def _extract_channel_indices_from_config(config, channels_to_extract):
|
|
|
1915
1910
|
channels = []
|
|
1916
1911
|
for c in channels_to_extract:
|
|
1917
1912
|
try:
|
|
1918
|
-
c1 = int(
|
|
1913
|
+
c1 = int(config_section_to_dict(config, "Channels")[c])
|
|
1919
1914
|
channels.append(c1)
|
|
1920
1915
|
except Exception as e:
|
|
1921
1916
|
print(f"Warning: The channel {c} required by the model is not available in your data...")
|
|
@@ -1941,10 +1936,10 @@ def _extract_nbr_channels_from_config(config, return_names=False):
|
|
|
1941
1936
|
nbr_channels = 0
|
|
1942
1937
|
channels = []
|
|
1943
1938
|
try:
|
|
1944
|
-
fields =
|
|
1939
|
+
fields = config_section_to_dict(config, "Channels")
|
|
1945
1940
|
for c in fields:
|
|
1946
1941
|
try:
|
|
1947
|
-
channel = int(
|
|
1942
|
+
channel = int(config_section_to_dict(config, "Channels")[c])
|
|
1948
1943
|
nbr_channels += 1
|
|
1949
1944
|
channels.append(c)
|
|
1950
1945
|
except:
|
|
@@ -1958,49 +1953,49 @@ def _extract_nbr_channels_from_config(config, return_names=False):
|
|
|
1958
1953
|
nbr_channels = 0
|
|
1959
1954
|
channels = []
|
|
1960
1955
|
try:
|
|
1961
|
-
brightfield_channel = int(
|
|
1956
|
+
brightfield_channel = int(config_section_to_dict(config, "MovieSettings")["brightfield_channel"])
|
|
1962
1957
|
nbr_channels += 1
|
|
1963
1958
|
channels.append('brightfield_channel')
|
|
1964
1959
|
except:
|
|
1965
1960
|
brightfield_channel = None
|
|
1966
1961
|
|
|
1967
1962
|
try:
|
|
1968
|
-
live_nuclei_channel = int(
|
|
1963
|
+
live_nuclei_channel = int(config_section_to_dict(config, "MovieSettings")["live_nuclei_channel"])
|
|
1969
1964
|
nbr_channels += 1
|
|
1970
1965
|
channels.append('live_nuclei_channel')
|
|
1971
1966
|
except:
|
|
1972
1967
|
live_nuclei_channel = None
|
|
1973
1968
|
|
|
1974
1969
|
try:
|
|
1975
|
-
dead_nuclei_channel = int(
|
|
1970
|
+
dead_nuclei_channel = int(config_section_to_dict(config, "MovieSettings")["dead_nuclei_channel"])
|
|
1976
1971
|
nbr_channels +=1
|
|
1977
1972
|
channels.append('dead_nuclei_channel')
|
|
1978
1973
|
except:
|
|
1979
1974
|
dead_nuclei_channel = None
|
|
1980
1975
|
|
|
1981
1976
|
try:
|
|
1982
|
-
effector_fluo_channel = int(
|
|
1977
|
+
effector_fluo_channel = int(config_section_to_dict(config, "MovieSettings")["effector_fluo_channel"])
|
|
1983
1978
|
nbr_channels +=1
|
|
1984
1979
|
channels.append('effector_fluo_channel')
|
|
1985
1980
|
except:
|
|
1986
1981
|
effector_fluo_channel = None
|
|
1987
1982
|
|
|
1988
1983
|
try:
|
|
1989
|
-
adhesion_channel = int(
|
|
1984
|
+
adhesion_channel = int(config_section_to_dict(config, "MovieSettings")["adhesion_channel"])
|
|
1990
1985
|
nbr_channels += 1
|
|
1991
1986
|
channels.append('adhesion_channel')
|
|
1992
1987
|
except:
|
|
1993
1988
|
adhesion_channel = None
|
|
1994
1989
|
|
|
1995
1990
|
try:
|
|
1996
|
-
fluo_channel_1 = int(
|
|
1991
|
+
fluo_channel_1 = int(config_section_to_dict(config, "MovieSettings")["fluo_channel_1"])
|
|
1997
1992
|
nbr_channels += 1
|
|
1998
1993
|
channels.append('fluo_channel_1')
|
|
1999
1994
|
except:
|
|
2000
1995
|
fluo_channel_1 = None
|
|
2001
1996
|
|
|
2002
1997
|
try:
|
|
2003
|
-
fluo_channel_2 = int(
|
|
1998
|
+
fluo_channel_2 = int(config_section_to_dict(config, "MovieSettings")["fluo_channel_2"])
|
|
2004
1999
|
nbr_channels += 1
|
|
2005
2000
|
channels.append('fluo_channel_2')
|
|
2006
2001
|
except:
|
|
@@ -2106,10 +2101,10 @@ def _extract_labels_from_config(config,number_of_wells):
|
|
|
2106
2101
|
|
|
2107
2102
|
|
|
2108
2103
|
try:
|
|
2109
|
-
concentrations =
|
|
2110
|
-
cell_types =
|
|
2111
|
-
antibodies =
|
|
2112
|
-
pharmaceutical_agents =
|
|
2104
|
+
concentrations = config_section_to_dict(config, "Labels")["concentrations"].split(",")
|
|
2105
|
+
cell_types = config_section_to_dict(config, "Labels")["cell_types"].split(",")
|
|
2106
|
+
antibodies = config_section_to_dict(config, "Labels")["antibodies"].split(",")
|
|
2107
|
+
pharmaceutical_agents = config_section_to_dict(config, "Labels")["pharmaceutical_agents"].split(",")
|
|
2113
2108
|
index = np.arange(len(concentrations)).astype(int) + 1
|
|
2114
2109
|
if not np.all(pharmaceutical_agents=="None"):
|
|
2115
2110
|
labels = [f"W{idx}: [CT] "+a+"; [Ab] "+b+" @ "+c+" pM "+d for idx,a,b,c,d in zip(index,cell_types,antibodies,concentrations,pharmaceutical_agents)]
|
|
@@ -2155,10 +2150,10 @@ def _extract_channels_from_config(config):
|
|
|
2155
2150
|
channel_names = []
|
|
2156
2151
|
channel_indices = []
|
|
2157
2152
|
try:
|
|
2158
|
-
fields =
|
|
2153
|
+
fields = config_section_to_dict(config, "Channels")
|
|
2159
2154
|
for c in fields:
|
|
2160
2155
|
try:
|
|
2161
|
-
idx = int(
|
|
2156
|
+
idx = int(config_section_to_dict(config, "Channels")[c])
|
|
2162
2157
|
channel_names.append(c)
|
|
2163
2158
|
channel_indices.append(idx)
|
|
2164
2159
|
except:
|
|
@@ -2207,7 +2202,7 @@ def extract_experiment_channels(experiment):
|
|
|
2207
2202
|
return _extract_channels_from_config(config)
|
|
2208
2203
|
|
|
2209
2204
|
|
|
2210
|
-
def get_software_location():
|
|
2205
|
+
def get_software_location() -> str:
|
|
2211
2206
|
|
|
2212
2207
|
"""
|
|
2213
2208
|
Get the installation folder of celldetective.
|
|
@@ -2260,7 +2255,7 @@ def remove_trajectory_measurements(trajectories, column_labels={'track': "TRACK_
|
|
|
2260
2255
|
tracks = trajectories.copy()
|
|
2261
2256
|
|
|
2262
2257
|
columns_to_keep = [column_labels['track'], column_labels['time'], column_labels['x'], column_labels['y'],column_labels['x']+'_um', column_labels['y']+'_um', 'class_id',
|
|
2263
|
-
't', 'state', 'generation', 'root', 'parent', 'ID', 't0', 'class', 'status', 'class_color', 'status_color', 'class_firstdetection', 't_firstdetection', 'velocity']
|
|
2258
|
+
't', 'state', 'generation', 'root', 'parent', 'ID', 't0', 'class', 'status', 'class_color', 'status_color', 'class_firstdetection', 't_firstdetection', 'status_firstdetection','velocity']
|
|
2264
2259
|
cols = list(tracks.columns)
|
|
2265
2260
|
for c in columns_to_keep:
|
|
2266
2261
|
if c not in cols:
|
|
@@ -2852,8 +2847,7 @@ def download_url_to_file(url, dst, progress=True):
|
|
|
2852
2847
|
shutil.move(f.name, dst)
|
|
2853
2848
|
finally:
|
|
2854
2849
|
f.close()
|
|
2855
|
-
|
|
2856
|
-
os.remove(f.name)
|
|
2850
|
+
remove_file_if_exists(f.name)
|
|
2857
2851
|
|
|
2858
2852
|
def get_zenodo_files(cat=None):
|
|
2859
2853
|
|
|
@@ -2985,7 +2979,7 @@ def collapse_trajectories_by_status(df, status=None, projection='mean', populati
|
|
|
2985
2979
|
|
|
2986
2980
|
return group_table
|
|
2987
2981
|
|
|
2988
|
-
def step_function(t, t_shift, dt):
|
|
2982
|
+
def step_function(t: Union[np.ndarray,List], t_shift: float, dt: float) -> np.ndarray:
|
|
2989
2983
|
|
|
2990
2984
|
"""
|
|
2991
2985
|
Computes a step function using the logistic sigmoid function.
|
|
@@ -3027,7 +3021,7 @@ def step_function(t, t_shift, dt):
|
|
|
3027
3021
|
return 1/(1+np.exp(-(t-t_shift)/dt))
|
|
3028
3022
|
|
|
3029
3023
|
|
|
3030
|
-
def test_2samp_generic(data, feature=None, groupby_cols=None, method="ks_2samp", *args, **kwargs):
|
|
3024
|
+
def test_2samp_generic(data: pd.DataFrame, feature: Optional[str] = None, groupby_cols: Optional[Union[str,List[str]]] = None, method="ks_2samp", *args, **kwargs) -> pd.DataFrame:
|
|
3031
3025
|
|
|
3032
3026
|
"""
|
|
3033
3027
|
Performs pairwise statistical tests between groups of data, comparing a specified feature using a chosen method.
|
|
@@ -3099,9 +3093,16 @@ def test_2samp_generic(data, feature=None, groupby_cols=None, method="ks_2samp",
|
|
|
3099
3093
|
|
|
3100
3094
|
return pivot
|
|
3101
3095
|
|
|
3102
|
-
def pretty_table(dct):
|
|
3096
|
+
def pretty_table(dct: dict):
|
|
3103
3097
|
table = PrettyTable()
|
|
3104
3098
|
for c in dct.keys():
|
|
3105
3099
|
table.add_column(str(c), [])
|
|
3106
3100
|
table.add_row([dct.get(c, "") for c in dct.keys()])
|
|
3107
|
-
print(table)
|
|
3101
|
+
print(table)
|
|
3102
|
+
|
|
3103
|
+
def remove_file_if_exists(file: Union[str,Path]):
|
|
3104
|
+
if os.path.exists(file):
|
|
3105
|
+
try:
|
|
3106
|
+
os.remove(file)
|
|
3107
|
+
except Exception as e:
|
|
3108
|
+
print(e)
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
celldetective/__init__.py,sha256=ZygAIkX6Nbjag1czWdQa-yP-GM1mBE_9ss21Xh__JFc,34
|
|
2
|
+
celldetective/__main__.py,sha256=bxTlSvbKhqn3LW_azd2baDCnDsgb37PAP9DfuAJ1_5M,1844
|
|
3
|
+
celldetective/_version.py,sha256=BqOI5y46o1G1RWC9bF1DPL-YM68lGYPmZt1pn6FZFZs,22
|
|
4
|
+
celldetective/events.py,sha256=n15R53c7QZ2wT8gjb0oeNikQbuRBrVVbyNsRCqXjzXA,8166
|
|
5
|
+
celldetective/exceptions.py,sha256=f3VmIYOthWTiqMEV5xQCox2rw5c5e7yog88h-CcV4oI,356
|
|
6
|
+
celldetective/extra_properties.py,sha256=QxXl-zug3NyxZMNTJUsDxo8PHLIRt0AwOFUkTyYBv7E,19987
|
|
7
|
+
celldetective/filters.py,sha256=RhgwDBZ1wcpu1syQikjdVgkH7ln_fVv14IGNRhaAMLM,4637
|
|
8
|
+
celldetective/io.py,sha256=7vCUprvmPa68Vp5BWHqYIJ46MHqamrF74Dc9MvqBXzg,124208
|
|
9
|
+
celldetective/measure.py,sha256=VZibDPYgMtMqIPItoPq1Hhkl6R5gAAHfOpAnUHMe88E,59541
|
|
10
|
+
celldetective/neighborhood.py,sha256=av7fzW3CjK7A5xO9AA1h36S50HzfM-aF9aaXb-uCrV4,60493
|
|
11
|
+
celldetective/preprocessing.py,sha256=YpffYSYZxnd8A0KLfVANEQGWb2I9JW663_aSvZbt3nI,45005
|
|
12
|
+
celldetective/relative_measurements.py,sha256=vQhgkHokUtt2xBpZbR-MHWUukfJ02WbiBsBJqV9A_90,30964
|
|
13
|
+
celldetective/segmentation.py,sha256=WApzoU1s3Ntvp0eIw_pRZXNwCA8LDKC9YoyR52tioz4,30943
|
|
14
|
+
celldetective/signals.py,sha256=-AnJOwU4S4T7y-xaH5vjrau2ZJgYDwFf3JjakdHJMog,112236
|
|
15
|
+
celldetective/tracking.py,sha256=4ngFo5-slTmmOdYCqIjH3gqzQ4e3Zovk_X5P3uFAifQ,40567
|
|
16
|
+
celldetective/utils.py,sha256=R2S1_lAoxhlSgEjuebr9Zs8NiQGwvehTdrzozQYoX7Q,105316
|
|
17
|
+
celldetective/datasets/segmentation_annotations/blank,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
+
celldetective/datasets/signal_annotations/blank,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
+
celldetective/gui/InitWindow.py,sha256=2TUHJbT6qfPvzN63Nx8ld2Dr2StgKY-jWDykeGvNzac,14767
|
|
20
|
+
celldetective/gui/__init__.py,sha256=AWNdszogNhpl0Fn7a6TYGNC11E2T-ZAemORqxyUk3B8,708
|
|
21
|
+
celldetective/gui/about.py,sha256=TaPAAiOrDcyaYQMEZQLQmhNfZH3QKoasIV1gbbPc8iU,1801
|
|
22
|
+
celldetective/gui/analyze_block.py,sha256=ukLlqqooP6UkJG00tZGnNWe3vqjVKj4zhtXcUnjOJj8,3048
|
|
23
|
+
celldetective/gui/base_annotator.py,sha256=hDeYhppFAuRb-h2GkbfQMpUv077rCPzQ3B3a2Y18jRM,25898
|
|
24
|
+
celldetective/gui/base_components.py,sha256=gYC0Gc3axDC241RpjNCXe7UKYG2uCDnMLx7at0kHKjA,768
|
|
25
|
+
celldetective/gui/classifier_widget.py,sha256=J6FBgwa_P5Sw_40Ruh6uQ6Z1-aBwDduOH07E5CxcWoU,20548
|
|
26
|
+
celldetective/gui/configure_new_exp.py,sha256=kYmWCqMK7F4yflS9b05gWvMEAoS1PoNV0siNNITNY1Y,24742
|
|
27
|
+
celldetective/gui/control_panel.py,sha256=GDJaEmE9sWP8dfepvVw8sS1D9oWWMdBAEWVaAb6YFVM,18104
|
|
28
|
+
celldetective/gui/event_annotator.py,sha256=SwX5s98UIzsh-nIvNLBXRfsiLqXHKOjzM37-9Yl76BQ,57110
|
|
29
|
+
celldetective/gui/generic_signal_plot.py,sha256=9IYFKychgjCDeBRJUqyiAZ0bflOBWxk0S1aTQK8R99w,36459
|
|
30
|
+
celldetective/gui/gui_utils.py,sha256=Uf9Qu0aPrbt1GEo0qw_RJCLtR79-R9zUekYYTXXKSs8,40253
|
|
31
|
+
celldetective/gui/json_readers.py,sha256=gDE9ly8x8oMR1id5U--JsOylGPMSmu9xw9wCfxH1stA,3719
|
|
32
|
+
celldetective/gui/layouts.py,sha256=h3xzfPRHM2Zos5v4m9yUl9ah4icrbpTJrdhUQVSF_Ug,60890
|
|
33
|
+
celldetective/gui/pair_event_annotator.py,sha256=fdCqoOtrRFnduPJ_H-xn3s6jNE0iyNt4ikitTGzpzXs,94503
|
|
34
|
+
celldetective/gui/plot_measurements.py,sha256=TQAFIOud8Tzrgm37EFKGd8Aj4rRYOjFk5BeiVstBheQ,51058
|
|
35
|
+
celldetective/gui/plot_signals_ui.py,sha256=op5vMKJ4nV_Hoys4SRlTJhCHb-HXnQYCAFhtIhxGOC4,21060
|
|
36
|
+
celldetective/gui/process_block.py,sha256=od5I_ZM1_GE_H5ApDB_l9_o4nWbWOhk5pZ1VGsNGLIw,75103
|
|
37
|
+
celldetective/gui/seg_model_loader.py,sha256=xTzJ02DJxBoyqeanmEybheVbn8uoxP1eay2odZbGH04,18108
|
|
38
|
+
celldetective/gui/styles.py,sha256=3yYr2-fMxGczsjPqlZ7VRfLRoWypWhsHimPALMvbKSU,5138
|
|
39
|
+
celldetective/gui/survival_ui.py,sha256=e5SqthRgylqwD9EZjJQ1pnJ0CAMwuW8VrMtgnUDdgOE,12296
|
|
40
|
+
celldetective/gui/tableUI.py,sha256=LWfq63N1sdTUjYaCKhZQbjJiqAOhliRnf8v4LytYBek,59249
|
|
41
|
+
celldetective/gui/thresholds_gui.py,sha256=d_vncQO837yPw9OMTJmrT0zl02G3___ynUHh1uU8k7A,29235
|
|
42
|
+
celldetective/gui/viewers.py,sha256=ZMbgVeVXGnYJHlYpiCzHoToB_HowpSnMc6za9f3C2n4,50019
|
|
43
|
+
celldetective/gui/workers.py,sha256=1sdRDwBsGJjjTNsf8YqnKuf2m6Fa5E7YFLnncFWqbjU,4298
|
|
44
|
+
celldetective/gui/help/DL-segmentation-strategy.json,sha256=PZD9xXjrwbX3TiudHJPuvcyZD28o4k-fVgeTd7dBKzI,1583
|
|
45
|
+
celldetective/gui/help/Threshold-vs-DL.json,sha256=rrFnZT2DhyS7g1nIDWeUV8-HH7M2Sv8D7sDCGBU1M_0,934
|
|
46
|
+
celldetective/gui/help/cell-populations.json,sha256=e5yJp75rKsYkGVuO8stXxU1TznkADw71djdMUs21gd8,1200
|
|
47
|
+
celldetective/gui/help/exp-structure.json,sha256=61zZAHms7se4Vtuma904xKMsNlWuTOIeF24cbwQiYQg,1973
|
|
48
|
+
celldetective/gui/help/feature-btrack.json,sha256=wvKFiM38AvfQ2QsePDjTflOovqq04CWYcK2QXZhHs-A,693
|
|
49
|
+
celldetective/gui/help/neighborhood.json,sha256=h-aFuQUFM1mnjZPLE0eR6oaRGcRFLeK8ilTXICqkzzg,1259
|
|
50
|
+
celldetective/gui/help/prefilter-for-segmentation.json,sha256=NEL6O2nj_l8ImjMzzX6qqg7U9QV01sgZMFvkGHUiG4E,791
|
|
51
|
+
celldetective/gui/help/preprocessing.json,sha256=M-AxW6zYB5oDiQdoc9wcky8C5p0m6uv-CJMLpUVboew,4716
|
|
52
|
+
celldetective/gui/help/propagate-classification.json,sha256=F7Ir1mtgRVTXWLN7n3ny3vrU01LFNeDh5dN2QBIXHqE,1227
|
|
53
|
+
celldetective/gui/help/track-postprocessing.json,sha256=VaGd8EEkA33OL-EI3NXWZ8yHeWWyUeImDF5yAjsVYGA,3990
|
|
54
|
+
celldetective/gui/help/tracking.json,sha256=yIAoOToqCSQ_XF4gwEZCcyXcvQ3mROju263ZPDvlUyY,776
|
|
55
|
+
celldetective/gui/processes/compute_neighborhood.py,sha256=J0T1DaG58p1nB0_WseVbl3AL5jb76W0hzFaSNci5EDU,29181
|
|
56
|
+
celldetective/gui/processes/downloader.py,sha256=jnNitmQ9xUCGJHSvr3Myts5soe6rdYDBx_AGJKr1AWk,3406
|
|
57
|
+
celldetective/gui/processes/measure_cells.py,sha256=XAw6SnT14EXfJXZ01bQ2FmPLGYWJHnX9Nko25RH0ZIo,13388
|
|
58
|
+
celldetective/gui/processes/segment_cells.py,sha256=nhoeOQ8YbIWpFZl-I6Ig8oFQpupvufwUAXXhDXTfLNE,12668
|
|
59
|
+
celldetective/gui/processes/track_cells.py,sha256=4t6UZE_dyiryDH9e-G6jdINzdXHXi8BTta2v1gI0w3Q,10165
|
|
60
|
+
celldetective/gui/processes/train_segmentation_model.py,sha256=bvcPG19hBjhNY9hd6Ch5_wk2FOJYQg97Azoz4RKeP-0,10776
|
|
61
|
+
celldetective/gui/processes/train_signal_model.py,sha256=qqqkq9gdvNyvycYkmzWgRXWvsbEozyzNWP_POGvnlIs,3816
|
|
62
|
+
celldetective/gui/settings/__init__.py,sha256=sW3VeD5sWpHz7cN5-jLI7N10TaamEJuHI95gC9lkMDk,448
|
|
63
|
+
celldetective/gui/settings/_settings_base.py,sha256=Y7kjMyAZyjVoPFxvlBjOR1fpKWRqej1rsPMyHtN8Sb8,2281
|
|
64
|
+
celldetective/gui/settings/_settings_event_model_training.py,sha256=TSmd6_Oxw5qKtbawV2U-eG2IYu3HW2NRgXEfe-7cpRE,20219
|
|
65
|
+
celldetective/gui/settings/_settings_measurements.py,sha256=fV9nYi1IMQmHLDgZznjtg0OQGCZAKp0Pd6eNYIT0gdw,38482
|
|
66
|
+
celldetective/gui/settings/_settings_neighborhood.py,sha256=8ef6bmJblHFK68HUITxaKuyeMmdT59rx8fDvZQ3wqBo,19647
|
|
67
|
+
celldetective/gui/settings/_settings_segmentation.py,sha256=6DihD1mk-dN4Sstdth1iJ-0HR34rTVlTHP-pXUh_rY0,1901
|
|
68
|
+
celldetective/gui/settings/_settings_segmentation_model_training.py,sha256=dPcRjIkJTob-F7_FOIjDKVChPkot3ACJ2MLEKTfuTn8,21837
|
|
69
|
+
celldetective/gui/settings/_settings_signal_annotator.py,sha256=s-csxb2JAJoUO9QTHSkt-XyNf3yk0ubW4yQm5eSdv8U,10223
|
|
70
|
+
celldetective/gui/settings/_settings_tracking.py,sha256=pOdShRqHuq84woVuCf_6D4K9Xv4vcHdOUORuipZiU_g,42898
|
|
71
|
+
celldetective/gui/table_ops/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
72
|
+
celldetective/gui/table_ops/merge_groups.py,sha256=rWwmPBuUeLeAkJcI9ISW5lhmM1L6oQo5lAVc0-D05B4,4059
|
|
73
|
+
celldetective/icons/logo-large.png,sha256=FXSwV3u6zEKcfpuSn4unnqB0oUnN9cHqQ9BCKWytrpg,36631
|
|
74
|
+
celldetective/icons/logo.png,sha256=wV2OS8_dU5Td5cgdPbCOU3JpMpTwNuYLnfVcnQX0tJA,2437
|
|
75
|
+
celldetective/icons/signals_icon.png,sha256=vEiKoqWTtN0-uJgVqtAlwCuP-f4QeWYOlO3sdp2tg2w,3969
|
|
76
|
+
celldetective/icons/splash-test.png,sha256=W9smcuuwJUF9DU-rz4aACx7_rCmGRsxYUGPBDlDnrJk,17523
|
|
77
|
+
celldetective/icons/splash.png,sha256=J_1jPJylxwHGzGF1xCGocc-BmylHtHTII9VJSLKnezY,17895
|
|
78
|
+
celldetective/icons/splash0.png,sha256=qVXsrYUinm5g6-vbHcqwyjh8SIqs9lEqPWnPa1WijaQ,14233
|
|
79
|
+
celldetective/icons/survival2.png,sha256=8zsualD7d9VPAecoFA4Om9TFARErqpJzMg6U7XANXf4,4479
|
|
80
|
+
celldetective/icons/vignette_signals2.png,sha256=hsVOdQDpEfMGM45aaSeacEm3lvxbquRKKYutiS9qoS0,20743
|
|
81
|
+
celldetective/icons/vignette_signals2.svg,sha256=muGNcQudV1jG-bmFd9FwV-Wb8PcrRV5osdZ7pHR7Ekk,5947
|
|
82
|
+
celldetective/links/zenodo.json,sha256=3OSml-j5FbCY5B24t7LZ7raXyVA1834osurmaEckIP8,34511
|
|
83
|
+
celldetective/models/pair_signal_detection/blank,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
84
|
+
celldetective/models/segmentation_effectors/blank,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
85
|
+
celldetective/models/segmentation_generic/blank,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
86
|
+
celldetective/models/segmentation_targets/blank,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
87
|
+
celldetective/models/signal_detection/blank,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
88
|
+
celldetective/models/tracking_configs/biased_motion.json,sha256=RZa-ZCP4jbFtMVz-M4lf1LtqmAvBrUxIhhudNiU1jtY,1782
|
|
89
|
+
celldetective/models/tracking_configs/mcf7.json,sha256=iDjb8i6yxs0GleW39dvY3Ld5bZJatlXJrwI8PG3vCT0,1780
|
|
90
|
+
celldetective/models/tracking_configs/no_z_motion.json,sha256=b4RWOJ0w6Y2e0vJYwKMyOexedeL2eA8fEDbSzbNmB4A,2702
|
|
91
|
+
celldetective/models/tracking_configs/ricm.json,sha256=L-vmwCR1f89U-qnH2Ms0cBfPFR_dxIWoe2ccH8V-QBA,2727
|
|
92
|
+
celldetective/models/tracking_configs/ricm2.json,sha256=DDjJ6ScYcDWvlsy7ujPID8v8H28vcNcMuZmNR8XmGxo,2718
|
|
93
|
+
celldetective/regionprops/__init__.py,sha256=ohe9vC7j4lnpKnGXidVo1PVfoQfC8TqCuHTNo8rXmdg,44
|
|
94
|
+
celldetective/regionprops/_regionprops.py,sha256=sNa8Wdvq8lL1VLxmTIH-AJdJqJY3ia7g1EdT8IXINwM,10288
|
|
95
|
+
celldetective/regionprops/props.json,sha256=sCwACmbh0n-JAw9eve9yV85REukoMBJLsRjxCwTRMm8,2424
|
|
96
|
+
celldetective/scripts/analyze_signals.py,sha256=WfBqWFKzPpJNkkgLSWwpmpqFO67ZSewdxe2NCIXxEyQ,2190
|
|
97
|
+
celldetective/scripts/measure_cells.py,sha256=db6K0wO_uPbBDNlqK-9OOe1YMGTQe0eolWcoDyMKyh0,11803
|
|
98
|
+
celldetective/scripts/measure_relative.py,sha256=Tv0tagL07l4P6_0YNLN5-1hVw2Qq--FgAM2XfSLvR-Q,4091
|
|
99
|
+
celldetective/scripts/segment_cells.py,sha256=odadT16C4z3NIrTyiAz3DA5547VLJqhJax0xWmV05T8,6949
|
|
100
|
+
celldetective/scripts/segment_cells_thresholds.py,sha256=JanfXVbekgxDosKJDU9SejMcXiLkxnRwFTsA6gyeY8U,5141
|
|
101
|
+
celldetective/scripts/track_cells.py,sha256=GfCqXHsuS8k5jizY4tGye2l6Vwkoenb4_VjBq_dMDyI,8892
|
|
102
|
+
celldetective/scripts/train_segmentation_model.py,sha256=8QXyhQtxBhdYBNleqCbkP3II1AztfrtpyeVyx0Ijy6s,9710
|
|
103
|
+
celldetective/scripts/train_signal_model.py,sha256=D643wKVYg-LWHF2VU9FWKSuazXrpCpQK0YjGqoIimD0,3167
|
|
104
|
+
celldetective-1.4.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
105
|
+
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
106
|
+
tests/test_events.py,sha256=eLFwwEEJfQAdwhews3-fn1HSvzozcNNFN_Qn0gOvQkE,685
|
|
107
|
+
tests/test_filters.py,sha256=iJksl_HgquqGzPPv46qpNtlD4rkBpZ5eVtIotgZ7LDs,656
|
|
108
|
+
tests/test_io.py,sha256=gk5FmoI7ANEczUtNXYRxc48KzkfYzemwS_eYaLq4_NI,2093
|
|
109
|
+
tests/test_measure.py,sha256=FEUAs1rVHylvIvubCb0bJDNGZLVmkgXNgI3NaGQ1dA8,4542
|
|
110
|
+
tests/test_neighborhood.py,sha256=gk5FmoI7ANEczUtNXYRxc48KzkfYzemwS_eYaLq4_NI,2093
|
|
111
|
+
tests/test_preprocessing.py,sha256=c0rKS9d5h37uDcV7fVOTnn5GMVbEB84b8ZTCTdRmvFs,1422
|
|
112
|
+
tests/test_segmentation.py,sha256=k1b_zIZdlytEdJcHjAUQEO3gTBAHtv5WvrwQN2xD4kc,3470
|
|
113
|
+
tests/test_signals.py,sha256=No4cah6KxplhDcKXnU8RrA7eDla4hWw6ccf7xGnBokU,3599
|
|
114
|
+
tests/test_tracking.py,sha256=8hebWSqEIuttD1ABn-6dKCT7EXKRR7-4RwyFWi1WPFo,8800
|
|
115
|
+
tests/test_utils.py,sha256=NKRCAC1d89aBK5cWjTb7-pInYow901RrT-uBlIdz4KI,3692
|
|
116
|
+
tests/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
117
|
+
tests/gui/test_new_project.py,sha256=D3166GefxQeOBw3Uc2nC_wzklF6b_86xrPiLC46jbUk,8228
|
|
118
|
+
tests/gui/test_project.py,sha256=scDr50WAZybTkeTPPphGvor1VL9nHQXUIjvScdxmAmI,4146
|
|
119
|
+
celldetective-1.4.1.dist-info/METADATA,sha256=uy2o-Y7v7jvhCq5wYIAHNYj5N-FNkeCbf1Ui_duW1js,10945
|
|
120
|
+
celldetective-1.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
121
|
+
celldetective-1.4.1.dist-info/entry_points.txt,sha256=2NU6_EOByvPxqBbCvjwxlVlvnQreqZ3BKRCVIKEv3dg,62
|
|
122
|
+
celldetective-1.4.1.dist-info/top_level.txt,sha256=6rsIKKfGMKgud7HPuATcpq6EhdXwcg_yknBVWn9x4C4,20
|
|
123
|
+
celldetective-1.4.1.dist-info/RECORD,,
|
tests/gui/__init__.py
ADDED
|
File without changes
|