small-fish-gui 1.10.2__tar.gz → 1.10.4__tar.gz
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.
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/PKG-INFO +2 -1
- small_fish_gui-1.10.4/error_log.txt +9 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/pyproject.toml +2 -2
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/__init__.py +1 -1
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/batch/integrity.py +3 -2
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/batch/pipeline.py +29 -1
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/gui/_napari_widgets.py +3 -2
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/interface/inoutput.py +22 -5
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/pipeline/detection.py +3 -3
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/requirements.txt +2 -1
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/LICENSE +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/README.md +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/.github/workflows/python-publish.yml +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/LICENSE +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/README.md +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/__main__.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/batch/__init__.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/batch/input.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/batch/prompt.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/batch/test.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/batch/update.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/batch/utils.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/batch/values.txt +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/gui/__init__.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/gui/animation.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/gui/layout.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/gui/napari_visualiser.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/gui/prompts.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/gui/screenshot/general_help_screenshot.png +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/gui/screenshot/mapping_help_screenshot.png +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/gui/screenshot/segmentation_help_screenshot.png +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/gui/testing.ipynb +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/gui/theme.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/hints.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/interface/__init__.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/interface/image.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/interface/testing.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/pipeline/__init__.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/pipeline/_colocalisation.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/pipeline/_custom_errors.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/pipeline/_preprocess.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/pipeline/_signaltonoise.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/pipeline/actions.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/pipeline/main.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/pipeline/segmentation.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/pipeline/spots.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/pipeline/test.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/pipeline/testing.ipynb +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/pipeline/utils.py +0 -0
- {small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: small_fish_gui
|
|
3
|
-
Version: 1.10.
|
|
3
|
+
Version: 1.10.4
|
|
4
4
|
Summary: Small Fish is a python application for the analysis of smFish images. It provides a ready to use graphical interface to combine famous python packages for cell analysis without any need for coding.
|
|
5
5
|
Project-URL: Homepage, https://github.com/2Echoes/small_fish
|
|
6
6
|
Project-URL: Wiki, https://github.com/2Echoes/small_fish_gui/wiki
|
|
@@ -12,6 +12,7 @@ Classifier: Operating System :: OS Independent
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3
|
|
13
13
|
Requires-Python: >=3.9
|
|
14
14
|
Requires-Dist: aicsimageio>=4.14.0
|
|
15
|
+
Requires-Dist: aicspylibczi==3.3.1
|
|
15
16
|
Requires-Dist: big-fish==0.6.2
|
|
16
17
|
Requires-Dist: cellpose==3.0.7
|
|
17
18
|
Requires-Dist: czifile==2019.7.2
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
version 1.10.3error : 'voxel_size_z'traceback :
|
|
2
|
+
Traceback (most recent call last):
|
|
3
|
+
File "/home/floric/miniconda3/envs/dev/lib/python3.9/site-packages/small_fish_gui/pipeline/main.py", line 40, in <module>
|
|
4
|
+
new_result_df, new_cell_result_df, acquisition_id, user_parameters = add_detection(
|
|
5
|
+
File "/home/floric/miniconda3/envs/dev/lib/python3.9/site-packages/small_fish_gui/pipeline/actions.py", line 75, in add_detection
|
|
6
|
+
detection_parameters = initiate_detection(
|
|
7
|
+
File "/home/floric/miniconda3/envs/dev/lib/python3.9/site-packages/small_fish_gui/pipeline/detection.py", line 227, in initiate_detection
|
|
8
|
+
detection_parameters['spot_size_z'] = round(detection_parameters['voxel_size_z']*1.5) if isinstance(detection_parameters['voxel_size_z'], (float,int)) else None
|
|
9
|
+
KeyError: 'voxel_size_z'
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "small_fish_gui"
|
|
7
|
-
version = "1.10.
|
|
7
|
+
version = "1.10.4"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="Slimani Floric", email="floric.slimani@live.com" },
|
|
10
10
|
]
|
|
@@ -35,7 +35,7 @@ dependencies = [
|
|
|
35
35
|
"openpyxl==3.1.2",
|
|
36
36
|
"pyarrow==11.0.0",
|
|
37
37
|
"aicsimageio>=4.14.0",
|
|
38
|
-
|
|
38
|
+
"aicspylibczi==3.3.1",
|
|
39
39
|
]
|
|
40
40
|
|
|
41
41
|
[project.urls]
|
|
@@ -37,7 +37,7 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
37
37
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
38
38
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
39
39
|
"""
|
|
40
|
-
__version__ = "1.10.
|
|
40
|
+
__version__ = "1.10.4"
|
|
41
41
|
__wiki__ = "https://github.com/2Echoes/small_fish_gui/wiki"
|
|
42
42
|
|
|
43
43
|
import os
|
|
@@ -8,6 +8,7 @@ import bigfish.stack as stack
|
|
|
8
8
|
import numpy as np
|
|
9
9
|
import FreeSimpleGUI as sg
|
|
10
10
|
|
|
11
|
+
from ..hints import pipeline_parameters
|
|
11
12
|
from ..pipeline._preprocess import check_integrity, convert_parameters_types, ParameterInputError, _check_segmentation_parameters
|
|
12
13
|
from ..pipeline.segmentation import _cast_segmentation_parameters
|
|
13
14
|
|
|
@@ -100,7 +101,7 @@ def check_segmentation_parameters(
|
|
|
100
101
|
return segmentation_is_ok, values
|
|
101
102
|
|
|
102
103
|
def check_detection_parameters(
|
|
103
|
-
values,
|
|
104
|
+
values : pipeline_parameters,
|
|
104
105
|
do_dense_region_deconvolution,
|
|
105
106
|
do_clustering,
|
|
106
107
|
is_multichannel,
|
|
@@ -117,7 +118,7 @@ def check_detection_parameters(
|
|
|
117
118
|
do_dense_region_deconvolution=do_dense_region_deconvolution,
|
|
118
119
|
do_clustering=do_clustering,
|
|
119
120
|
multichannel=is_multichannel,
|
|
120
|
-
segmentation_done=
|
|
121
|
+
segmentation_done= values['do_segmentation'],
|
|
121
122
|
map_=map_,
|
|
122
123
|
shape=shape
|
|
123
124
|
)
|
|
@@ -49,6 +49,9 @@ def batch_pipeline(
|
|
|
49
49
|
if parameters['save segmentation'] : os.makedirs(main_dir + "segmentation/", exist_ok=True)
|
|
50
50
|
if parameters['save detection'] : os.makedirs(main_dir + "detection/", exist_ok=True)
|
|
51
51
|
if parameters['extract spots'] : os.makedirs(main_dir + "results/spots_extraction", exist_ok=True)
|
|
52
|
+
first_save = True # init for excel append
|
|
53
|
+
append_to_line = 1 #Start at line one
|
|
54
|
+
cell_append_to_line = 1 #Start at line one
|
|
52
55
|
|
|
53
56
|
#Setting spot detection dimension
|
|
54
57
|
parameters['dim'] = 3 if is_3D else 2
|
|
@@ -62,6 +65,12 @@ def batch_pipeline(
|
|
|
62
65
|
error_log = open(main_dir + "error_log", mode='w')
|
|
63
66
|
error_count = 0
|
|
64
67
|
|
|
68
|
+
#These columns usually kept for coloc analysis will be dropped for memory gain in batch mode
|
|
69
|
+
COLUMNS_TO_DROP = ['image', 'spots', 'clusters', 'rna_coords', 'cluster_coords',"rna_coords", "cluster_coords", "free_spots_coords", "clustered_spots_coords"]
|
|
70
|
+
for col in COLUMNS_TO_DROP :
|
|
71
|
+
if col in cell_results_df : cell_results_df.drop(columns=col)
|
|
72
|
+
if col in results_df : results_df.drop(columns=col)
|
|
73
|
+
|
|
65
74
|
for acquisition_id, file in enumerate(filenames_list) :
|
|
66
75
|
try :
|
|
67
76
|
|
|
@@ -192,6 +201,10 @@ def batch_pipeline(
|
|
|
192
201
|
frame_results=frame_result,
|
|
193
202
|
)
|
|
194
203
|
|
|
204
|
+
for col in COLUMNS_TO_DROP :
|
|
205
|
+
if col in new_cell_results_df : new_cell_results_df.drop(columns=col)
|
|
206
|
+
if col in new_results_df : new_results_df.drop(columns=col)
|
|
207
|
+
|
|
195
208
|
results_df = pd.concat([
|
|
196
209
|
results_df.reset_index(drop=True), new_results_df.reset_index(drop=True)
|
|
197
210
|
], axis=0)
|
|
@@ -202,6 +215,10 @@ def batch_pipeline(
|
|
|
202
215
|
|
|
203
216
|
|
|
204
217
|
#6. Saving results
|
|
218
|
+
if parameters['xlsx'] :
|
|
219
|
+
if first_save : xlsx_header = True
|
|
220
|
+
else : xlsx_header = False
|
|
221
|
+
|
|
205
222
|
window_print(batch_window,"saving image_results...")
|
|
206
223
|
#1 file per batch + 1 file per batch if segmentation
|
|
207
224
|
acquisition_success = write_results(
|
|
@@ -212,7 +229,12 @@ def batch_pipeline(
|
|
|
212
229
|
do_feather= parameters["feather"],
|
|
213
230
|
do_csv= parameters["csv"],
|
|
214
231
|
overwrite=True,
|
|
232
|
+
batch_mode=True,
|
|
233
|
+
header=first_save,
|
|
234
|
+
xlsx_start_line=append_to_line
|
|
215
235
|
)
|
|
236
|
+
append_to_line += len(results_df)
|
|
237
|
+
results_df = results_df.drop(results_df.index)
|
|
216
238
|
|
|
217
239
|
if do_segmentation :
|
|
218
240
|
cell_success = write_results(
|
|
@@ -223,10 +245,16 @@ def batch_pipeline(
|
|
|
223
245
|
do_feather= parameters["feather"],
|
|
224
246
|
do_csv= parameters["csv"],
|
|
225
247
|
overwrite=True,
|
|
248
|
+
batch_mode=True,
|
|
249
|
+
header=first_save,
|
|
250
|
+
xlsx_start_line=cell_append_to_line
|
|
226
251
|
)
|
|
227
|
-
|
|
252
|
+
cell_append_to_line += len(cell_results_df)
|
|
253
|
+
cell_results_df = cell_results_df.drop(cell_results_df.index)
|
|
254
|
+
first_save = False
|
|
228
255
|
window_print(batch_window,"Sucessfully saved.")
|
|
229
256
|
|
|
257
|
+
|
|
230
258
|
except Exception as error :
|
|
231
259
|
|
|
232
260
|
error_count +=1
|
|
@@ -56,7 +56,7 @@ class ClusterWizard(ABC) :
|
|
|
56
56
|
CLUSTER_WIZARDS = []
|
|
57
57
|
def register_cluster_wizard(cls):
|
|
58
58
|
"""
|
|
59
|
-
Helper to register all clusters related class
|
|
59
|
+
Helper to register all clusters related wizard class. Object to be instanciated upon launching napari but that have no widget.
|
|
60
60
|
"""
|
|
61
61
|
CLUSTER_WIZARDS.append(cls)
|
|
62
62
|
return cls
|
|
@@ -198,6 +198,8 @@ class ClusterIDSetter(ClusterWidget) :
|
|
|
198
198
|
new_spot_number = len(self.single_layer.features.loc[self.single_layer.features['cluster_id'] == cluster_id])
|
|
199
199
|
self.cluster_layer.features.loc[self.cluster_layer.features['cluster_id'] == cluster_id, ["spot_number"]] = new_spot_number
|
|
200
200
|
self.cluster_layer.events.features()
|
|
201
|
+
else :
|
|
202
|
+
print(f"Not cluster with id {cluster_id} was found.")
|
|
201
203
|
|
|
202
204
|
self.cluster_layer.selected_data.clear()
|
|
203
205
|
|
|
@@ -490,7 +492,6 @@ class ClusterCleaner(ClusterWizard) :
|
|
|
490
492
|
|
|
491
493
|
def delete_empty_cluster() :
|
|
492
494
|
drop_idx = self.cluster_layer.features[self.cluster_layer.features['spot_number'] == 0].index
|
|
493
|
-
print("drop_idx : ",drop_idx)
|
|
494
495
|
|
|
495
496
|
if len(drop_idx) > 0 :
|
|
496
497
|
print("Removing {} empty cluster(s)".format(len(drop_idx)))
|
|
@@ -71,7 +71,20 @@ def write_list_of_results(
|
|
|
71
71
|
return True
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
def write_results(
|
|
74
|
+
def write_results(
|
|
75
|
+
dataframe: pd.DataFrame,
|
|
76
|
+
path:str,
|
|
77
|
+
filename:str,
|
|
78
|
+
do_excel= True,
|
|
79
|
+
do_feather= False,
|
|
80
|
+
do_csv=False,
|
|
81
|
+
overwrite=False,
|
|
82
|
+
reset_index=True,
|
|
83
|
+
batch_mode = False,
|
|
84
|
+
header = True,
|
|
85
|
+
xlsx_start_line = 1,
|
|
86
|
+
) :
|
|
87
|
+
|
|
75
88
|
check_parameter(dataframe= pd.DataFrame, path= str, filename = str, do_excel = bool, do_feather = bool)
|
|
76
89
|
|
|
77
90
|
if len(dataframe) == 0 : return True
|
|
@@ -103,16 +116,20 @@ def write_results(dataframe: pd.DataFrame, path:str, filename:str, do_excel= Tru
|
|
|
103
116
|
|
|
104
117
|
if reset_index : dataframe = dataframe.reset_index(drop=True)
|
|
105
118
|
|
|
106
|
-
if do_csv :
|
|
119
|
+
if do_csv :
|
|
120
|
+
if batch_mode : mode = 'a'
|
|
121
|
+
else : mode = 'w'
|
|
122
|
+
dataframe.to_csv(path + new_filename + '.csv', sep=";", header=header, mode=mode)
|
|
107
123
|
if do_excel :
|
|
108
124
|
if len(dataframe) < MAX_LEN_EXCEL :
|
|
109
|
-
dataframe.to_excel(path + new_filename + '.xlsx')
|
|
125
|
+
dataframe.to_excel(path + new_filename + '.xlsx', header=header, startrow=xlsx_start_line)
|
|
110
126
|
else :
|
|
111
127
|
print("Error : Table too big to be saved in excel format.")
|
|
112
128
|
return False
|
|
113
129
|
|
|
114
|
-
if do_feather :
|
|
115
|
-
|
|
130
|
+
if do_feather :
|
|
131
|
+
print("feather saving is depreciated, please use csv instead")
|
|
132
|
+
pass
|
|
116
133
|
|
|
117
134
|
return True
|
|
118
135
|
|
|
@@ -218,9 +218,9 @@ def initiate_detection(user_parameters : pipeline_parameters, map_, shape) :
|
|
|
218
218
|
pass
|
|
219
219
|
else :
|
|
220
220
|
detection_parameters['voxel_size'] = [round(v) if isinstance(v, (float,int)) else None for v in voxel_size]
|
|
221
|
-
detection_parameters['voxel_size_z'] = detection_parameters['voxel_size'][0]
|
|
222
|
-
detection_parameters['voxel_size_y'] = detection_parameters['voxel_size'][1]
|
|
223
|
-
detection_parameters['voxel_size_x'] = detection_parameters['voxel_size'][2]
|
|
221
|
+
detection_parameters['voxel_size_z'] = detection_parameters['voxel_size'][0] if isinstance(detection_parameters['voxel_size'][0], (float,int)) else None
|
|
222
|
+
detection_parameters['voxel_size_y'] = detection_parameters['voxel_size'][1] if isinstance(detection_parameters['voxel_size'][1], (float,int)) else None
|
|
223
|
+
detection_parameters['voxel_size_x'] = detection_parameters['voxel_size'][2] if isinstance(detection_parameters['voxel_size'][2], (float,int)) else None
|
|
224
224
|
|
|
225
225
|
#Setting default spot size to 1.5 voxel
|
|
226
226
|
if detection_parameters.get('spot_size') is None :
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/pipeline/_colocalisation.py
RENAMED
|
File without changes
|
{small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/pipeline/_custom_errors.py
RENAMED
|
File without changes
|
|
File without changes
|
{small_fish_gui-1.10.2 → small_fish_gui-1.10.4}/src/small_fish_gui/pipeline/_signaltonoise.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|