harpy-analysis 0.0.1__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 (117) hide show
  1. harpy_analysis-0.0.1/LICENSE +35 -0
  2. harpy_analysis-0.0.1/MANIFEST.in +5 -0
  3. harpy_analysis-0.0.1/PKG-INFO +146 -0
  4. harpy_analysis-0.0.1/README.md +54 -0
  5. harpy_analysis-0.0.1/pyproject.toml +65 -0
  6. harpy_analysis-0.0.1/setup.cfg +127 -0
  7. harpy_analysis-0.0.1/src/harpy/__init__.py +23 -0
  8. harpy_analysis-0.0.1/src/harpy/_tests/__init__.py +0 -0
  9. harpy_analysis-0.0.1/src/harpy/_tests/conftest.py +136 -0
  10. harpy_analysis-0.0.1/src/harpy/_tests/test_notebooks.py +167 -0
  11. harpy_analysis-0.0.1/src/harpy/_tests/test_pipeline.py +17 -0
  12. harpy_analysis-0.0.1/src/harpy/_tests/test_widget.py +118 -0
  13. harpy_analysis-0.0.1/src/harpy/configs/__init__.py +0 -0
  14. harpy_analysis-0.0.1/src/harpy/configs/pipeline.yaml +54 -0
  15. harpy_analysis-0.0.1/src/harpy/datasets/__init__.py +13 -0
  16. harpy_analysis-0.0.1/src/harpy/datasets/cluster_blobs.py +201 -0
  17. harpy_analysis-0.0.1/src/harpy/datasets/pixie_example.py +135 -0
  18. harpy_analysis-0.0.1/src/harpy/datasets/proteomics.py +132 -0
  19. harpy_analysis-0.0.1/src/harpy/datasets/registry.py +116 -0
  20. harpy_analysis-0.0.1/src/harpy/datasets/transcriptomics.py +171 -0
  21. harpy_analysis-0.0.1/src/harpy/image/__init__.py +25 -0
  22. harpy_analysis-0.0.1/src/harpy/image/_combine.py +155 -0
  23. harpy_analysis-0.0.1/src/harpy/image/_contrast.py +156 -0
  24. harpy_analysis-0.0.1/src/harpy/image/_filters.py +276 -0
  25. harpy_analysis-0.0.1/src/harpy/image/_image.py +280 -0
  26. harpy_analysis-0.0.1/src/harpy/image/_manager.py +228 -0
  27. harpy_analysis-0.0.1/src/harpy/image/_map.py +383 -0
  28. harpy_analysis-0.0.1/src/harpy/image/_normalize.py +142 -0
  29. harpy_analysis-0.0.1/src/harpy/image/_rasterize.py +270 -0
  30. harpy_analysis-0.0.1/src/harpy/image/_tiling.py +219 -0
  31. harpy_analysis-0.0.1/src/harpy/image/_transcripts.py +202 -0
  32. harpy_analysis-0.0.1/src/harpy/image/pixel_clustering/__init__.py +0 -0
  33. harpy_analysis-0.0.1/src/harpy/image/pixel_clustering/_clustering.py +300 -0
  34. harpy_analysis-0.0.1/src/harpy/image/pixel_clustering/_preprocess.py +227 -0
  35. harpy_analysis-0.0.1/src/harpy/image/segmentation/__init__.py +0 -0
  36. harpy_analysis-0.0.1/src/harpy/image/segmentation/_align_masks.py +241 -0
  37. harpy_analysis-0.0.1/src/harpy/image/segmentation/_expand_masks.py +108 -0
  38. harpy_analysis-0.0.1/src/harpy/image/segmentation/_filter_masks.py +123 -0
  39. harpy_analysis-0.0.1/src/harpy/image/segmentation/_grid.py +230 -0
  40. harpy_analysis-0.0.1/src/harpy/image/segmentation/_map.py +365 -0
  41. harpy_analysis-0.0.1/src/harpy/image/segmentation/_merge_masks.py +476 -0
  42. harpy_analysis-0.0.1/src/harpy/image/segmentation/_segmentation.py +980 -0
  43. harpy_analysis-0.0.1/src/harpy/image/segmentation/_utils.py +463 -0
  44. harpy_analysis-0.0.1/src/harpy/image/segmentation/segmentation_models/__init__.py +0 -0
  45. harpy_analysis-0.0.1/src/harpy/image/segmentation/segmentation_models/_baysor.py +225 -0
  46. harpy_analysis-0.0.1/src/harpy/image/segmentation/segmentation_models/_cellpose.py +141 -0
  47. harpy_analysis-0.0.1/src/harpy/image/segmentation/segmentation_models/_instanseg.py +99 -0
  48. harpy_analysis-0.0.1/src/harpy/image/segmentation/segmentation_models/_mesmer.py +66 -0
  49. harpy_analysis-0.0.1/src/harpy/image/segmentation/segmentation_models/_watershed.py +40 -0
  50. harpy_analysis-0.0.1/src/harpy/io/__init__.py +10 -0
  51. harpy_analysis-0.0.1/src/harpy/io/_merscope.py +238 -0
  52. harpy_analysis-0.0.1/src/harpy/io/_spatial_data.py +291 -0
  53. harpy_analysis-0.0.1/src/harpy/io/_transcripts.py +342 -0
  54. harpy_analysis-0.0.1/src/harpy/io/_visium_hd.py +82 -0
  55. harpy_analysis-0.0.1/src/harpy/io/_xenium.py +203 -0
  56. harpy_analysis-0.0.1/src/harpy/napari.yaml +33 -0
  57. harpy_analysis-0.0.1/src/harpy/pipeline.py +612 -0
  58. harpy_analysis-0.0.1/src/harpy/plot/__init__.py +33 -0
  59. harpy_analysis-0.0.1/src/harpy/plot/_annotation.py +130 -0
  60. harpy_analysis-0.0.1/src/harpy/plot/_cluster_cleanliness.py +123 -0
  61. harpy_analysis-0.0.1/src/harpy/plot/_clustering.py +49 -0
  62. harpy_analysis-0.0.1/src/harpy/plot/_enrichment.py +61 -0
  63. harpy_analysis-0.0.1/src/harpy/plot/_plot.py +870 -0
  64. harpy_analysis-0.0.1/src/harpy/plot/_preprocess.py +73 -0
  65. harpy_analysis-0.0.1/src/harpy/plot/_qc_cells.py +101 -0
  66. harpy_analysis-0.0.1/src/harpy/plot/_qc_image.py +272 -0
  67. harpy_analysis-0.0.1/src/harpy/plot/_qc_segmentation.py +54 -0
  68. harpy_analysis-0.0.1/src/harpy/plot/_sanity.py +353 -0
  69. harpy_analysis-0.0.1/src/harpy/plot/_segmentation.py +65 -0
  70. harpy_analysis-0.0.1/src/harpy/plot/_tiling_correction.py +117 -0
  71. harpy_analysis-0.0.1/src/harpy/plot/_transcripts.py +223 -0
  72. harpy_analysis-0.0.1/src/harpy/points/__init__.py +1 -0
  73. harpy_analysis-0.0.1/src/harpy/points/_points.py +66 -0
  74. harpy_analysis-0.0.1/src/harpy/shape/__init__.py +2 -0
  75. harpy_analysis-0.0.1/src/harpy/shape/_cell_expansion.py +122 -0
  76. harpy_analysis-0.0.1/src/harpy/shape/_manager.py +427 -0
  77. harpy_analysis-0.0.1/src/harpy/shape/_shape.py +181 -0
  78. harpy_analysis-0.0.1/src/harpy/single.py +24 -0
  79. harpy_analysis-0.0.1/src/harpy/table/__init__.py +14 -0
  80. harpy_analysis-0.0.1/src/harpy/table/_allocation.py +459 -0
  81. harpy_analysis-0.0.1/src/harpy/table/_allocation_intensity.py +242 -0
  82. harpy_analysis-0.0.1/src/harpy/table/_annotation.py +799 -0
  83. harpy_analysis-0.0.1/src/harpy/table/_clustering.py +316 -0
  84. harpy_analysis-0.0.1/src/harpy/table/_enrichment.py +59 -0
  85. harpy_analysis-0.0.1/src/harpy/table/_manager.py +65 -0
  86. harpy_analysis-0.0.1/src/harpy/table/_preprocess.py +360 -0
  87. harpy_analysis-0.0.1/src/harpy/table/_regionprops.py +228 -0
  88. harpy_analysis-0.0.1/src/harpy/table/_table.py +337 -0
  89. harpy_analysis-0.0.1/src/harpy/table/cell_clustering/__init__.py +0 -0
  90. harpy_analysis-0.0.1/src/harpy/table/cell_clustering/_clustering.py +161 -0
  91. harpy_analysis-0.0.1/src/harpy/table/cell_clustering/_preprocess.py +221 -0
  92. harpy_analysis-0.0.1/src/harpy/table/cell_clustering/_utils.py +78 -0
  93. harpy_analysis-0.0.1/src/harpy/table/cell_clustering/_weighted_channel_expression.py +140 -0
  94. harpy_analysis-0.0.1/src/harpy/table/pixel_clustering/__init__.py +0 -0
  95. harpy_analysis-0.0.1/src/harpy/table/pixel_clustering/_cluster_intensity.py +216 -0
  96. harpy_analysis-0.0.1/src/harpy/utils/__init__.py +9 -0
  97. harpy_analysis-0.0.1/src/harpy/utils/_aggregate.py +497 -0
  98. harpy_analysis-0.0.1/src/harpy/utils/_flowsom.py +29 -0
  99. harpy_analysis-0.0.1/src/harpy/utils/_io.py +48 -0
  100. harpy_analysis-0.0.1/src/harpy/utils/_keys.py +19 -0
  101. harpy_analysis-0.0.1/src/harpy/utils/_query.py +193 -0
  102. harpy_analysis-0.0.1/src/harpy/utils/_transformations.py +41 -0
  103. harpy_analysis-0.0.1/src/harpy/utils/pylogger.py +36 -0
  104. harpy_analysis-0.0.1/src/harpy/utils/utils.py +146 -0
  105. harpy_analysis-0.0.1/src/harpy/widgets/__init__.py +19 -0
  106. harpy_analysis-0.0.1/src/harpy/widgets/_allocate_widget.py +185 -0
  107. harpy_analysis-0.0.1/src/harpy/widgets/_annotate_widget.py +115 -0
  108. harpy_analysis-0.0.1/src/harpy/widgets/_clean_widget.py +167 -0
  109. harpy_analysis-0.0.1/src/harpy/widgets/_load_widget.py +136 -0
  110. harpy_analysis-0.0.1/src/harpy/widgets/_segment_widget.py +195 -0
  111. harpy_analysis-0.0.1/src/harpy/widgets/_wizard_widget.py +209 -0
  112. harpy_analysis-0.0.1/src/harpy_analysis.egg-info/PKG-INFO +146 -0
  113. harpy_analysis-0.0.1/src/harpy_analysis.egg-info/SOURCES.txt +116 -0
  114. harpy_analysis-0.0.1/src/harpy_analysis.egg-info/dependency_links.txt +1 -0
  115. harpy_analysis-0.0.1/src/harpy_analysis.egg-info/entry_points.txt +5 -0
  116. harpy_analysis-0.0.1/src/harpy_analysis.egg-info/requires.txt +70 -0
  117. harpy_analysis-0.0.1/src/harpy_analysis.egg-info/top_level.txt +1 -0
@@ -0,0 +1,35 @@
1
+ Academic Non-commercial Software License Agreement
2
+
3
+ The Licensed Software is developed by and on behalf of the Laboratory of Data Mining and Modelling for Biomedicine of VIB-UGent and is owned by VIB vzw, located at Suzanne Tassierstraat 1, B-9052 Zwijnaarde, Belgium (hereinafter referred to as "VIB"). By downloading or installing the Licensed Software, the user agrees with the terms and conditions below.
4
+
5
+ Definitions
6
+ “Licensed Software” shall mean Harpy as available on GitHub.
7
+ "Effective Date" shall mean the date on which you download or install Harpy (as available on GitHub) on your system and which provide you access to the Harpy tool.
8
+ “Commercial Purposes” shall include (1) the use of Licensed Software to provide a service, information or data that is directly or indirectly conveyed to any third party against compensation, (2) any type of transfer of the Licensed Software for compensation, and (3) any other use of Licensed Software that supports commercial entities.
9
+
10
+ License
11
+ 1. Licensed Software is the work of the Saeys lab. The copyright in Licensed Software is owned by VIB.
12
+ 2. Subject to the terms and conditions of this Agreement, VIB hereby grants and the user accepts a non-exclusive, non-transferable license to use the Licensed Software for strictly internal academic research use only, on your own behalf or on behalf of your institution, and not for Commercial Purposes.
13
+ 3. The user confirms to be an academic user. For academic users, there is no license fee.
14
+ 4. This license does not entitle the user to receive from VIB hard-copy documentation, technical support, telephone assistance, or enhancements or updates to the Licensed Software, and nothing contained herein shall be interpreted as to require VIB, its faculty, employees or students to provide maintenance, installation services, debugging, consultation or end-user support of any kind.
15
+ 5. The title and copyright to Licensed Software and any associated programs and documentation shall remain with VIB. The user agrees to preserve the same.
16
+ 6. The user agrees not to make any copies of Licensed Software except for use in the user’s laboratory, without VIB’s prior written consent. The user agrees to place the appropriate copyright notice on any such copies.
17
+ 7. The user shall not distribute Licensed Software to other laboratories within user’s institution. The user shall not transfer Licensed Software to another location or person outside of user’s institution without VIB’s prior and written permission.
18
+ 8. The user shall not market or otherwise benefit commercially from any product utilizing any portion of Licensed Software, nor any derivative works of Licensed Software, without first entering into a separate commercial license with VIB.
19
+ 9. Except as otherwise expressly permitted in this Agreement, the user must not (i) modify or create any derivative works of the Licensed Software or documentation, including customization, translation or localization; (ii) decompile, disassemble, reverse engineer, or otherwise attempt to derive the source code for the Licensed Software; (iii) remove or alter any trademark, logo, copyright or other proprietary notices, legends, symbols or labels in the Licensed Software.
20
+ 10. The user acknowledges that the Licensed Software is proprietary to VIB. The software code shall be treated as trade secrets and confidential information of VIB, and the user agrees to use all reasonable efforts to hold the same in confidence. The user’s obligation for confidentiality shall not extend to any information which (i) is or becomes generally available to the public, (ii) is already known to or subsequently disclosed by third parties to the user and at its free disposal, or (iii) is independently developed by the user or its affiliates without the use of the confidential information disclosed by VIB, or (iv) is required by law or legal process to be disclosed.
21
+ 11. The user acknowledges that Licensed Software is a research tool and provided free of charge, it is only provided “as is”. VIB makes no representations or warranties of any type whatsoever, express or implied, regarding the Licensed Software. VIB expressly disclaims all representations and warranties regarding the Licensed Software, including but not limited to any representations or warranties of merchantability or fitness for any particular application or that the use of the Licensed Software will not infringe any patents, copyrights or trademarks or other rights of third parties, or any warranty that the rights and licenses granted hereunder comprise all the rights and licenses necessary or desirable to use the Licensed Software for internal non-commercial research purposes as permitted by this Agreement. The entire risk as to the quality and performance of the Licensed Software is borne by the user.
22
+ 12. VIB shall not be responsible for losses of any kind resulting from the use of Licensed Software, and can in no way provide compensation for any losses sustained, including but not limited to, any obligation, liability, right, claim or remedy for tort, or for any actual or alleged infringement of patents, copyrights, trade secrets, or similar rights of third parties, nor any business expense, machine downtime or damages caused by any deficiency, defect or error in Licensed Software or mal-function thereof, nor any incidental or consequential damages, however caused.
23
+ 13. The user will indemnify, defend and hold harmless VIB, its directors, officers, employees and agents from and against all liability, losses, damages and expenses (including attorney’s fees and costs) arising out of any claims, demands, actions or other proceedings made or instituted by any third party against any of them and arising out of or relating to any breach of this Agreement by the user, or any use of the Licensed Software by the user, except insofar as such claims or liability result from VIB’s gross negligence or willful misconduct.
24
+ 14. This Agreement and the license rights granted herein shall become effective as of the date the user downloaded the Licensed Software and shall continue in full force until the user deletes the Licensed Software and any and all related files from the user’s computing system, unless terminated in accordance with this Section. Upon one party's breach of any agreement, covenant, or representation made in this Agreement, the agreement will automatically end thirty (30) days after such breach. Either party shall have the right, at any time, to terminate this Agreement without cause by written notice to the other party specifying the date of termination. Upon termination, the user shall destroy all full and partial copies of the Licensed Software. The user shall forward written notice to VIB that all programs containing Licensed Software have been deleted from all computer libraries and storage or memory devices and are no longer stored therein.
25
+ 15. This Agreement shall be construed in accordance with the laws of Belgium. The courts of Belgium shall have exclusive jurisdiction.
26
+ 16. The parties agree that this Agreement is the complete and exclusive agreement among the parties and supersedes all proposals and prior agreements whether written or oral, and all other communications among the parties relating to the subject matter of this Agreement. This Agreement cannot be modified except in writing and signed by both parties. Failure by either party at any time to enforce any of the provisions of this Agreement shall not constitute a waiver by such party of such provision nor in any way affect the validity of this Agreement.
27
+ 17. The invalidity of singular provisions does not affect the validity of the entire understanding. The parties are obligated, however, to replace the invalid provisions by a regulation, which comes closest to the economic intent of the invalid provision. The same shall apply mutatis mutandis in case of a gap.
28
+
29
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35
+ THE SOFTWARE.
@@ -0,0 +1,5 @@
1
+ include LICENSE
2
+ include README.md
3
+
4
+ recursive-exclude * __pycache__
5
+ recursive-exclude * *.py[co]
@@ -0,0 +1,146 @@
1
+ Metadata-Version: 2.1
2
+ Name: harpy-analysis
3
+ Version: 0.0.1
4
+ Summary: single-cell spatial proteomics analysis that makes you happy
5
+ Home-page: https://github.com/saeyslab/harpy
6
+ Author: dambi
7
+ License: BSD-3-Clause
8
+ Project-URL: Bug Tracker, https://github.com/saeyslab/harpy/issues
9
+ Project-URL: Documentation, https://github.com/saeyslab/harpy#README.md
10
+ Project-URL: Source Code, https://github.com/saeyslab/harpy
11
+ Project-URL: User Support, https://github.com/saeyslab/harpy/issues
12
+ Classifier: Development Status :: 2 - Pre-Alpha
13
+ Classifier: Framework :: napari
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: BSD License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3 :: Only
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Topic :: Software Development :: Testing
25
+ Requires-Python: >=3.8
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: spatialdata>=0.2.0
29
+ Requires-Dist: ome-zarr>=0.9.0
30
+ Requires-Dist: squidpy>=1.5.0
31
+ Requires-Dist: scanpy>=1.9.1
32
+ Requires-Dist: voronoi-diagram-for-polygons>=0.1.6
33
+ Requires-Dist: rasterio>=1.3.2
34
+ Requires-Dist: seaborn>=0.12.2
35
+ Requires-Dist: leidenalg>=0.9.1
36
+ Requires-Dist: geopandas>=1.0.1
37
+ Requires-Dist: omegaconf==2.3.0
38
+ Requires-Dist: nptyping
39
+ Requires-Dist: magicgui
40
+ Requires-Dist: pyrootutils
41
+ Requires-Dist: universal_pathlib
42
+ Requires-Dist: datasets
43
+ Requires-Dist: crick
44
+ Requires-Dist: spatialdata_io
45
+ Provides-Extra: plugin
46
+ Requires-Dist: napari>=0.4.18; extra == "plugin"
47
+ Requires-Dist: hydra-core>=1.2.0; extra == "plugin"
48
+ Requires-Dist: hydra-colorlog>=1.2.0; extra == "plugin"
49
+ Requires-Dist: napari-spatialdata>=0.2.6; extra == "plugin"
50
+ Requires-Dist: cellpose>=2.2.3; extra == "plugin"
51
+ Requires-Dist: pytest-qt; extra == "plugin"
52
+ Provides-Extra: testing
53
+ Requires-Dist: hydra-core>=1.2.0; extra == "testing"
54
+ Requires-Dist: hydra-colorlog>=1.2.0; extra == "testing"
55
+ Requires-Dist: cellpose>=2.2.3; extra == "testing"
56
+ Requires-Dist: datasets; extra == "testing"
57
+ Requires-Dist: jax>=0.4.6; extra == "testing"
58
+ Requires-Dist: jaxlib>=0.4.6; extra == "testing"
59
+ Requires-Dist: basicpy>=1.0.0; extra == "testing"
60
+ Requires-Dist: opencv-python; extra == "testing"
61
+ Requires-Dist: pytest; extra == "testing"
62
+ Requires-Dist: pytest-cov; extra == "testing"
63
+ Requires-Dist: tox; extra == "testing"
64
+ Requires-Dist: nbconvert; extra == "testing"
65
+ Provides-Extra: cli
66
+ Requires-Dist: hydra-core>=1.2.0; extra == "cli"
67
+ Requires-Dist: hydra-colorlog>=1.2.0; extra == "cli"
68
+ Requires-Dist: submitit>=1.4.5; extra == "cli"
69
+ Requires-Dist: hydra-submitit-launcher>=1.2.0; extra == "cli"
70
+ Provides-Extra: docs
71
+ Requires-Dist: sphinx>=4.5; extra == "docs"
72
+ Requires-Dist: sphinx-book-theme>=1.0.0; extra == "docs"
73
+ Requires-Dist: sphinx_rtd_theme; extra == "docs"
74
+ Requires-Dist: myst-nb; extra == "docs"
75
+ Requires-Dist: sphinxcontrib-bibtex>=1.0.0; extra == "docs"
76
+ Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
77
+ Requires-Dist: sphinx-design; extra == "docs"
78
+ Requires-Dist: ipython>=8.6.0; extra == "docs"
79
+ Requires-Dist: sphinx-copybutton; extra == "docs"
80
+ Provides-Extra: clustering
81
+ Requires-Dist: scikit-learn>=1.3.1; extra == "clustering"
82
+ Requires-Dist: flowsom; extra == "clustering"
83
+ Requires-Dist: datasets; extra == "clustering"
84
+ Requires-Dist: textalloc; extra == "clustering"
85
+ Requires-Dist: joypy; extra == "clustering"
86
+ Requires-Dist: bokeh; extra == "clustering"
87
+ Requires-Dist: spatialdata-plot>=0.2.0; extra == "clustering"
88
+ Provides-Extra: instanseg
89
+ Requires-Dist: instanseg; extra == "instanseg"
90
+ Requires-Dist: torchvision; extra == "instanseg"
91
+ Requires-Dist: monai; extra == "instanseg"
92
+
93
+ <!-- These badges won't work while the GitHub repo is private:
94
+ [![License BSD-3](https://img.shields.io/pypi/l/harpy.svg?color=green)](https://github.com/saeyslab/harpy/raw/main/LICENSE)
95
+ [![PyPI](https://img.shields.io/pypi/v/harpy.svg?color=green)](https://pypi.org/project/harpy)
96
+ [![tests](https://github.com/saeyslab/harpy/workflows/tests/badge.svg)](https://github.com/saeyslab/harpy/actions)
97
+ [![Python Version](https://img.shields.io/pypi/pyversions/harpy.svg?color=green)](https://python.org)
98
+ [![codecov](https://codecov.io/gh/saeyslab/harpy/graph/badge.svg?token=7UXMDWVYFZ)](https://codecov.io/gh/saeyslab/harpy)
99
+ [![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/harpy)](https://napari-hub.org/plugins/harpy)
100
+ -->
101
+
102
+ # **Harpy: single-cell spatial proteomics analysis that makes you happy** <img src="./docs/_static/img/logo.png" align ="right" alt="" width ="150"/>
103
+
104
+ ![Build Status](https://github.com//saeyslab/harpy/actions/workflows/build.yaml/badge.svg)
105
+ [![documentation badge](https://readthedocs.org/projects/harpy/badge/?version=latest)](https://harpy.readthedocs.io/en/latest/)
106
+
107
+ Note: This package is still under very active development.
108
+
109
+ ## Installation
110
+
111
+ Check out the docs for [installation instructions](docs/installation.md).
112
+
113
+ ## Tutorials
114
+
115
+ Tutorials are available [here](https://harpy.readthedocs.io/en/latest/).
116
+
117
+ ## Usage
118
+
119
+ [Learn](docs/usage.md) how Harpy can be integrated into your workflow in different ways.
120
+
121
+ ## Contributing
122
+
123
+ See [here](docs/contributing.md) for info on how to contribute to Harpy.
124
+
125
+ ## References
126
+
127
+ - https://github.com/ashleve/lightning-hydra-template
128
+
129
+ ## License
130
+
131
+ Check license under license. Harpy is free for academic usage.
132
+ For commercial usage, please contact Saeyslab.
133
+
134
+ ## Issues
135
+
136
+ If you encounter any problems, please [file an issue] along with a detailed description.
137
+
138
+ [napari]: https://github.com/napari/napari
139
+ [Cookiecutter]: https://github.com/audreyr/cookiecutter
140
+ [BSD-3]: http://opensource.org/licenses/BSD-3-Clause
141
+ [cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin
142
+ [file an issue]: https://github.com/saeyslab/harpy/issues
143
+ [napari]: https://github.com/napari/napari
144
+ [tox]: https://tox.readthedocs.io/en/latest/
145
+ [pip]: https://pypi.org/project/pip/
146
+ [PyPI]: https://pypi.org/
@@ -0,0 +1,54 @@
1
+ <!-- These badges won't work while the GitHub repo is private:
2
+ [![License BSD-3](https://img.shields.io/pypi/l/harpy.svg?color=green)](https://github.com/saeyslab/harpy/raw/main/LICENSE)
3
+ [![PyPI](https://img.shields.io/pypi/v/harpy.svg?color=green)](https://pypi.org/project/harpy)
4
+ [![tests](https://github.com/saeyslab/harpy/workflows/tests/badge.svg)](https://github.com/saeyslab/harpy/actions)
5
+ [![Python Version](https://img.shields.io/pypi/pyversions/harpy.svg?color=green)](https://python.org)
6
+ [![codecov](https://codecov.io/gh/saeyslab/harpy/graph/badge.svg?token=7UXMDWVYFZ)](https://codecov.io/gh/saeyslab/harpy)
7
+ [![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/harpy)](https://napari-hub.org/plugins/harpy)
8
+ -->
9
+
10
+ # **Harpy: single-cell spatial proteomics analysis that makes you happy** <img src="./docs/_static/img/logo.png" align ="right" alt="" width ="150"/>
11
+
12
+ ![Build Status](https://github.com//saeyslab/harpy/actions/workflows/build.yaml/badge.svg)
13
+ [![documentation badge](https://readthedocs.org/projects/harpy/badge/?version=latest)](https://harpy.readthedocs.io/en/latest/)
14
+
15
+ Note: This package is still under very active development.
16
+
17
+ ## Installation
18
+
19
+ Check out the docs for [installation instructions](docs/installation.md).
20
+
21
+ ## Tutorials
22
+
23
+ Tutorials are available [here](https://harpy.readthedocs.io/en/latest/).
24
+
25
+ ## Usage
26
+
27
+ [Learn](docs/usage.md) how Harpy can be integrated into your workflow in different ways.
28
+
29
+ ## Contributing
30
+
31
+ See [here](docs/contributing.md) for info on how to contribute to Harpy.
32
+
33
+ ## References
34
+
35
+ - https://github.com/ashleve/lightning-hydra-template
36
+
37
+ ## License
38
+
39
+ Check license under license. Harpy is free for academic usage.
40
+ For commercial usage, please contact Saeyslab.
41
+
42
+ ## Issues
43
+
44
+ If you encounter any problems, please [file an issue] along with a detailed description.
45
+
46
+ [napari]: https://github.com/napari/napari
47
+ [Cookiecutter]: https://github.com/audreyr/cookiecutter
48
+ [BSD-3]: http://opensource.org/licenses/BSD-3-Clause
49
+ [cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin
50
+ [file an issue]: https://github.com/saeyslab/harpy/issues
51
+ [napari]: https://github.com/napari/napari
52
+ [tox]: https://tox.readthedocs.io/en/latest/
53
+ [pip]: https://pypi.org/project/pip/
54
+ [PyPI]: https://pypi.org/
@@ -0,0 +1,65 @@
1
+ [build-system]
2
+ requires = ["setuptools>=42.0.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ # pyproject.toml file content
6
+ [tool.coverage.run]
7
+ omit = ["src/harpy/_tests/*", "experiments/*", "src/harpy/widgets/*", "docs/*" ]
8
+
9
+ [tool.ruff]
10
+ src = ["src"]
11
+ line-length = 120
12
+ select = [
13
+ "F", # Errors detected by Pyflakes
14
+ "E", # Error detected by Pycodestyle
15
+ "W", # Warning detected by Pycodestyle
16
+ "I", # isort
17
+ "D", # pydocstyle
18
+ "B", # flake8-bugbear
19
+ "TID", # flake8-tidy-imports
20
+ "C4", # flake8-comprehensions
21
+ "BLE", # flake8-blind-except
22
+ "UP", # pyupgrade
23
+ "RUF100", # Report unused noqa directives
24
+ ]
25
+ ignore = [
26
+ # line too long -> we accept long comment lines; formatter gets rid of long code lines
27
+ "E501",
28
+ # Do not assign a lambda expression, use a def -> lambda expression assignments are convenient
29
+ "E731",
30
+ # allow I, O, l as variable names -> I is the identity matrix
31
+ "E741",
32
+ # Missing docstring in public package
33
+ "D104",
34
+ # Missing docstring in public module
35
+ "D100",
36
+ # Missing docstring in __init__
37
+ "D107",
38
+ # Errors from function calls in argument defaults. These are fine when the result is immutable.
39
+ "B008",
40
+ # __magic__ methods are are often self-explanatory, allow missing docstrings
41
+ "D105",
42
+ # first line should end with a period [Bug: doesn't work with single-line docstrings]
43
+ "D400",
44
+ # First line should be in imperative mood; try rephrasing
45
+ "D401",
46
+ ## Disable one in each pair of mutually incompatible rules
47
+ # We don’t want a blank line before a class docstring
48
+ "D203",
49
+ # We want docstrings to start immediately after the opening triple quote
50
+ "D213",
51
+ ]
52
+ extend-include = ["*.ipynb"]
53
+
54
+ [tool.ruff.pydocstyle]
55
+ convention = "numpy"
56
+
57
+ [tool.ruff.per-file-ignores]
58
+ "docs/*" = ["I"]
59
+ "**/_tests/*" = ["D"]
60
+ "*/__init__.py" = ["F401"]
61
+ "**/test_data/*" = ["ALL"]
62
+
63
+
64
+ [tool.pytest.ini_options]
65
+ testpaths = ['src/harpy/_tests']
@@ -0,0 +1,127 @@
1
+ [metadata]
2
+ name = harpy-analysis
3
+ author = dambi
4
+ version = 0.0.1
5
+ description = single-cell spatial proteomics analysis that makes you happy
6
+ long_description = file: README.md
7
+ long_description_content_type = text/markdown
8
+ url = https://github.com/saeyslab/harpy
9
+ license = BSD-3-Clause
10
+ license_file = LICENSE
11
+ license_files = LICENSE
12
+ classifiers =
13
+ Development Status :: 2 - Pre-Alpha
14
+ Framework :: napari
15
+ Intended Audience :: Developers
16
+ License :: OSI Approved :: BSD License
17
+ Operating System :: OS Independent
18
+ Programming Language :: Python
19
+ Programming Language :: Python :: 3
20
+ Programming Language :: Python :: 3 :: Only
21
+ Programming Language :: Python :: 3.9
22
+ Programming Language :: Python :: 3.10
23
+ Programming Language :: Python :: 3.11
24
+ Programming Language :: Python :: 3.12
25
+ Topic :: Software Development :: Testing
26
+ project_urls =
27
+ Bug Tracker = https://github.com/saeyslab/harpy/issues
28
+ Documentation = https://github.com/saeyslab/harpy#README.md
29
+ Source Code = https://github.com/saeyslab/harpy
30
+ User Support = https://github.com/saeyslab/harpy/issues
31
+
32
+ [options]
33
+ packages = find:
34
+ install_requires =
35
+ spatialdata>=0.2.0
36
+ ome-zarr>=0.9.0
37
+ squidpy>=1.5.0
38
+ scanpy>=1.9.1
39
+ voronoi-diagram-for-polygons>=0.1.6
40
+ rasterio>=1.3.2
41
+ seaborn>=0.12.2
42
+ leidenalg>=0.9.1
43
+ geopandas>=1.0.1
44
+ omegaconf==2.3.0
45
+ nptyping
46
+ magicgui
47
+ pyrootutils
48
+ universal_pathlib
49
+ datasets
50
+ crick
51
+ spatialdata_io
52
+ python_requires = >=3.8
53
+ include_package_data = True
54
+ package_dir =
55
+ =src
56
+
57
+ [options.packages.find]
58
+ where = src
59
+
60
+ [options.entry_points]
61
+ console_scripts =
62
+ harpy = harpy.single:main
63
+ napari.manifest =
64
+ harpy = harpy:napari.yaml
65
+
66
+ [options.extras_require]
67
+ plugin =
68
+ napari>=0.4.18
69
+ hydra-core>=1.2.0
70
+ hydra-colorlog>=1.2.0
71
+ napari-spatialdata>=0.2.6
72
+
73
+ cellpose>=2.2.3
74
+ pytest-qt
75
+ testing =
76
+ hydra-core>=1.2.0
77
+ hydra-colorlog>=1.2.0
78
+ cellpose>=2.2.3
79
+ datasets
80
+ jax>=0.4.6
81
+ jaxlib>=0.4.6
82
+ basicpy>=1.0.0
83
+ opencv-python
84
+ pytest
85
+ pytest-cov
86
+ tox
87
+ nbconvert
88
+ cli =
89
+ hydra-core>=1.2.0
90
+ hydra-colorlog>=1.2.0
91
+ submitit>=1.4.5
92
+ hydra-submitit-launcher>=1.2.0
93
+ docs =
94
+ sphinx>=4.5
95
+ sphinx-book-theme>=1.0.0
96
+ sphinx_rtd_theme
97
+ myst-nb
98
+ sphinxcontrib-bibtex>=1.0.0
99
+ sphinx-autodoc-typehints
100
+ sphinx-design
101
+ ipython>=8.6.0
102
+ sphinx-copybutton
103
+ clustering =
104
+ scikit-learn>=1.3.1
105
+ flowsom
106
+ datasets
107
+ textalloc
108
+ joypy
109
+ bokeh
110
+ spatialdata-plot>=0.2.0
111
+ instanseg =
112
+ instanseg
113
+ torchvision
114
+ monai
115
+
116
+ [options.package_data]
117
+ * = *.yaml
118
+
119
+ [flake8]
120
+ max-line-length = 88
121
+ select = C,E,F,W,B,B950
122
+ extend-ignore = E203, E501
123
+
124
+ [egg_info]
125
+ tag_build =
126
+ tag_date = 0
127
+
@@ -0,0 +1,23 @@
1
+ """Define package version"""
2
+
3
+ __version__ = "0.0.1"
4
+
5
+ import os
6
+
7
+ os.environ["USE_PYGEOS"] = "0"
8
+
9
+ try:
10
+ import rasterio
11
+ except ImportError:
12
+ pass
13
+
14
+ from . import ( # noqa: E402
15
+ datasets,
16
+ io,
17
+ utils,
18
+ )
19
+ from . import image as im # noqa: E402
20
+ from . import plot as pl # noqa: E402
21
+ from . import points as pt # noqa: E402
22
+ from . import shape as sh # noqa: E402
23
+ from . import table as tb # noqa: E402
File without changes
@@ -0,0 +1,136 @@
1
+ import os
2
+
3
+ import pyrootutils
4
+ import pytest
5
+ from hydra import compose, initialize
6
+ from hydra.core.global_hydra import GlobalHydra
7
+ from hydra.core.hydra_config import HydraConfig
8
+ from omegaconf import DictConfig
9
+ from spatialdata import read_zarr
10
+ from spatialdata.datasets import blobs
11
+
12
+ from harpy.datasets.cluster_blobs import cluster_blobs
13
+ from harpy.datasets.pixie_example import pixie_example
14
+ from harpy.datasets.proteomics import mibi_example
15
+ from harpy.datasets.registry import get_registry
16
+ from harpy.datasets.transcriptomics import (
17
+ resolve_example,
18
+ resolve_example_multiple_coordinate_systems,
19
+ visium_hd_example_custom_binning,
20
+ )
21
+
22
+
23
+ @pytest.fixture(scope="function")
24
+ def cfg_pipeline_global(path_dataset_markers) -> DictConfig:
25
+ # Expecting pytest to be run from the root dir. config_path should be relative to this file
26
+ # The data_dir needs to be overwritten to point to the test data
27
+
28
+ root = str(pyrootutils.setup_root(os.getcwd(), dotenv=True, pythonpath=True))
29
+
30
+ registry = get_registry()
31
+ dataset_image = registry.fetch("transcriptomics/resolve/mouse/20272_slide1_A1-1_DAPI_4288_2144.tiff")
32
+ dataset_coords = registry.fetch("transcriptomics/resolve/mouse/20272_slide1_A1-1_results_4288_2144.txt")
33
+
34
+ with initialize(version_base="1.2", config_path="../configs"):
35
+ cfg = compose(
36
+ config_name="pipeline",
37
+ overrides=[
38
+ f"paths.data_dir={root}",
39
+ f"dataset.data_dir={root}",
40
+ f"dataset.image={dataset_image}",
41
+ f"dataset.coords={dataset_coords}",
42
+ f"dataset.markers={path_dataset_markers}",
43
+ "allocate.delimiter='\t'",
44
+ "allocate.column_x=0",
45
+ "allocate.column_y=1",
46
+ "allocate.column_gene=3",
47
+ "segmentation=cellpose",
48
+ ],
49
+ return_hydra_config=True,
50
+ )
51
+ HydraConfig().set_config(cfg)
52
+
53
+ return cfg
54
+
55
+
56
+ # this is called by each test which uses `cfg_pipeline` arg
57
+ # each test generates its own temporary logging path
58
+ @pytest.fixture(scope="function")
59
+ def cfg_pipeline(cfg_pipeline_global, tmp_path):
60
+ cfg = cfg_pipeline_global.copy()
61
+
62
+ cfg.paths.output_dir = str(tmp_path)
63
+
64
+ yield cfg
65
+
66
+ GlobalHydra.instance().clear()
67
+
68
+
69
+ @pytest.fixture
70
+ def sdata_multi_c(tmpdir):
71
+ sdata = mibi_example()
72
+ # backing store for specific unit test
73
+ sdata.write(os.path.join(tmpdir, "sdata.zarr"))
74
+ sdata = read_zarr(os.path.join(tmpdir, "sdata.zarr"))
75
+ yield sdata
76
+
77
+
78
+ @pytest.fixture
79
+ def sdata_multi_c_no_backed():
80
+ sdata = mibi_example()
81
+ yield sdata
82
+
83
+
84
+ @pytest.fixture
85
+ def sdata_transcripts(tmpdir):
86
+ sdata = resolve_example()
87
+ # backing store for specific unit test
88
+ sdata.write(os.path.join(tmpdir, "sdata_transcriptomics.zarr"))
89
+ sdata = read_zarr(os.path.join(tmpdir, "sdata_transcriptomics.zarr"))
90
+ yield sdata
91
+
92
+
93
+ @pytest.fixture
94
+ def sdata_transcripts_no_backed():
95
+ sdata = resolve_example()
96
+ yield sdata
97
+
98
+
99
+ @pytest.fixture
100
+ def sdata_transcripts_mul_coord(tmpdir):
101
+ sdata = resolve_example_multiple_coordinate_systems()
102
+ # backing store for specific unit test
103
+ sdata.write(os.path.join(tmpdir, "sdata_transcriptomics.zarr"))
104
+ sdata = read_zarr(os.path.join(tmpdir, "sdata_transcriptomics.zarr"))
105
+ yield sdata
106
+
107
+
108
+ @pytest.fixture
109
+ def sdata_bin():
110
+ sdata = visium_hd_example_custom_binning()
111
+ yield sdata
112
+
113
+
114
+ @pytest.fixture
115
+ def sdata_blobs():
116
+ sdata = cluster_blobs(
117
+ shape=(512, 512), n_cell_types=10, n_cells=100, noise_level_channels=1.2, noise_level_nuclei=1.2, seed=10
118
+ )
119
+ yield sdata
120
+
121
+
122
+ @pytest.fixture
123
+ def sdata():
124
+ yield blobs(length=1000, n_channels=3)
125
+
126
+
127
+ @pytest.fixture
128
+ def sdata_pixie():
129
+ sdata = pixie_example()
130
+ yield sdata
131
+
132
+
133
+ @pytest.fixture
134
+ def path_dataset_markers():
135
+ registry = get_registry()
136
+ return registry.fetch("transcriptomics/resolve/mouse/dummy_markers.csv")