spacr 0.2.32__py3-none-any.whl → 0.2.45__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.
Binary file
Binary file
spacr/settings.py CHANGED
@@ -1114,7 +1114,7 @@ categories = {
1114
1114
  }
1115
1115
 
1116
1116
  descriptions = {
1117
- 'mask': "Generate Cellpose masks for Cells, Nuclei, and Pathogens. Function: preprocess_generate_masks from spacr.core.\n\nKey Features:\n- Automated Mask Generation: Automatically generate accurate masks for various cellular components using Cellpose, a robust deep learning model for cell segmentation.\n- Versatility: Capable of handling different types of biological samples, including cells, nuclei, and pathogens.\n- Integration: Directly integrates with other modules, providing the foundational masks required for subsequent analysis.",
1117
+ 'mask': "\n\nHelp:\n- Generate Cells, Nuclei, Pathogens, and Cytoplasm masks from intensity images in src.\n- To ensure that spacr is installed correctly:\n- 1. Downloade the training set (click Download).\n- 2. Import settings (click settings navigate to downloaded dataset settings folder and import preprocess_generate_masks_settings.csv).\n- 3. Run the module.\n- 4. Proceed to the Measure module (click Measure in the menue bar).\n- For further help, click the Help button in the menue bar.",
1118
1118
 
1119
1119
  'measure': "Capture Measurements from Cells, Nuclei, Pathogens, and Cytoplasm objects. Generate single object PNG images for one or several objects. (Requires masks from the Mask module). Function: measure_crop from spacr.measure.\n\nKey Features:\n- Comprehensive Measurement Capture: Obtain detailed measurements for various cellular components, including area, perimeter, intensity, and more.\n- Image Generation: Create high-resolution PNG images of individual objects, facilitating further analysis and visualization.\n- Mask Dependency: Requires accurate masks generated by the Mask module to ensure precise measurements.",
1120
1120
 
spacr/utils.py CHANGED
@@ -87,27 +87,6 @@ from scipy.stats import f_oneway, kruskal
87
87
  from sklearn.cluster import KMeans
88
88
  from scipy import stats
89
89
 
90
- def print_progress_v1(files_processed, files_to_process, n_jobs, time_ls=None, batch_size=None, operation_type=""):
91
- if isinstance(files_processed, list):
92
- files_processed = len(files_processed)
93
- if isinstance(files_to_process, list):
94
- files_to_process = len(files_to_process)
95
- if isinstance(batch_size, list):
96
- batch_size = len(batch_size)
97
-
98
- if time_ls is not None:
99
- average_time = np.mean(time_ls) if len(time_ls) > 0 else 0
100
- time_left = (((files_to_process-files_processed)*average_time)/n_jobs)/60
101
- if batch_size is None:
102
- print(f'Time/image: {average_time:.3f}sec')
103
- print(f'Time_left: {time_left:.3f} min.')
104
- else:
105
- average_time_img = average_time/batch_size
106
- print(f'Time/batch:{average_time:.3f}sec')
107
- print(f'Time/image {average_time_img:.3f}')
108
- print(f'Time_left: {time_left:.3f} min.')
109
-
110
- print(f'Progress: {files_processed}/{files_to_process}, operation_type: {operation_type}')
111
90
 
112
91
  def print_progress(files_processed, files_to_process, n_jobs, time_ls=None, batch_size=None, operation_type=""):
113
92
  if isinstance(files_processed, list):
@@ -2989,11 +2968,13 @@ def _choose_model(model_name, device, object_type='cell', restore_type=None, obj
2989
2968
  if restore_type == None:
2990
2969
  if model_name in ['cyto', 'cyto2', 'cyto3', 'nuclei']:
2991
2970
  model = cp_models.Cellpose(gpu=torch.cuda.is_available(), model_type=model_name, device=device)
2992
-
2971
+ return model
2993
2972
  else:
2994
2973
  if object_type == 'nucleus':
2995
2974
  restore = f'{type}_nuclei'
2996
2975
  model = denoise.CellposeDenoiseModel(gpu=torch.cuda.is_available(), model_type="nuclei",restore_type=restore, chan2_restore=False, device=device)
2976
+ return model
2977
+
2997
2978
  else:
2998
2979
  restore = f'{type}_cyto3'
2999
2980
  if model_name =='cyto2':
@@ -3001,8 +2982,7 @@ def _choose_model(model_name, device, object_type='cell', restore_type=None, obj
3001
2982
  if model_name =='cyto':
3002
2983
  chan2_restore = False
3003
2984
  model = denoise.CellposeDenoiseModel(gpu=torch.cuda.is_available(), model_type="cyto3",restore_type=restore, chan2_restore=chan2_restore, device=device)
3004
-
3005
- return model
2985
+ return model
3006
2986
 
3007
2987
  class SelectChannels:
3008
2988
  def __init__(self, channels):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spacr
3
- Version: 0.2.32
3
+ Version: 0.2.45
4
4
  Summary: Spatial phenotype analysis of crisp screens (SpaCr)
5
5
  Home-page: https://github.com/EinarOlafsson/spacr
6
6
  Author: Einar Birnir Olafsson
@@ -39,6 +39,9 @@ Requires-Dist: ttf-opensans >=2020.10.30
39
39
  Requires-Dist: customtkinter <6.0,>=5.2.2
40
40
  Requires-Dist: biopython <2.0,>=1.80
41
41
  Requires-Dist: lxml <6.0,>=5.1.0
42
+ Requires-Dist: psutil <6.0,>=5.9.8
43
+ Requires-Dist: gputil <2.0,>=1.4.0
44
+ Requires-Dist: gpustat <2.0,>=1.1.1
42
45
  Requires-Dist: huggingface-hub <0.25,>=0.24.0
43
46
  Provides-Extra: dev
44
47
  Requires-Dist: pytest <3.11,>=3.9 ; extra == 'dev'
@@ -8,23 +8,23 @@ spacr/app_measure.py,sha256=_K7APYIeOKpV6e_LcqabBjvEi7mfq9Fch8175x1x0k8,162
8
8
  spacr/app_sequencing.py,sha256=DjG26jy4cpddnV8WOOAIiExtOe9MleVMY4MFa5uTo5w,157
9
9
  spacr/app_umap.py,sha256=ZWAmf_OsIKbYvolYuWPMYhdlVe-n2CADoJulAizMiEo,153
10
10
  spacr/chris.py,sha256=YlBjSgeZaY8HPy6jkrT_ISAnCMAKVfvCxF0I9eAZLFM,2418
11
- spacr/core.py,sha256=iAH6de2dW0nKVtVeBjdWOhSW_KoHlVDVOoOsHb6vGC0,148884
11
+ spacr/core.py,sha256=aAVL5E2Dg7LA16UBoEJsR9jHVJ1-lMJBIwNsfv6hVQ4,148385
12
12
  spacr/deep_spacr.py,sha256=ASBsN4JpHp_3S-91JUsB34IWTjTGPYI7jKV2qZnUR5M,37005
13
13
  spacr/graph_learning.py,sha256=1tR-ZxvXE3dBz1Saw7BeVFcrsUFu9OlUZeZVifih9eo,13070
14
- spacr/gui.py,sha256=bA1Qy6D9aeL_Qe0Xeql8bRkbbFajAMGTZZR3uBzIW1Q,8495
15
- spacr/gui_core.py,sha256=4II8TscaDHDvRXc4D-azQyAeVGNkqyN6_HaNhkjij4s,35546
16
- spacr/gui_elements.py,sha256=X04aSf2WGIZ3JqdJMD26hKOgyJ4hOdTfyUrb-NttiyY,96208
17
- spacr/gui_utils.py,sha256=ySSDDYmY80h_Wk2Nb1oxbugRU2TWt6N7BwusUl_-wRo,14970
18
- spacr/io.py,sha256=Dehuqn_oGo0gcyezQIw9rUUvO7oOHDWuMkPDSCgyrp8,115521
14
+ spacr/gui.py,sha256=NoqaHYjqvyiexfXMsFWrRYjcyqAOhEIYnR-82LkKzdk,7277
15
+ spacr/gui_core.py,sha256=7Dmm_KGYwCHpm_n5pz5M1OVj6RxdznG21jriGHpj6c4,31894
16
+ spacr/gui_elements.py,sha256=vxgsCaF_YkvTieliJkHLDZjGnH79vS8vOixdYhElhf4,102043
17
+ spacr/gui_utils.py,sha256=-SOVMToUhbrNpvsaZkrBkBKE9YOU3fJqlkpoxQKnPPY,26221
18
+ spacr/io.py,sha256=AnQn-iS8SZpGJ4EOQ14MYkjvE_MGw1Uy9VBRJrHKnqc,115084
19
19
  spacr/logger.py,sha256=7Zqr3TuuOQLWT32gYr2q1qvv7x0a2JhLANmZcnBXAW8,670
20
- spacr/measure.py,sha256=W5_yuLnsFSafuZNcKzVsCTJSTfpbNgrGTuxG1OVb0iU,55283
21
- spacr/plot.py,sha256=DYJEoK1kz2ih6ZGvKiA3xTqeIeKQNhuQKwgrscopFxA,69101
20
+ spacr/measure.py,sha256=u7j3z8wJyDQt24vh0nUmrI7uS1hei_9p_zlmAwoT4zI,55295
21
+ spacr/plot.py,sha256=ihyseFapQuF1JPzno2FaTpltgFYZZjTdrF56s5mYbQ8,73626
22
22
  spacr/sequencing.py,sha256=fHZRnoMSxmhMdadkei3lUeBdckqFyptWdQyWsDW3aaU,83304
23
- spacr/settings.py,sha256=deX0pNwTqyHojpCTiF060RSK5oPeSEcS_s6UlVc0x3Q,65442
23
+ spacr/settings.py,sha256=Js1-CwR8It9DKIfikfpt0GXpFNJN08udyGLaHZ6IMnE,65395
24
24
  spacr/sim.py,sha256=FveaVgBi3eypO2oVB5Dx-v0CC1Ny7UPfXkJiiRRodAk,71212
25
25
  spacr/sim_app.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
26
  spacr/timelapse.py,sha256=KMYCgHzf9LTZe-lWl5mvH2EjbKRE6OhpwdY13wEumGc,39504
27
- spacr/utils.py,sha256=r23Cd94HT3q1kMIbyEmyvJVnnDOY16plvUXVwxuX1PE,189256
27
+ spacr/utils.py,sha256=_aIhV_2frswNZCVXgPOJeO1Pfm_WbdOEhd8phWLKkII,188277
28
28
  spacr/version.py,sha256=axH5tnGwtgSnJHb5IDhiu4Zjk5GhLyAEDRe-rnaoFOA,409
29
29
  spacr/resources/icons/abort.png,sha256=avtIRT7aCJsdZ1WnY_rZStm6cCji5bYPLnlptdcTNcM,6583
30
30
  spacr/resources/icons/annotate.png,sha256=GFgh7DiUMwPG_-xE6W1qU8V_qzSwBi1xKenfoaQxeFA,15495
@@ -33,7 +33,9 @@ spacr/resources/icons/cellpose_masks.png,sha256=HVWOIOBF8p3-On-2UahwMyQXp7awsoC5
33
33
  spacr/resources/icons/classify.png,sha256=-iv4sqAwUVJO3CG6fHKHf3_BB0s-I2i4prg-iR7dSBM,35897
34
34
  spacr/resources/icons/default.png,sha256=KoNhaSHukO4wDyivyYEgSbb5mGj-sAxmhKikLLtNpWs,20341
35
35
  spacr/resources/icons/download.png,sha256=1nUoWRaTc4vIsK6gompdeqk0cIv2GdH-gCNHaEBX6Mc,20467
36
- spacr/resources/icons/logo_spacr.png,sha256=g9y2ZmnV3hab8r1idDfytm8AaHbBiQdu_93Jd7YKzwA,610892
36
+ spacr/resources/icons/logo.pdf,sha256=VB4cS41V3VV_QxD7l6CwdQKQiYLErugLBxWoCoxjQU0,377925
37
+ spacr/resources/icons/logo_spacr.png,sha256=qG3e3bdrAefhl1281rfo0R2XP0qA-c-oaBCXjxMGXkw,42587
38
+ spacr/resources/icons/logo_spacr_1.png,sha256=g9y2ZmnV3hab8r1idDfytm8AaHbBiQdu_93Jd7YKzwA,610892
37
39
  spacr/resources/icons/make_masks.png,sha256=iB4kaTgbgyygSJSNstVKhRIXKSgWYkeh7Gt3ox-kWDI,42493
38
40
  spacr/resources/icons/map_barcodes.png,sha256=ED6yCopk3hP7tICSvT8U_qA1bOOb0WHqmxVkmRxnbtE,7896
39
41
  spacr/resources/icons/mask.png,sha256=DcBes-3UJ7XjRfj_P4RttRp680ZKZeH9a-DSk7bIF5U,37658
@@ -50,9 +52,9 @@ spacr/resources/icons/umap.png,sha256=dOLF3DeLYy9k0nkUybiZMe1wzHQwLJFRmgccppw-8b
50
52
  spacr/resources/models/cp/toxo_plaque_cyto_e25000_X1120_Y1120.CP_model,sha256=z8BbHWZPRnE9D_BHO0fBREE85c1vkltDs-incs2ytXQ,26566572
51
53
  spacr/resources/models/cp/toxo_plaque_cyto_e25000_X1120_Y1120.CP_model_settings.csv,sha256=fBAGuL_B8ERVdVizO3BHozTDSbZUh1yFzsYK3wkQN68,420
52
54
  spacr/resources/models/cp/toxo_pv_lumen.CP_model,sha256=2y_CindYhmTvVwBH39SNILF3rI3x9SsRn6qrMxHy3l0,26562451
53
- spacr-0.2.32.dist-info/LICENSE,sha256=SR-2MeGc6SCM1UORJYyarSWY_A-JaOMFDj7ReSs9tRM,1083
54
- spacr-0.2.32.dist-info/METADATA,sha256=7GPY-yVzmB8pnDA1LszwCL7ls2OEQUcKla_s6br0ncc,5050
55
- spacr-0.2.32.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
56
- spacr-0.2.32.dist-info/entry_points.txt,sha256=BMC0ql9aNNpv8lUZ8sgDLQMsqaVnX5L535gEhKUP5ho,296
57
- spacr-0.2.32.dist-info/top_level.txt,sha256=GJPU8FgwRXGzKeut6JopsSRY2R8T3i9lDgya42tLInY,6
58
- spacr-0.2.32.dist-info/RECORD,,
55
+ spacr-0.2.45.dist-info/LICENSE,sha256=SR-2MeGc6SCM1UORJYyarSWY_A-JaOMFDj7ReSs9tRM,1083
56
+ spacr-0.2.45.dist-info/METADATA,sha256=NCoOOcQM14mXWrbWCe8o64hNgWYn4fl1AaDhHJXiwWE,5156
57
+ spacr-0.2.45.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
58
+ spacr-0.2.45.dist-info/entry_points.txt,sha256=BMC0ql9aNNpv8lUZ8sgDLQMsqaVnX5L535gEhKUP5ho,296
59
+ spacr-0.2.45.dist-info/top_level.txt,sha256=GJPU8FgwRXGzKeut6JopsSRY2R8T3i9lDgya42tLInY,6
60
+ spacr-0.2.45.dist-info/RECORD,,
File without changes