spatialdata-io 0.1.6__tar.gz → 0.2.0__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 (82) hide show
  1. spatialdata_io-0.2.0/.github/release.yml +28 -0
  2. spatialdata_io-0.2.0/.github/workflows/prepare_test_data.yaml +52 -0
  3. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/.github/workflows/release.yaml +12 -12
  4. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/.github/workflows/test.yaml +2 -8
  5. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/.pre-commit-config.yaml +10 -10
  6. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/LICENSE +1 -1
  7. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/PKG-INFO +72 -23
  8. spatialdata_io-0.2.0/README.md +126 -0
  9. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/_version.py +9 -4
  10. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/docs/api.md +11 -16
  11. spatialdata_io-0.2.0/docs/changelog.md +4 -0
  12. spatialdata_io-0.2.0/docs/cli.md +9 -0
  13. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/docs/conf.py +1 -0
  14. spatialdata_io-0.2.0/docs/contributing.md +3 -0
  15. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/docs/index.md +1 -1
  16. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/pyproject.toml +3 -0
  17. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/__init__.py +33 -9
  18. spatialdata_io-0.2.0/src/spatialdata_io/__main__.py +647 -0
  19. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/_constants/_constants.py +11 -5
  20. spatialdata_io-0.2.0/src/spatialdata_io/converters/generic_to_zarr.py +84 -0
  21. spatialdata_io-0.2.0/src/spatialdata_io/experimental/__init__.py +18 -0
  22. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/readers/_utils/_utils.py +48 -0
  23. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/readers/cosmx.py +1 -9
  24. spatialdata_io-0.2.0/src/spatialdata_io/readers/generic.py +80 -0
  25. spatialdata_io-0.2.0/src/spatialdata_io/readers/macsima.py +488 -0
  26. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/readers/merscope.py +4 -2
  27. spatialdata_io-0.2.0/src/spatialdata_io/readers/seqfish.py +251 -0
  28. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/readers/steinbock.py +11 -0
  29. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/readers/visium.py +17 -7
  30. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/readers/visium_hd.py +204 -46
  31. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/readers/xenium.py +31 -12
  32. spatialdata_io-0.2.0/tests/_utils.py +31 -0
  33. spatialdata_io-0.2.0/tests/conftest.py +7 -0
  34. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/tests/converters/test_legacy_anndata.py +4 -1
  35. spatialdata_io-0.2.0/tests/test_generic.py +116 -0
  36. spatialdata_io-0.2.0/tests/test_macsima.py +231 -0
  37. spatialdata_io-0.2.0/tests/test_seqfish.py +53 -0
  38. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/tests/test_xenium.py +30 -8
  39. spatialdata_io-0.1.6/.github/workflows/build.yaml +0 -23
  40. spatialdata_io-0.1.6/.github/workflows/prepare_test_data.yaml +0 -35
  41. spatialdata_io-0.1.6/CHANGELOG.md +0 -142
  42. spatialdata_io-0.1.6/README.md +0 -81
  43. spatialdata_io-0.1.6/docs/changelog.md +0 -3
  44. spatialdata_io-0.1.6/docs/contributing.md +0 -197
  45. spatialdata_io-0.1.6/docs/template_usage.md +0 -322
  46. spatialdata_io-0.1.6/src/spatialdata_io/experimental/__init__.py +0 -7
  47. spatialdata_io-0.1.6/src/spatialdata_io/readers/seqfish.py +0 -190
  48. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/.bumpversion.cfg +0 -0
  49. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/.codecov.yaml +0 -0
  50. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/.editorconfig +0 -0
  51. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/.flake8 +0 -0
  52. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/.github/codecov.yml +0 -0
  53. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/.gitignore +0 -0
  54. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/.mypy.ini +0 -0
  55. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/.readthedocs.yaml +0 -0
  56. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/docs/Makefile +0 -0
  57. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/docs/_static/.gitkeep +0 -0
  58. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/docs/_templates/.gitkeep +0 -0
  59. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/docs/_templates/autosummary/class.rst +0 -0
  60. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/docs/extensions/.gitkeep +0 -0
  61. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/docs/extensions/typed_returns.py +0 -0
  62. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/docs/make.bat +0 -0
  63. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/docs/references.bib +0 -0
  64. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/docs/references.md +0 -0
  65. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/_constants/__init__.py +0 -0
  66. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/_constants/_enum.py +0 -0
  67. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/_docs.py +0 -0
  68. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/_utils.py +0 -0
  69. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/converters/__init__.py +0 -0
  70. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/converters/legacy_anndata.py +0 -0
  71. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/readers/__init__.py +0 -0
  72. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/readers/_utils/__init__.py +0 -0
  73. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/readers/_utils/_read_10x_h5.py +0 -0
  74. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/readers/codex.py +0 -0
  75. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/readers/curio.py +0 -0
  76. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/readers/dbit.py +0 -0
  77. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/readers/iss.py +0 -0
  78. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/readers/mcmicro.py +0 -0
  79. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/src/spatialdata_io/readers/stereoseq.py +0 -0
  80. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/tests/__init__.py +0 -0
  81. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/tests/converters/__init__.py +0 -0
  82. {spatialdata_io-0.1.6 → spatialdata_io-0.2.0}/tests/test_basic.py +0 -0
@@ -0,0 +1,28 @@
1
+ changelog:
2
+ exclude:
3
+ labels:
4
+ - release-ignore
5
+ authors:
6
+ - pre-commit-ci
7
+ categories:
8
+ - title: Added
9
+ labels:
10
+ - "release-added"
11
+ - title: Changed
12
+ labels:
13
+ - "release-changed"
14
+ - title: Deprecated
15
+ labels:
16
+ - "release-deprecated"
17
+ - title: Removed
18
+ labels:
19
+ - "release-removed"
20
+ - title: Fixed
21
+ labels:
22
+ - "release-fixed"
23
+ - title: Security
24
+ labels:
25
+ - "release-security"
26
+ - title: Other Changes
27
+ labels:
28
+ - "*"
@@ -0,0 +1,52 @@
1
+ name: Prepare test data
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "0 0 1 * *" # run once a month to prevent artifact expiration
6
+ workflow_dispatch:
7
+ # uncomment and adjust the branch name if you need to add new datasets to the artifact
8
+ # push:
9
+ # branches:
10
+ # - main
11
+
12
+ jobs:
13
+ prepare-data:
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - uses: actions/checkout@v3
18
+
19
+ - name: Download test datasets
20
+ run: |
21
+ mkdir -p ./data
22
+ cd ./data
23
+
24
+ # 10x Genomics Xenium 2.0.0
25
+ curl -O https://cf.10xgenomics.com/samples/xenium/2.0.0/Xenium_V1_human_Breast_2fov/Xenium_V1_human_Breast_2fov_outs.zip
26
+ curl -O https://cf.10xgenomics.com/samples/xenium/2.0.0/Xenium_V1_human_Lung_2fov/Xenium_V1_human_Lung_2fov_outs.zip
27
+
28
+ # 10x Genomics Xenium 3.0.0 (5K) Mouse ileum, multimodal cell segmentation
29
+ # this file seems to be corrupted; skipping it for now
30
+ # curl -O https://cf.10xgenomics.com/samples/xenium/3.0.0/Xenium_Prime_MultiCellSeg_Mouse_Ileum_tiny/Xenium_Prime_MultiCellSeg_Mouse_Ileum_tiny.zip
31
+
32
+ # 10x Genomics Xenium 3.0.0 (5K) Mouse ileum, nuclear expansion
33
+ curl -O https://cf.10xgenomics.com/samples/xenium/3.0.0/Xenium_Prime_Mouse_Ileum_tiny/Xenium_Prime_Mouse_Ileum_tiny_outs.zip
34
+
35
+ # Spatial Genomics seqFISH v2
36
+ curl -O https://s3.embl.de/spatialdata/raw_data/seqfish-2-test-dataset.zip
37
+
38
+ - name: Unzip files
39
+ run: |
40
+ cd ./data
41
+ for file in *.zip; do
42
+ dir="${file%.zip}"
43
+ mkdir -p "$dir"
44
+ unzip "$file" -d "$dir"
45
+ rm "$file"
46
+ done
47
+
48
+ - name: Upload artifacts
49
+ uses: actions/upload-artifact@v4
50
+ with:
51
+ name: data
52
+ path: ./data
@@ -5,26 +5,26 @@ on:
5
5
  types: [published]
6
6
 
7
7
  jobs:
8
- release:
9
- # requires that you have put your twine API key in your
10
- # github secrets (see readme for details)
8
+ package_and_release:
11
9
  runs-on: ubuntu-latest
12
- if: contains(github.ref, 'tags')
10
+ if: startsWith(github.ref, 'refs/tags/v')
13
11
  steps:
14
- - name: Checkout code
15
- uses: actions/checkout@v3
16
-
17
- - name: Set up Python 3.10
12
+ - uses: actions/checkout@v3
13
+ - name: Set up Python 3.12
18
14
  uses: actions/setup-python@v4
19
15
  with:
20
- python-version: "3.10"
21
-
16
+ python-version: "3.12"
17
+ cache: pip
18
+ - name: Install build dependencies
19
+ run: python -m pip install --upgrade pip wheel twine build
20
+ - name: Build package
21
+ run: python -m build
22
+ - name: Check package
23
+ run: twine check --strict dist/*.whl
22
24
  - name: Install hatch
23
25
  run: pip install hatch
24
-
25
26
  - name: Build project for distribution
26
27
  run: hatch build
27
-
28
28
  - name: Publish a Python distribution to PyPI
29
29
  uses: pypa/gh-action-pypi-publish@release/v1
30
30
  with:
@@ -37,7 +37,7 @@ jobs:
37
37
  run: |
38
38
  echo "::set-output name=dir::$(pip cache dir)"
39
39
  - name: Restore pip cache
40
- uses: actions/cache@v2
40
+ uses: actions/cache@v3
41
41
  with:
42
42
  path: ${{ steps.pip-cache-dir.outputs.dir }}
43
43
  key: pip-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml') }}
@@ -53,18 +53,12 @@ jobs:
53
53
 
54
54
  - name: Download artifact of test data
55
55
  if: matrix.python == '3.12'
56
- uses: dawidd6/action-download-artifact@v2
56
+ uses: dawidd6/action-download-artifact@v9
57
57
  with:
58
58
  workflow: prepare_test_data.yaml
59
59
  name: data
60
60
  path: ./data
61
61
 
62
- - name: List the data directory
63
- if: matrix.python == '3.12'
64
- run: |
65
- ls -l ./data
66
- pwd
67
-
68
62
  - name: Test
69
63
  env:
70
64
  MPLBACKEND: agg
@@ -7,23 +7,23 @@ default_stages:
7
7
  minimum_pre_commit_version: 2.16.0
8
8
  repos:
9
9
  - repo: https://github.com/psf/black
10
- rev: 24.4.2
10
+ rev: 25.1.0
11
11
  hooks:
12
12
  - id: black
13
- - repo: https://github.com/pre-commit/mirrors-prettier
14
- rev: v4.0.0-alpha.8
13
+ - repo: https://github.com/rbubley/mirrors-prettier
14
+ rev: v3.5.1
15
15
  hooks:
16
16
  - id: prettier
17
17
  - repo: https://github.com/asottile/blacken-docs
18
- rev: 1.18.0
18
+ rev: 1.19.1
19
19
  hooks:
20
20
  - id: blacken-docs
21
21
  - repo: https://github.com/PyCQA/isort
22
- rev: 5.13.2
22
+ rev: 6.0.0
23
23
  hooks:
24
24
  - id: isort
25
25
  - repo: https://github.com/pre-commit/mirrors-mypy
26
- rev: v1.11.0
26
+ rev: v1.15.0
27
27
  hooks:
28
28
  - id: mypy
29
29
  additional_dependencies: [numpy, types-PyYAML]
@@ -40,7 +40,7 @@ repos:
40
40
  - flake8-bugbear
41
41
  - flake8-blind-except
42
42
  - repo: https://github.com/pre-commit/pre-commit-hooks
43
- rev: v4.6.0
43
+ rev: v5.0.0
44
44
  hooks:
45
45
  - id: detect-private-key
46
46
  - id: check-ast
@@ -59,7 +59,7 @@ repos:
59
59
  - --remove-unused-variable
60
60
  - --ignore-init-module-imports
61
61
  - repo: https://github.com/PyCQA/flake8
62
- rev: 7.1.0
62
+ rev: 7.1.2
63
63
  hooks:
64
64
  - id: flake8
65
65
  additional_dependencies:
@@ -70,7 +70,7 @@ repos:
70
70
  - flake8-bugbear
71
71
  - flake8-blind-except
72
72
  - repo: https://github.com/asottile/pyupgrade
73
- rev: v3.17.0
73
+ rev: v3.19.1
74
74
  hooks:
75
75
  - id: pyupgrade
76
76
  args: [--py3-plus, --py310-plus, --keep-runtime-typing]
@@ -84,6 +84,6 @@ repos:
84
84
  language: fail
85
85
  files: '.*\.rej$'
86
86
  - repo: https://github.com/PyCQA/doc8
87
- rev: v1.1.1
87
+ rev: v1.1.2
88
88
  hooks:
89
89
  - id: doc8
@@ -1,6 +1,6 @@
1
1
  BSD 3-Clause License
2
2
 
3
- Copyright (c) 2022, scverse
3
+ Copyright (c) 2022, scverse®
4
4
  All rights reserved.
5
5
 
6
6
  Redistribution and use in source and binary forms, with or without
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: spatialdata-io
3
- Version: 0.1.6
3
+ Version: 0.2.0
4
4
  Summary: SpatialData IO for common techs
5
5
  Project-URL: Documentation, https://spatialdata-io.readthedocs.io/
6
6
  Project-URL: Source, https://github.com/scverse/spatialdata-io
@@ -9,7 +9,7 @@ Author: scverse
9
9
  Maintainer-email: scverse <scverse@scverse.scverse>
10
10
  License: BSD 3-Clause License
11
11
 
12
- Copyright (c) 2022, scverse
12
+ Copyright (c) 2022, scverse®
13
13
  All rights reserved.
14
14
 
15
15
  Redistribution and use in source and binary forms, with or without
@@ -36,13 +36,16 @@ License: BSD 3-Clause License
36
36
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
37
37
  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38
38
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
+ License-File: LICENSE
39
40
  Requires-Python: >=3.10
40
41
  Requires-Dist: anndata
42
+ Requires-Dist: click
41
43
  Requires-Dist: dask-image
42
44
  Requires-Dist: h5py
43
45
  Requires-Dist: imagecodecs
44
46
  Requires-Dist: joblib
45
47
  Requires-Dist: numpy
48
+ Requires-Dist: ome-types
46
49
  Requires-Dist: pyarrow
47
50
  Requires-Dist: readfcs
48
51
  Requires-Dist: scanpy
@@ -57,6 +60,7 @@ Requires-Dist: ipython>=8.6.0; extra == 'doc'
57
60
  Requires-Dist: myst-nb; extra == 'doc'
58
61
  Requires-Dist: sphinx-autodoc-typehints; extra == 'doc'
59
62
  Requires-Dist: sphinx-book-theme>=1.0.0; extra == 'doc'
63
+ Requires-Dist: sphinx-click; extra == 'doc'
60
64
  Requires-Dist: sphinx-copybutton; extra == 'doc'
61
65
  Requires-Dist: sphinx-design; extra == 'doc'
62
66
  Requires-Dist: sphinx>=4.5; extra == 'doc'
@@ -82,26 +86,42 @@ Description-Content-Type: text/markdown
82
86
 
83
87
  This package contains reader functions to load common spatial omics formats into SpatialData. Currently, we provide support for:
84
88
 
85
- - 10x Genomics Visium®
86
- - 10x Genomics Visium HD®
87
- - 10x Genomics Xenium®
88
- - Akoya PhenoCycler® (formerly CODEX®)
89
- - Curio Seeker®
90
- - DBiT-seq
91
- - MCMICRO (output data)
92
- - NanoString CosMx®
93
- - Spatial Genomics GenePS® (seqFISH)
94
- - Steinbock (output data)
95
- - STOmics Stereo-seq®
96
- - Vizgen MERSCOPE® (MERFISH)
89
+ - 10x Genomics Visium®
90
+ - 10x Genomics Visium HD®
91
+ - 10x Genomics Xenium®
92
+ - Akoya PhenoCycler® (formerly CODEX®)
93
+ - Curio Seeker®
94
+ - DBiT-seq
95
+ - MCMICRO (output data)
96
+ - NanoString CosMx®
97
+ - Spatial Genomics GenePS® (seqFISH)
98
+ - Steinbock (output data)
99
+ - STOmics Stereo-seq®
100
+ - Vizgen MERSCOPE® (MERFISH)
101
+ - MACSima® (MACS® iQ View output)
97
102
 
98
103
  Note: all mentioned technologies are registered trademarks of their respective companies.
99
104
 
105
+ ## Known limitations
106
+
107
+ Contributions for addressing the below limitations are very welcomed.
108
+
109
+ - Only Stereo-seq 7.x is supported, 8.x is not currently supported. https://github.com/scverse/spatialdata-io/issues/161
110
+
111
+ ### How to Contribute
112
+
113
+ 1. **Open a GitHub Issue**: Start by opening a new issue or commenting on an existing one in the repository. Clearly describe the problem and your proposed changes to avoid overlapping efforts with others.
114
+
115
+ 2. **Submit a Pull Request (PR)**: Once the issue is discussed, submit a PR to the `spatialdata-io` repository. Ensure your PR includes information about a suitable dataset for testing the reader, ideally no larger than 10 GB. Include clear instructions for accessing the data, preferably with a `curl` or `wget` command for easy downloading.
116
+
117
+ 3. **Optional Enhancements**: To facilitate reproducibility and ease of data access, consider adding a folder in the [spatialdata-sandbox](https://github.com/giovp/spatialdata-sandbox) repository. Include a `download.py` and `to_zarr.py` script (refer to examples in the repository) to enable others to reproduce your reader by simply running these scripts sequentially.
118
+
100
119
  ## Getting started
101
120
 
102
121
  Please refer to the [documentation][link-docs]. In particular, the
103
122
 
104
- - [API documentation][link-api].
123
+ - [API documentation][link-api].
124
+ - [CLI documentation][link-cli].
105
125
 
106
126
  ## Installation
107
127
 
@@ -131,21 +151,50 @@ If you found a bug, please use the [issue tracker][issue-tracker].
131
151
 
132
152
  Technologies that can be read into `SpatialData` objects using third-party libraries:
133
153
 
134
- - METASPACE (MALDI, ...): [metaspace-converter](https://github.com/metaspace2020/metaspace-converter)
135
- - PhenoCycler®: [SOPA](https://github.com/gustaveroussy/sopa)
136
- - MACSima®: [SOPA](https://github.com/gustaveroussy/sopa)
137
- - Hyperion® (Imaging Mass Cytometry): [SOPA](https://github.com/gustaveroussy/sopa)
154
+ - METASPACE (MALDI, ...): [metaspace-converter](https://github.com/metaspace2020/metaspace-converter)
155
+ - PhenoCycler®: [SOPA](https://github.com/gustaveroussy/sopa)
156
+ - MACSima®: [SOPA](https://github.com/gustaveroussy/sopa)
157
+ - Hyperion® (Imaging Mass Cytometry): [SOPA](https://github.com/gustaveroussy/sopa)
138
158
 
139
159
  ## Disclaimer
140
160
 
141
161
  This library is community maintained and is not officially endorsed by the aforementioned spatial technology companies. As such, we cannot offer any warranty of the correctness of the representation. Furthermore, we cannot ensure the correctness of the readers for every data version as the technologies evolve and update their formats. If you find a bug or notice a misrepresentation of the data please report it via our [Bug Tracking System](https://github.com/scverse/spatialdata-io/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen) so that it can be addressed either by the maintainers of this library or by the community.
142
162
 
163
+ ## Solutions to common problems
164
+
165
+ ### Problem: I cannot visualize the data, everything is slow
166
+
167
+ Solution: after parsing the data with `spatialdata-io` readers, you need to write it to Zarr and read it again. Otherwise the performance advantage given by the SpatialData Zarr format will not available.
168
+
169
+ ```python
170
+ from spatialdata_io import xenium
171
+ from spatialdata import read_zarr
172
+
173
+ sdata = xenium("raw_data")
174
+ sdata.write("data.zarr")
175
+ sdata = read_zarr("sdata.zarr")
176
+ ```
177
+
143
178
  ## Citation
144
179
 
145
180
  Marconato, L., Palla, G., Yamauchi, K.A. et al. SpatialData: an open and universal data framework for spatial omics. Nat Methods (2024). https://doi.org/10.1038/s41592-024-02212-x
146
181
 
147
182
  [scverse-discourse]: https://discourse.scverse.org/
148
183
  [issue-tracker]: https://github.com/scverse/spatialdata-io/issues
149
- [changelog]: https://spatialdata.scverse.org/projects/io/en/latest/changelog.html
150
- [link-docs]: https://spatialdata.scverse.org/projects/io/en/latest/
151
- [link-api]: https://spatialdata.scverse.org/projects/io/en/latest/api.html
184
+ [changelog]: https://spatialdata.scverse.org/projects/io/en/stable/changelog.html
185
+ [link-docs]: https://spatialdata.scverse.org/projects/io/en/stable/
186
+ [link-api]: https://spatialdata.scverse.org/projects/io/en/stable/api.html
187
+ [link-cli]: https://spatialdata.scverse.org/projects/io/en/stable/cli.html
188
+ [//]: # "numfocus-fiscal-sponsor-attribution"
189
+
190
+ spatialdata-io is part of the scverse® project ([website](https://scverse.org), [governance](https://scverse.org/about/roles)) and is fiscally sponsored by [NumFOCUS](https://numfocus.org/).
191
+ If you like scverse® and want to support our mission, please consider making a tax-deductible [donation](https://numfocus.org/donate-to-scverse) to help the project pay for developer time, professional services, travel, workshops, and a variety of other needs.
192
+
193
+ <div align="center">
194
+ <a href="https://numfocus.org/project/scverse">
195
+ <img
196
+ src="https://raw.githubusercontent.com/numfocus/templates/master/images/numfocus-logo.png"
197
+ width="200"
198
+ >
199
+ </a>
200
+ </div>
@@ -0,0 +1,126 @@
1
+ ![SpatialData banner](https://github.com/scverse/spatialdata/blob/main/docs/_static/img/spatialdata_horizontal.png?raw=true)
2
+
3
+ # spatialdata-io: convenient readers for loading common formats into SpatialData
4
+
5
+ [![Tests][badge-tests]][link-tests]
6
+ [![Documentation][badge-docs]][link-docs]
7
+ [![DOI](https://zenodo.org/badge/544045123.svg)](https://zenodo.org/badge/latestdoi/544045123)
8
+
9
+ [badge-tests]: https://github.com/scverse/spatialdata-io/actions/workflows/test.yaml/badge.svg
10
+ [link-tests]: https://github.com/scverse/spatialdata-io/actions/workflows/test.yaml
11
+ [badge-docs]: https://img.shields.io/readthedocs/spatialdata-io
12
+
13
+ This package contains reader functions to load common spatial omics formats into SpatialData. Currently, we provide support for:
14
+
15
+ - 10x Genomics Visium®
16
+ - 10x Genomics Visium HD®
17
+ - 10x Genomics Xenium®
18
+ - Akoya PhenoCycler® (formerly CODEX®)
19
+ - Curio Seeker®
20
+ - DBiT-seq
21
+ - MCMICRO (output data)
22
+ - NanoString CosMx®
23
+ - Spatial Genomics GenePS® (seqFISH)
24
+ - Steinbock (output data)
25
+ - STOmics Stereo-seq®
26
+ - Vizgen MERSCOPE® (MERFISH)
27
+ - MACSima® (MACS® iQ View output)
28
+
29
+ Note: all mentioned technologies are registered trademarks of their respective companies.
30
+
31
+ ## Known limitations
32
+
33
+ Contributions for addressing the below limitations are very welcomed.
34
+
35
+ - Only Stereo-seq 7.x is supported, 8.x is not currently supported. https://github.com/scverse/spatialdata-io/issues/161
36
+
37
+ ### How to Contribute
38
+
39
+ 1. **Open a GitHub Issue**: Start by opening a new issue or commenting on an existing one in the repository. Clearly describe the problem and your proposed changes to avoid overlapping efforts with others.
40
+
41
+ 2. **Submit a Pull Request (PR)**: Once the issue is discussed, submit a PR to the `spatialdata-io` repository. Ensure your PR includes information about a suitable dataset for testing the reader, ideally no larger than 10 GB. Include clear instructions for accessing the data, preferably with a `curl` or `wget` command for easy downloading.
42
+
43
+ 3. **Optional Enhancements**: To facilitate reproducibility and ease of data access, consider adding a folder in the [spatialdata-sandbox](https://github.com/giovp/spatialdata-sandbox) repository. Include a `download.py` and `to_zarr.py` script (refer to examples in the repository) to enable others to reproduce your reader by simply running these scripts sequentially.
44
+
45
+ ## Getting started
46
+
47
+ Please refer to the [documentation][link-docs]. In particular, the
48
+
49
+ - [API documentation][link-api].
50
+ - [CLI documentation][link-cli].
51
+
52
+ ## Installation
53
+
54
+ You need to have Python 3.8 or newer installed on your system. If you don't have
55
+ Python installed, we recommend installing [Miniconda](https://docs.conda.io/en/latest/miniconda.html).
56
+
57
+ There are several alternative options to install spatialdata-io:
58
+
59
+ 1. Install the latest release of `spatialdata-io` from [PyPI](https://pypi.org/project/spatialdata-io/):
60
+
61
+ ```bash
62
+ pip install spatialdata-io
63
+ ```
64
+
65
+ 2. Install the latest development version:
66
+
67
+ ```bash
68
+ pip install git+https://github.com/scverse/spatialdata-io.git@main
69
+ ```
70
+
71
+ ## Contact
72
+
73
+ For questions and help requests, you can reach out in the [scverse discourse][scverse-discourse].
74
+ If you found a bug, please use the [issue tracker][issue-tracker].
75
+
76
+ ## Readers from third-party libraries
77
+
78
+ Technologies that can be read into `SpatialData` objects using third-party libraries:
79
+
80
+ - METASPACE (MALDI, ...): [metaspace-converter](https://github.com/metaspace2020/metaspace-converter)
81
+ - PhenoCycler®: [SOPA](https://github.com/gustaveroussy/sopa)
82
+ - MACSima®: [SOPA](https://github.com/gustaveroussy/sopa)
83
+ - Hyperion® (Imaging Mass Cytometry): [SOPA](https://github.com/gustaveroussy/sopa)
84
+
85
+ ## Disclaimer
86
+
87
+ This library is community maintained and is not officially endorsed by the aforementioned spatial technology companies. As such, we cannot offer any warranty of the correctness of the representation. Furthermore, we cannot ensure the correctness of the readers for every data version as the technologies evolve and update their formats. If you find a bug or notice a misrepresentation of the data please report it via our [Bug Tracking System](https://github.com/scverse/spatialdata-io/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen) so that it can be addressed either by the maintainers of this library or by the community.
88
+
89
+ ## Solutions to common problems
90
+
91
+ ### Problem: I cannot visualize the data, everything is slow
92
+
93
+ Solution: after parsing the data with `spatialdata-io` readers, you need to write it to Zarr and read it again. Otherwise the performance advantage given by the SpatialData Zarr format will not available.
94
+
95
+ ```python
96
+ from spatialdata_io import xenium
97
+ from spatialdata import read_zarr
98
+
99
+ sdata = xenium("raw_data")
100
+ sdata.write("data.zarr")
101
+ sdata = read_zarr("sdata.zarr")
102
+ ```
103
+
104
+ ## Citation
105
+
106
+ Marconato, L., Palla, G., Yamauchi, K.A. et al. SpatialData: an open and universal data framework for spatial omics. Nat Methods (2024). https://doi.org/10.1038/s41592-024-02212-x
107
+
108
+ [scverse-discourse]: https://discourse.scverse.org/
109
+ [issue-tracker]: https://github.com/scverse/spatialdata-io/issues
110
+ [changelog]: https://spatialdata.scverse.org/projects/io/en/stable/changelog.html
111
+ [link-docs]: https://spatialdata.scverse.org/projects/io/en/stable/
112
+ [link-api]: https://spatialdata.scverse.org/projects/io/en/stable/api.html
113
+ [link-cli]: https://spatialdata.scverse.org/projects/io/en/stable/cli.html
114
+ [//]: # "numfocus-fiscal-sponsor-attribution"
115
+
116
+ spatialdata-io is part of the scverse® project ([website](https://scverse.org), [governance](https://scverse.org/about/roles)) and is fiscally sponsored by [NumFOCUS](https://numfocus.org/).
117
+ If you like scverse® and want to support our mission, please consider making a tax-deductible [donation](https://numfocus.org/donate-to-scverse) to help the project pay for developer time, professional services, travel, workshops, and a variety of other needs.
118
+
119
+ <div align="center">
120
+ <a href="https://numfocus.org/project/scverse">
121
+ <img
122
+ src="https://raw.githubusercontent.com/numfocus/templates/master/images/numfocus-logo.png"
123
+ width="200"
124
+ >
125
+ </a>
126
+ </div>
@@ -1,8 +1,13 @@
1
- # file generated by setuptools_scm
1
+ # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
+
4
+ __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5
+
3
6
  TYPE_CHECKING = False
4
7
  if TYPE_CHECKING:
5
- from typing import Tuple, Union
8
+ from typing import Tuple
9
+ from typing import Union
10
+
6
11
  VERSION_TUPLE = Tuple[Union[int, str], ...]
7
12
  else:
8
13
  VERSION_TUPLE = object
@@ -12,5 +17,5 @@ __version__: str
12
17
  __version_tuple__: VERSION_TUPLE
13
18
  version_tuple: VERSION_TUPLE
14
19
 
15
- __version__ = version = '0.1.6'
16
- __version_tuple__ = version_tuple = (0, 1, 6)
20
+ __version__ = version = '0.2.0'
21
+ __version_tuple__ = version_tuple = (0, 2, 0)
@@ -1,5 +1,7 @@
1
1
  # API
2
2
 
3
+ This section documents the Application Programming Interface (API) for the `spatialdata_io` package.
4
+
3
5
  ```{eval-rst}
4
6
  .. module:: spatialdata_io
5
7
  ```
@@ -10,6 +12,8 @@ I/O for the `spatialdata` project.
10
12
 
11
13
  ### Readers
12
14
 
15
+ #### Spatial technologies
16
+
13
17
  ```{eval-rst}
14
18
  .. autosummary::
15
19
  :toctree: generated
@@ -18,6 +22,7 @@ I/O for the `spatialdata` project.
18
22
  cosmx
19
23
  curio
20
24
  dbit
25
+ experimental.iss
21
26
  mcmicro
22
27
  merscope
23
28
  seqfish
@@ -28,15 +33,15 @@ I/O for the `spatialdata` project.
28
33
  xenium
29
34
  ```
30
35
 
31
- ### Experimental readers
36
+ #### Data types
32
37
 
33
38
  ```{eval-rst}
34
- .. currentmodule:: spatialdata_io.experimental
35
-
36
39
  .. autosummary::
37
40
  :toctree: generated
38
41
 
39
- iss
42
+ generic
43
+ image
44
+ geojson
40
45
  ```
41
46
 
42
47
  ### Conversion functions
@@ -47,18 +52,8 @@ I/O for the `spatialdata` project.
47
52
  .. autosummary::
48
53
  :toctree: generated
49
54
 
50
- ```
51
-
52
- ### Experimental conversion functions
53
-
54
- ```{eval-rst}
55
- .. currentmodule:: spatialdata_io.experimental
56
-
57
- .. autosummary::
58
- :toctree: generated
59
-
60
- from_legacy_anndata
61
- to_legacy_anndata
55
+ experimental.from_legacy_anndata
56
+ experimental.to_legacy_anndata
62
57
  ```
63
58
 
64
59
  ### Utility functions
@@ -0,0 +1,4 @@
1
+ # Changelog
2
+
3
+ Please refer directly to the [Releases](https://github.com/scverse/spatialdata-io/releases) section on GitHub, where you can find curated release notes for each release.
4
+ For developers, please consult the [contributing guide](https://github.com/scverse/spatialdata/blob/main/docs/contributing.md), which explains how to keep release notes are up-to-date at each release.
@@ -0,0 +1,9 @@
1
+ # CLI
2
+
3
+ This section documents the Command Line Interface (CLI) for the `spatialdata_io` package.
4
+
5
+ ```{eval-rst}
6
+ .. click:: spatialdata_io.__main__:cli
7
+ :prog: spatialdata_io
8
+ :nested: full
9
+ ```
@@ -57,6 +57,7 @@ extensions = [
57
57
  "sphinx_autodoc_typehints",
58
58
  "sphinx.ext.mathjax",
59
59
  "IPython.sphinxext.ipython_console_highlighting",
60
+ "sphinx_click",
60
61
  *[p.stem for p in (HERE / "extensions").glob("*.py")],
61
62
  ]
62
63
 
@@ -0,0 +1,3 @@
1
+ # Contributing guide
2
+
3
+ Please refer to the [contribution guide from the `spatialdata` repository](https://github.com/scverse/spatialdata/blob/main/docs/contributing.md).
@@ -7,8 +7,8 @@
7
7
  :maxdepth: 1
8
8
 
9
9
  api.md
10
+ cli.md
10
11
  changelog.md
11
- template_usage.md
12
12
  contributing.md
13
13
  references.md
14
14
  ```
@@ -23,6 +23,7 @@ urls.Source = "https://github.com/scverse/spatialdata-io"
23
23
  urls.Home-page = "https://github.com/scverse/spatialdata-io"
24
24
  dependencies = [
25
25
  "anndata",
26
+ "click",
26
27
  "numpy",
27
28
  "scanpy",
28
29
  "spatialdata>=0.2.6",
@@ -34,6 +35,7 @@ dependencies = [
34
35
  "pyarrow",
35
36
  "readfcs",
36
37
  "tifffile>=2023.8.12",
38
+ "ome-types",
37
39
  ]
38
40
 
39
41
  [project.optional-dependencies]
@@ -49,6 +51,7 @@ doc = [
49
51
  "sphinxcontrib-bibtex>=1.0.0",
50
52
  "sphinx-autodoc-typehints",
51
53
  "sphinx-design",
54
+ "sphinx-click",
52
55
  # For notebooks
53
56
  "ipython>=8.6.0",
54
57
  "sphinx-copybutton",