spacr 0.1.1__tar.gz → 0.1.7__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 (69) hide show
  1. {spacr-0.1.1/spacr.egg-info → spacr-0.1.7}/PKG-INFO +13 -22
  2. {spacr-0.1.1 → spacr-0.1.7}/README.rst +10 -19
  3. {spacr-0.1.1 → spacr-0.1.7}/setup.py +40 -20
  4. {spacr-0.1.1 → spacr-0.1.7}/spacr/__init__.py +18 -12
  5. spacr-0.1.1/spacr/annotate_app_v2.py → spacr-0.1.7/spacr/app_annotate.py +185 -155
  6. spacr-0.1.7/spacr/app_classify.py +8 -0
  7. spacr-0.1.1/spacr/mask_app.py → spacr-0.1.7/spacr/app_make_masks.py +75 -75
  8. spacr-0.1.7/spacr/app_mask.py +8 -0
  9. spacr-0.1.7/spacr/app_measure.py +8 -0
  10. spacr-0.1.7/spacr/app_sequencing.py +8 -0
  11. spacr-0.1.7/spacr/app_umap.py +8 -0
  12. {spacr-0.1.1 → spacr-0.1.7}/spacr/core.py +30 -28
  13. {spacr-0.1.1 → spacr-0.1.7}/spacr/deep_spacr.py +9 -7
  14. spacr-0.1.1/spacr/gui_2.py → spacr-0.1.7/spacr/gui.py +46 -42
  15. spacr-0.1.7/spacr/gui_core.py +608 -0
  16. spacr-0.1.7/spacr/gui_elements.py +324 -0
  17. spacr-0.1.7/spacr/gui_run.py +58 -0
  18. spacr-0.1.7/spacr/gui_utils.py +149 -0
  19. spacr-0.1.7/spacr/gui_wrappers.py +149 -0
  20. {spacr-0.1.1 → spacr-0.1.7}/spacr/measure.py +35 -15
  21. {spacr-0.1.1 → spacr-0.1.7}/spacr/plot.py +53 -1
  22. {spacr-0.1.1 → spacr-0.1.7}/spacr/sequencing.py +1 -17
  23. spacr-0.1.7/spacr/settings.py +970 -0
  24. {spacr-0.1.1 → spacr-0.1.7}/spacr/utils.py +73 -11
  25. {spacr-0.1.1 → spacr-0.1.7/spacr.egg-info}/PKG-INFO +13 -22
  26. {spacr-0.1.1 → spacr-0.1.7}/spacr.egg-info/SOURCES.txt +12 -8
  27. spacr-0.1.7/spacr.egg-info/entry_points.txt +8 -0
  28. {spacr-0.1.1 → spacr-0.1.7}/spacr.egg-info/requires.txt +2 -2
  29. {spacr-0.1.1 → spacr-0.1.7}/tests/test_annotate_app.py +1 -1
  30. {spacr-0.1.1 → spacr-0.1.7}/tests/test_gui_classify_app.py +1 -1
  31. {spacr-0.1.1 → spacr-0.1.7}/tests/test_gui_mask_app.py +1 -1
  32. {spacr-0.1.1 → spacr-0.1.7}/tests/test_gui_measure_app.py +1 -1
  33. {spacr-0.1.1 → spacr-0.1.7}/tests/test_gui_sim_app.py +1 -1
  34. {spacr-0.1.1 → spacr-0.1.7}/tests/test_mask_app.py +1 -1
  35. spacr-0.1.1/spacr/annotate_app.py +0 -511
  36. spacr-0.1.1/spacr/gui.py +0 -145
  37. spacr-0.1.1/spacr/gui_classify_app.py +0 -187
  38. spacr-0.1.1/spacr/gui_mask_app.py +0 -245
  39. spacr-0.1.1/spacr/gui_measure_app.py +0 -236
  40. spacr-0.1.1/spacr/gui_utils.py +0 -1095
  41. spacr-0.1.1/spacr/settings.py +0 -477
  42. spacr-0.1.1/spacr.egg-info/entry_points.txt +0 -9
  43. {spacr-0.1.1 → spacr-0.1.7}/LICENSE +0 -0
  44. {spacr-0.1.1 → spacr-0.1.7}/MANIFEST.in +0 -0
  45. {spacr-0.1.1 → spacr-0.1.7}/setup.cfg +0 -0
  46. {spacr-0.1.1 → spacr-0.1.7}/spacr/__main__.py +0 -0
  47. {spacr-0.1.1 → spacr-0.1.7}/spacr/chris.py +0 -0
  48. {spacr-0.1.1 → spacr-0.1.7}/spacr/graph_learning.py +0 -0
  49. {spacr-0.1.1 → spacr-0.1.7}/spacr/io.py +0 -0
  50. {spacr-0.1.1 → spacr-0.1.7}/spacr/logger.py +0 -0
  51. {spacr-0.1.1 → spacr-0.1.7}/spacr/models/cp/toxo_plaque_cyto_e25000_X1120_Y1120.CP_model +0 -0
  52. {spacr-0.1.1 → spacr-0.1.7}/spacr/models/cp/toxo_plaque_cyto_e25000_X1120_Y1120.CP_model_settings.csv +0 -0
  53. {spacr-0.1.1 → spacr-0.1.7}/spacr/models/cp/toxo_pv_lumen.CP_model +0 -0
  54. {spacr-0.1.1 → spacr-0.1.7}/spacr/sim.py +0 -0
  55. /spacr-0.1.1/spacr/gui_sim_app.py → /spacr-0.1.7/spacr/sim_app.py +0 -0
  56. {spacr-0.1.1 → spacr-0.1.7}/spacr/timelapse.py +0 -0
  57. {spacr-0.1.1 → spacr-0.1.7}/spacr/version.py +0 -0
  58. {spacr-0.1.1 → spacr-0.1.7}/spacr.egg-info/dependency_links.txt +0 -0
  59. {spacr-0.1.1 → spacr-0.1.7}/spacr.egg-info/top_level.txt +0 -0
  60. {spacr-0.1.1 → spacr-0.1.7}/tests/test_core.py +0 -0
  61. {spacr-0.1.1 → spacr-0.1.7}/tests/test_gui_utils.py +0 -0
  62. {spacr-0.1.1 → spacr-0.1.7}/tests/test_io.py +0 -0
  63. {spacr-0.1.1 → spacr-0.1.7}/tests/test_measure.py +0 -0
  64. {spacr-0.1.1 → spacr-0.1.7}/tests/test_plot.py +0 -0
  65. {spacr-0.1.1 → spacr-0.1.7}/tests/test_sim.py +0 -0
  66. {spacr-0.1.1 → spacr-0.1.7}/tests/test_timelapse.py +0 -0
  67. {spacr-0.1.1 → spacr-0.1.7}/tests/test_train.py +0 -0
  68. {spacr-0.1.1 → spacr-0.1.7}/tests/test_umap.py +0 -0
  69. {spacr-0.1.1 → spacr-0.1.7}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spacr
3
- Version: 0.1.1
3
+ Version: 0.1.7
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
@@ -9,7 +9,6 @@ Classifier: Programming Language :: Python :: 3
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  License-File: LICENSE
12
- Requires-Dist: dgl==0.9.1
13
12
  Requires-Dist: torch<3.0,>=2.2.1
14
13
  Requires-Dist: torchvision<1.0,>=0.17.1
15
14
  Requires-Dist: torch-geometric<3.0,>=2.5.1
@@ -40,8 +39,9 @@ Requires-Dist: ttf_opensans>=2020.10.30
40
39
  Requires-Dist: customtkinter<6.0,>=5.2.2
41
40
  Requires-Dist: biopython<2.0,>=1.80
42
41
  Requires-Dist: lxml<6.0,>=5.1.0
42
+ Requires-Dist: huggingface-hub<0.25,>=0.24.0
43
43
  Provides-Extra: dev
44
- Requires-Dist: pytest>=3.9; extra == "dev"
44
+ Requires-Dist: pytest<3.11,>=3.9; extra == "dev"
45
45
  Provides-Extra: headless
46
46
  Requires-Dist: opencv-python-headless; extra == "headless"
47
47
  Provides-Extra: full
@@ -63,7 +63,7 @@ Requires-Dist: opencv-python; extra == "full"
63
63
  SpaCr
64
64
  =====
65
65
 
66
- Spatial phenotype analysis of CRISPR-Cas9 screens (SpaCr). The spatial organization of organelles and proteins within cells constitutes a key level of functional regulation. In the context of infectious disease, the spatial relationships between host cell structures and intracellular pathogens are critical to understand host clearance mechanisms and how pathogens evade them. SpaCr is a Python-based software package for generating single-cell image data for deep-learning sub-cellular/cellular phenotypic classification from pooled genetic CRISPR-Cas9 screens. SpaCr provides a flexible toolset to extract single-cell images and measurements from high-content cell painting experiments, train deep-learning models to classify cellular/subcellular phenotypes, simulate, and analyze pooled CRISPR-Cas9 imaging screens.
66
+ Spatial phenotype analysis of CRISPR-Cas9 screens (SpaCr). The spatial organization of organelles and proteins within cells constitutes a key level of functional regulation. In the context of infectious disease, the spatial relationships between host cell structures and intracellular pathogens are critical to understanding host clearance mechanisms and how pathogens evade them. SpaCr is a Python-based software package for generating single-cell image data for deep-learning sub-cellular/cellular phenotypic classification from pooled genetic CRISPR-Cas9 screens. SpaCr provides a flexible toolset to extract single-cell images and measurements from high-content cell painting experiments, train deep-learning models to classify cellular/subcellular phenotypes, simulate, and analyze pooled CRISPR-Cas9 imaging screens.
67
67
 
68
68
  Features
69
69
  --------
@@ -72,9 +72,9 @@ Features
72
72
 
73
73
  - **Object Measurements:** Measurements for each object including scikit-image-regionprops, intensity percentiles, shannon-entropy, pearsons and manders correlations, homogeneity, and radial distribution. Measurements are saved to a SQL database in object-level tables.
74
74
 
75
- - **Crop Images:** Objects (e.g., cells) can be saved as PNGs from the object area or bounding box area of each object. Object paths are saved in a SQL database that can be annotated and used to train CNNs/Transformer models for classification tasks.
75
+ - **Crop Images:** Save objects (cells, nuclei, pathogen, cytoplasm) as images. Object image paths are saved in a SQL database.
76
76
 
77
- - **Train CNNs or Transformers:** Train Torch Convolutional Neural Networks (CNNs) or Transformers to classify single object images. Train Torch models with IRM/ERM, checkpointing.
77
+ - **Train CNNs or Transformers:** Train Torch models to classify single object images.
78
78
 
79
79
  - **Manual Annotation:** Supports manual annotation of single-cell images and segmentation to refine training datasets for training CNNs/Transformers or cellpose, respectively.
80
80
 
@@ -91,29 +91,20 @@ Features
91
91
  Installation
92
92
  ------------
93
93
 
94
- Requires Tkinter for graphical user interface features.
94
+ If using Windows, switch to Linux—it's free, open-source, and better.
95
95
 
96
- Ubuntu
97
- ~~~~~~
96
+ Before installing SpaCr on OSX ensure OpenMP is installed::
98
97
 
99
- Before installing SpaCr, ensure Tkinter is installed:
98
+ brew install libomp
100
99
 
101
- (Tkinter is included with the standard Python installation on macOS, and Windows)
102
-
103
- On Linux:
104
-
105
- ::
100
+ SpaCr GUI requires Tkinter. On Linux, ensure Tkinter is installed. (Tkinter is included with the standard Python installation on macOS and Windows)::
106
101
 
107
102
  sudo apt-get install python3-tk
108
103
 
109
- Install spacr with pip
110
-
111
- ::
104
+ Install SpaCr with pip::
112
105
 
113
106
  pip install spacr
114
107
 
115
- Run spacr GUI:
116
-
117
- ::
108
+ Run SpaCr GUI::
118
109
 
119
- gui
110
+ spacr
@@ -14,7 +14,7 @@
14
14
  SpaCr
15
15
  =====
16
16
 
17
- Spatial phenotype analysis of CRISPR-Cas9 screens (SpaCr). The spatial organization of organelles and proteins within cells constitutes a key level of functional regulation. In the context of infectious disease, the spatial relationships between host cell structures and intracellular pathogens are critical to understand host clearance mechanisms and how pathogens evade them. SpaCr is a Python-based software package for generating single-cell image data for deep-learning sub-cellular/cellular phenotypic classification from pooled genetic CRISPR-Cas9 screens. SpaCr provides a flexible toolset to extract single-cell images and measurements from high-content cell painting experiments, train deep-learning models to classify cellular/subcellular phenotypes, simulate, and analyze pooled CRISPR-Cas9 imaging screens.
17
+ Spatial phenotype analysis of CRISPR-Cas9 screens (SpaCr). The spatial organization of organelles and proteins within cells constitutes a key level of functional regulation. In the context of infectious disease, the spatial relationships between host cell structures and intracellular pathogens are critical to understanding host clearance mechanisms and how pathogens evade them. SpaCr is a Python-based software package for generating single-cell image data for deep-learning sub-cellular/cellular phenotypic classification from pooled genetic CRISPR-Cas9 screens. SpaCr provides a flexible toolset to extract single-cell images and measurements from high-content cell painting experiments, train deep-learning models to classify cellular/subcellular phenotypes, simulate, and analyze pooled CRISPR-Cas9 imaging screens.
18
18
 
19
19
  Features
20
20
  --------
@@ -23,9 +23,9 @@ Features
23
23
 
24
24
  - **Object Measurements:** Measurements for each object including scikit-image-regionprops, intensity percentiles, shannon-entropy, pearsons and manders correlations, homogeneity, and radial distribution. Measurements are saved to a SQL database in object-level tables.
25
25
 
26
- - **Crop Images:** Objects (e.g., cells) can be saved as PNGs from the object area or bounding box area of each object. Object paths are saved in a SQL database that can be annotated and used to train CNNs/Transformer models for classification tasks.
26
+ - **Crop Images:** Save objects (cells, nuclei, pathogen, cytoplasm) as images. Object image paths are saved in a SQL database.
27
27
 
28
- - **Train CNNs or Transformers:** Train Torch Convolutional Neural Networks (CNNs) or Transformers to classify single object images. Train Torch models with IRM/ERM, checkpointing.
28
+ - **Train CNNs or Transformers:** Train Torch models to classify single object images.
29
29
 
30
30
  - **Manual Annotation:** Supports manual annotation of single-cell images and segmentation to refine training datasets for training CNNs/Transformers or cellpose, respectively.
31
31
 
@@ -42,29 +42,20 @@ Features
42
42
  Installation
43
43
  ------------
44
44
 
45
- Requires Tkinter for graphical user interface features.
45
+ If using Windows, switch to Linux—it's free, open-source, and better.
46
46
 
47
- Ubuntu
48
- ~~~~~~
47
+ Before installing SpaCr on OSX ensure OpenMP is installed::
49
48
 
50
- Before installing SpaCr, ensure Tkinter is installed:
49
+ brew install libomp
51
50
 
52
- (Tkinter is included with the standard Python installation on macOS, and Windows)
53
-
54
- On Linux:
55
-
56
- ::
51
+ SpaCr GUI requires Tkinter. On Linux, ensure Tkinter is installed. (Tkinter is included with the standard Python installation on macOS and Windows)::
57
52
 
58
53
  sudo apt-get install python3-tk
59
54
 
60
- Install spacr with pip
61
-
62
- ::
55
+ Install SpaCr with pip::
63
56
 
64
57
  pip install spacr
65
58
 
66
- Run spacr GUI:
67
-
68
- ::
59
+ Run SpaCr GUI::
69
60
 
70
- gui
61
+ spacr
@@ -10,19 +10,11 @@ def get_cuda_version():
10
10
  except (subprocess.CalledProcessError, FileNotFoundError):
11
11
  return None
12
12
 
13
- cuda_version = get_cuda_version()
14
-
15
- if cuda_version:
16
- dgl_dependency = f'dgl-cu{cuda_version}==0.9.1' # Specify the version of DGL compatible with your setup
17
- else:
18
- dgl_dependency = 'dgl==0.9.1' # Fallback to CPU version if no CUDA is detected
19
-
20
13
  # Ensure you have read the README.rst content into a variable, e.g., `long_description`
21
14
  with open("README.rst", "r", encoding="utf-8") as fh:
22
15
  long_description = fh.read()
23
16
 
24
17
  dependencies = [
25
- dgl_dependency,
26
18
  'torch>=2.2.1,<3.0',
27
19
  'torchvision>=0.17.1,<1.0',
28
20
  'torch-geometric>=2.5.1,<3.0',
@@ -52,12 +44,13 @@ dependencies = [
52
44
  'ttf_opensans>=2020.10.30',
53
45
  'customtkinter>=5.2.2,<6.0',
54
46
  'biopython>=1.80,<2.0',
55
- 'lxml>=5.1.0,<6.0'
47
+ 'lxml>=5.1.0,<6.0',
48
+ 'huggingface-hub>=0.24.0,<0.25'
56
49
  ]
57
50
 
58
51
  setup(
59
52
  name="spacr",
60
- version="0.1.01",
53
+ version="0.1.7",
61
54
  author="Einar Birnir Olafsson",
62
55
  author_email="olafsson@med.umich.com",
63
56
  description="Spatial phenotype analysis of crisp screens (SpaCr)",
@@ -69,18 +62,17 @@ setup(
69
62
  install_requires=dependencies,
70
63
  entry_points={
71
64
  'console_scripts': [
72
- 'mask=spacr.gui_mask_app:gui_mask',
73
- 'measure=spacr.gui_measure_app:gui_measure',
74
- 'make_masks=spacr.mask_app:gui_make_masks',
75
- 'annotate=spacr.annotate_app:gui_annotation',
76
- 'classify=spacr.gui_classify_app:gui_classify',
77
- 'sim=spacr.gui_sim_app:gui_sim',
78
- 'gui=spacr.gui:gui_app',
79
- 'gui2=spacr.gui_2:gui_app',
65
+ 'mask=spacr.app_mask:start_mask_app',
66
+ 'measure=spacr.app_measure:start_measure_app',
67
+ 'make_masks=spacr.app_make_masks:gui_make_masks',
68
+ 'annotate=spacr.app_annotate:gui_annotate',
69
+ 'classify=spacr.app_classify:start_classify_app',
70
+ 'sim=spacr.app_sim:gui_sim',
71
+ 'spacr=spacr.gui:gui_app',
80
72
  ],
81
73
  },
82
74
  extras_require={
83
- 'dev': ['pytest>=3.9'],
75
+ 'dev': ['pytest>=3.9,<3.11'],
84
76
  'headless': ['opencv-python-headless'],
85
77
  'full': ['opencv-python'],
86
78
  },
@@ -89,4 +81,32 @@ setup(
89
81
  "License :: OSI Approved :: MIT License",
90
82
  "Operating System :: OS Independent",
91
83
  ]
92
- )
84
+ )
85
+
86
+ cuda_version = get_cuda_version()
87
+
88
+ if cuda_version:
89
+ dgl = f'dgl-cu{cuda_version}==0.9.1'
90
+ else:
91
+ dgl = 'dgl==0.9.1' # Fallback to CPU version if no CUDA is detected
92
+ try:
93
+ subprocess.run(['pip', 'install', dgl], check=True)
94
+ except subprocess.CalledProcessError:
95
+ subprocess.run(['pip', 'install', 'dgl'], check=True)
96
+
97
+ deps = ['pyqtgraph>=0.13.7,<0.14',
98
+ 'pyqt6>=6.7.1,<6.8',
99
+ 'pyqt6.sip',
100
+ 'qtpy>=2.4.1,<2.5',
101
+ 'superqt>=0.6.7,<0.7',
102
+ 'pyqtgraph',
103
+ 'pyqt6',
104
+ 'pyqt6.sip',
105
+ 'qtpy',
106
+ 'superqt']
107
+
108
+ for dep in deps:
109
+ try:
110
+ subprocess.run(['pip', 'install', dep], check=True)
111
+ except subprocess.CalledProcessError:
112
+ pass
@@ -12,13 +12,18 @@ from . import sim
12
12
  from . import sequencing
13
13
  from . import timelapse
14
14
  from . import deep_spacr
15
- from . import annotate_app
16
- from . import annotate_app_v2
15
+ from . import app_annotate
17
16
  from . import gui_utils
18
- from . import mask_app
19
- from . import gui_mask_app
20
- from . import gui_measure_app
21
- from . import gui_classify_app
17
+ from . import gui_elements
18
+ from . import gui_core
19
+ from . import gui_run
20
+ from . import gui_wrappers
21
+ from . import app_make_masks
22
+ from . import app_mask
23
+ from . import app_measure
24
+ from . import app_classify
25
+ from . import app_sequencing
26
+ from . import app_umap
22
27
  from . import logger
23
28
 
24
29
 
@@ -33,13 +38,14 @@ __all__ = [
33
38
  "sequencing"
34
39
  "timelapse",
35
40
  "deep_spacr",
36
- "annotate_app",
37
- "annotate_app_v2",
41
+ "app_annotate",
38
42
  "gui_utils",
39
- "mask_app",
40
- "gui_mask_app",
41
- "gui_measure_app",
42
- "gui_classify_app",
43
+ "app_make_masks",
44
+ "app_mask",
45
+ "app_measure",
46
+ "app_classify",
47
+ "app_sequencing",
48
+ "app_umap",
43
49
  "logger"
44
50
  ]
45
51