small-fish-gui 1.9.1__tar.gz → 1.9.2__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.
Files changed (52) hide show
  1. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/PKG-INFO +1 -1
  2. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/pyproject.toml +1 -1
  3. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/__init__.py +1 -1
  4. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/gui/napari_visualiser.py +3 -5
  5. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/pipeline/detection.py +14 -7
  6. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/LICENSE +0 -0
  7. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/README.md +0 -0
  8. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/.github/workflows/python-publish.yml +0 -0
  9. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/.readthedocs.yaml +0 -0
  10. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/LICENSE +0 -0
  11. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/README.md +0 -0
  12. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/Segmentation example.jpg +0 -0
  13. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/__main__.py +0 -0
  14. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/batch/__init__.py +0 -0
  15. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/batch/input.py +0 -0
  16. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/batch/integrity.py +0 -0
  17. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/batch/pipeline.py +0 -0
  18. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/batch/prompt.py +0 -0
  19. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/batch/test.py +0 -0
  20. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/batch/update.py +0 -0
  21. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/batch/utils.py +0 -0
  22. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/batch/values.txt +0 -0
  23. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/gui/__init__.py +0 -0
  24. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/gui/_napari_widgets.py +0 -0
  25. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/gui/animation.py +0 -0
  26. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/gui/help_module.py +0 -0
  27. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/gui/layout.py +0 -0
  28. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/gui/prompts.py +0 -0
  29. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/gui/screenshot/general_help_screenshot.png +0 -0
  30. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/gui/screenshot/mapping_help_screenshot.png +0 -0
  31. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/gui/screenshot/segmentation_help_screenshot.png +0 -0
  32. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/gui/testing.ipynb +0 -0
  33. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/hints.py +0 -0
  34. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/interface/__init__.py +0 -0
  35. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/interface/image.py +0 -0
  36. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/interface/inoutput.py +0 -0
  37. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/interface/testing.py +0 -0
  38. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/napari_detection_example.png +0 -0
  39. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/pipeline/__init__.py +0 -0
  40. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/pipeline/_colocalisation.py +0 -0
  41. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/pipeline/_custom_errors.py +0 -0
  42. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/pipeline/_preprocess.py +0 -0
  43. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/pipeline/_signaltonoise.py +0 -0
  44. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/pipeline/actions.py +0 -0
  45. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/pipeline/main.py +0 -0
  46. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/pipeline/segmentation.py +0 -0
  47. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/pipeline/spots.py +0 -0
  48. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/pipeline/test.py +0 -0
  49. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/pipeline/testing.ipynb +0 -0
  50. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/pipeline/utils.py +0 -0
  51. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/src/small_fish_gui/requirements.txt +0 -0
  52. {small_fish_gui-1.9.1 → small_fish_gui-1.9.2}/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.9.1
3
+ Version: 1.9.2
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: Issues, https://github.com/2Echoes/small_fish/issues
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "small_fish_gui"
7
- version = "1.9.1"
7
+ version = "1.9.2"
8
8
  authors = [
9
9
  { name="Slimani Floric", email="floric.slimani@live.com" },
10
10
  ]
@@ -38,4 +38,4 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38
38
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
39
 
40
40
  """
41
- __version__ = "1.9.1"
41
+ __version__ = "1.9.2"
@@ -123,7 +123,7 @@ def __update_clusters(new_clusters: np.ndarray, spots: np.ndarray, voxel_size, c
123
123
  Outdated. previous behaviour.
124
124
  """
125
125
  if len(new_clusters) == 0 : return new_clusters
126
- if len(spots) == 0 : return np.empty(shape=(0,2+len(voxel_size)))
126
+ if len(spots) == 0 : return np.empty(shape=(0,2+len(voxel_size)), dtype=int)
127
127
 
128
128
  if len(new_clusters[0]) in [2,3] :
129
129
  new_clusters = np.concatenate([
@@ -198,7 +198,7 @@ def correct_spots(
198
198
  if len(clusters) > 0 :
199
199
  clusters_coordinates = clusters[:, :dim]
200
200
  else :
201
- clusters_coordinates = np.empty(shape=(0,3))
201
+ clusters_coordinates = np.empty(shape=(0,3), dtype=int)
202
202
  Viewer.add_points( # cluster; this layer can be update by user.
203
203
  clusters_coordinates,
204
204
  size = 10,
@@ -222,14 +222,13 @@ def correct_spots(
222
222
  if type(clusters) != type(None) :
223
223
  new_clusters = np.round(Viewer.layers['foci'].data).astype(int)
224
224
  if len(new_clusters) == 0 :
225
- new_clusters = np.empty(shape=(0,5))
225
+ new_clusters = np.empty(shape=(0,5), dtype=int)
226
226
  new_cluster_id = -1 * np.ones(len(new_spots))
227
227
  new_spots = np.concatenate([new_spots, new_cluster_id], axis=1)
228
228
  else :
229
229
  new_cluster_id = Viewer.layers['foci'].features.to_numpy()
230
230
  new_clusters = np.concatenate([new_clusters, new_cluster_id], axis=1)
231
231
 
232
- print("After concatenate new clusters shape = {0}".format(new_clusters.shape))
233
232
 
234
233
  new_spots, new_clusters = _update_clusters(
235
234
  old_spots =spots,
@@ -243,7 +242,6 @@ def correct_spots(
243
242
  null_value= -2
244
243
  )
245
244
 
246
- print("After _update_cluster\nnew_clusters shape = {0}\nnew_spots shape = {1}".format(new_clusters.shape, new_spots.shape))
247
245
 
248
246
  else : new_clusters = None
249
247
 
@@ -183,7 +183,7 @@ def cluster_detection(spots, voxel_size, radius = 350, nb_min_spots = 4, keys_to
183
183
  elif isinstance(keys_to_compute, list) : pass
184
184
  else : raise TypeError("Wrong type for keys_to_compute. Should be list[str] or str. It is {0}".format(type(keys_to_compute)))
185
185
  if len(spots) == 0 :
186
- res = {'clustered_spots' : [], 'clusters' : [], 'clustered_spots_dataframe' : pd.DataFrame(columns= ["id", "cluster_id", "z", "y", "x"]), 'clusters_dataframe' : pd.DataFrame(columns= ["id", "z", "y", "x", "spot_number"])}
186
+ res = {'clustered_spots' : np.empty(shape=(0,len(voxel_size) + 1), dtype=int), 'clusters' : np.empty(shape=(0,len(voxel_size) + 2), dtype=int), 'clustered_spots_dataframe' : pd.DataFrame(columns= ["id", "cluster_id", "z", "y", "x"]), 'clusters_dataframe' : pd.DataFrame(columns= ["id", "z", "y", "x", "spot_number"])}
187
187
  return {key : res[key] for key in keys_to_compute}
188
188
  else : res = {}
189
189
  voxel_size = tuple([int(d) for d in voxel_size])
@@ -192,7 +192,7 @@ def cluster_detection(spots, voxel_size, radius = 350, nb_min_spots = 4, keys_to
192
192
 
193
193
  if 'clustered_spots' in keys_to_compute :
194
194
  res['clustered_spots'] = clustered_spots
195
-
195
+ voxel_size
196
196
  if 'clusters' in keys_to_compute :
197
197
  res['clusters'] = clusters
198
198
 
@@ -407,9 +407,8 @@ def launch_cell_extraction(
407
407
 
408
408
  if do_clustering :
409
409
  if len(clusters) > 0 :
410
-
411
- free_spots = spots[spots_cluster_id == -1]
412
- clustered_spots = spots[spots_cluster_id != -1]
410
+ free_spots = spots[spots_cluster_id == -1].astype(int)
411
+ clustered_spots = spots[spots_cluster_id != -1].astype(int)
413
412
 
414
413
  other_coords = {
415
414
  'clusters_coords' : clusters,
@@ -471,6 +470,13 @@ def launch_cell_extraction(
471
470
  free_spots_coords = cell.get('free_spots')
472
471
  signal = cell['image']
473
472
 
473
+ if do_clustering :
474
+ if len(clusters) > 0 :
475
+ compute_foci = True
476
+ else :
477
+ compute_foci = False
478
+ else : compute_foci = False
479
+
474
480
  with np.errstate(divide= 'ignore', invalid= 'ignore') :
475
481
  features = classification.compute_features(
476
482
  cell_mask=cell_mask,
@@ -485,7 +491,7 @@ def launch_cell_extraction(
485
491
  compute_area=True,
486
492
  compute_dispersion=True,
487
493
  compute_distance=True,
488
- compute_foci= do_clustering and len(clusters) > 0,
494
+ compute_foci= compute_foci,
489
495
  compute_intranuclear=True,
490
496
  compute_protrusion=False,
491
497
  compute_topography=True
@@ -535,7 +541,8 @@ def launch_cell_extraction(
535
541
 
536
542
  features = [acquisition_id, cell_id, cell_bbox] + features
537
543
  features += [rna_coords, foci_coords, clustered_spots_coords, free_spots_coords]
538
- features += [len(clustered_spots_coords), len(free_spots_coords)]
544
+ features += [len(clustered_spots_coords) if type(clustered_spots_coords) != type(None) else None]
545
+ features += [len(free_spots_coords) if type(free_spots_coords) != type(None) else None]
539
546
 
540
547
  result_frame = pd.concat([
541
548
  result_frame,
File without changes
File without changes