spatialdata-io 0.1.0rc0__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- spatialdata_io-0.1.2/.github/workflows/release.yaml +31 -0
- spatialdata_io-0.1.0rc0/.github/workflows/test_and_deploy.yaml → spatialdata_io-0.1.2/.github/workflows/test.yaml +1 -27
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/.pre-commit-config.yaml +1 -1
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/CHANGELOG.md +17 -4
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/PKG-INFO +10 -8
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/README.md +8 -7
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/_version.py +2 -2
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/docs/api.md +6 -5
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/docs/conf.py +2 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/pyproject.toml +1 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/__init__.py +2 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/_constants/_constants.py +74 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/converters/legacy_anndata.py +3 -3
- spatialdata_io-0.1.2/src/spatialdata_io/readers/visium_hd.py +370 -0
- spatialdata_io-0.1.2/src/spatialdata_io/readers/xenium.py +706 -0
- spatialdata_io-0.1.2/tests/test_xenium.py +34 -0
- spatialdata_io-0.1.0rc0/src/spatialdata_io/readers/xenium.py +0 -350
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/.bumpversion.cfg +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/.codecov.yaml +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/.editorconfig +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/.flake8 +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/.github/workflows/build.yaml +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/.gitignore +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/.mypy.ini +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/.readthedocs.yaml +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/LICENSE +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/docs/Makefile +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/docs/_static/.gitkeep +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/docs/_templates/.gitkeep +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/docs/_templates/autosummary/class.rst +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/docs/changelog.md +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/docs/contributing.md +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/docs/extensions/.gitkeep +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/docs/extensions/typed_returns.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/docs/index.md +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/docs/make.bat +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/docs/references.bib +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/docs/references.md +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/docs/template_usage.md +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/_constants/__init__.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/_constants/_enum.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/_docs.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/_utils.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/converters/__init__.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/experimental/__init__.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/readers/__init__.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/readers/_utils/__init__.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/readers/_utils/_read_10x_h5.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/readers/_utils/_utils.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/readers/codex.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/readers/cosmx.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/readers/curio.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/readers/dbit.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/readers/mcmicro.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/readers/merscope.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/readers/steinbock.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/readers/visium.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/tests/__init__.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/tests/converters/__init__.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/tests/converters/test_legacy_anndata.py +0 -0
- {spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/tests/test_basic.py +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
release:
|
|
9
|
+
# requires that you have put your twine API key in your
|
|
10
|
+
# github secrets (see readme for details)
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
if: contains(github.ref, 'tags')
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout code
|
|
15
|
+
uses: actions/checkout@v3
|
|
16
|
+
|
|
17
|
+
- name: Set up Python 3.10
|
|
18
|
+
uses: actions/setup-python@v4
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.10"
|
|
21
|
+
|
|
22
|
+
- name: Install hatch
|
|
23
|
+
run: pip install hatch
|
|
24
|
+
|
|
25
|
+
- name: Build project for distribution
|
|
26
|
+
run: hatch build
|
|
27
|
+
|
|
28
|
+
- name: Publish a Python distribution to PyPI
|
|
29
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
30
|
+
with:
|
|
31
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -28,7 +28,7 @@ jobs:
|
|
|
28
28
|
steps:
|
|
29
29
|
- uses: actions/checkout@v2
|
|
30
30
|
- name: Set up Python ${{ matrix.python }}
|
|
31
|
-
uses: actions/setup-python@
|
|
31
|
+
uses: actions/setup-python@v4
|
|
32
32
|
with:
|
|
33
33
|
python-version: ${{ matrix.python }}
|
|
34
34
|
|
|
@@ -62,29 +62,3 @@ jobs:
|
|
|
62
62
|
with:
|
|
63
63
|
name: coverage
|
|
64
64
|
verbose: true
|
|
65
|
-
deploy:
|
|
66
|
-
# this will run when you have tagged a commit, starting with "v*"
|
|
67
|
-
# and requires that you have put your twine API key in your
|
|
68
|
-
# github secrets (see readme for details)
|
|
69
|
-
needs: [test]
|
|
70
|
-
runs-on: ubuntu-latest
|
|
71
|
-
if: contains(github.ref, 'tags')
|
|
72
|
-
steps:
|
|
73
|
-
- name: Checkout code
|
|
74
|
-
uses: actions/checkout@v3
|
|
75
|
-
|
|
76
|
-
- name: Set up Python 3.10
|
|
77
|
-
uses: actions/setup-python@v4
|
|
78
|
-
with:
|
|
79
|
-
python-version: "3.10"
|
|
80
|
-
|
|
81
|
-
- name: Install hatch
|
|
82
|
-
run: pip install hatch
|
|
83
|
-
|
|
84
|
-
- name: Build project for distribution
|
|
85
|
-
run: hatch build
|
|
86
|
-
|
|
87
|
-
- name: Publish a Python distribution to PyPI
|
|
88
|
-
uses: pypa/gh-action-pypi-publish@release/v1
|
|
89
|
-
with:
|
|
90
|
-
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -8,23 +8,36 @@ and this project adheres to [Semantic Versioning][].
|
|
|
8
8
|
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
|
|
9
9
|
[semantic versioning]: https://semver.org/spec/v2.0.0.html
|
|
10
10
|
|
|
11
|
-
## [0.1.
|
|
11
|
+
## [0.1.2] - 2024-03-30
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- (Visium HD) added reader, coauthored by @LLehner
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- (Xenium) reader for 1.0.1 (paper data) and unknown versions
|
|
20
|
+
- (Xenium) fix in reading "minimalistic" Xenium datasets #132
|
|
21
|
+
|
|
22
|
+
## [0.1.1] - 2024-03-24
|
|
12
23
|
|
|
13
24
|
### Added
|
|
14
25
|
|
|
15
|
-
- (MCMICRO) support for TMAs (such as the data of exemplar-002)
|
|
16
26
|
- (Xenium) support for post-xenium aligned images (IF, HE)
|
|
17
27
|
- (Xenium) reader for the selection coordinates file from the Xenium Explorer
|
|
28
|
+
- (Xenium) support for the new Xenium 2.0.0 (multimodal segmentation)
|
|
29
|
+
- (Xenium) reading multiscale labels from cells.zarr.zip
|
|
30
|
+
- (MCMICRO) support for TMAs (such as the data of exemplar-002)
|
|
18
31
|
- (DBiT-seq) reader
|
|
19
32
|
- converter functions `experimental.to_legacy_anndata()` and `experimental.from_legacy_anndata()`
|
|
20
33
|
- (Visium) support for raw reads (capture locations not under tissue)
|
|
21
34
|
|
|
22
35
|
### Fixed
|
|
23
36
|
|
|
24
|
-
- (MERSCOPE) don't try to load unexisting elements #87
|
|
25
|
-
- (Visium) fixed axes ordering
|
|
26
37
|
- (Xenium) fixed index (fail on write)
|
|
27
38
|
- (Xenium) renamed cells_as_shapes to cells_as_circles; set default to True
|
|
39
|
+
- (MERSCOPE) don't try to load unexisting elements #87
|
|
40
|
+
- (Visium) fixed axes ordering
|
|
28
41
|
|
|
29
42
|
## [0.0.9] - 2023-11-06
|
|
30
43
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: spatialdata-io
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
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
|
|
@@ -46,6 +46,7 @@ Requires-Dist: joblib
|
|
|
46
46
|
Requires-Dist: numpy
|
|
47
47
|
Requires-Dist: pyarrow
|
|
48
48
|
Requires-Dist: readfcs
|
|
49
|
+
Requires-Dist: scanpy
|
|
49
50
|
Requires-Dist: scikit-image
|
|
50
51
|
Requires-Dist: spatialdata
|
|
51
52
|
Provides-Extra: dev
|
|
@@ -75,21 +76,22 @@ Description-Content-Type: text/markdown
|
|
|
75
76
|
[![Documentation][badge-docs]][link-docs]
|
|
76
77
|
[](https://zenodo.org/badge/latestdoi/544045123)
|
|
77
78
|
|
|
78
|
-
[badge-tests]: https://github.com/scverse/spatialdata-io/actions/workflows/
|
|
79
|
-
[link-tests]: https://github.com/scverse/spatialdata-io/actions/workflows/
|
|
79
|
+
[badge-tests]: https://github.com/scverse/spatialdata-io/actions/workflows/test.yaml/badge.svg
|
|
80
|
+
[link-tests]: https://github.com/scverse/spatialdata-io/actions/workflows/test.yaml
|
|
80
81
|
[badge-docs]: https://img.shields.io/readthedocs/spatialdata-io
|
|
81
82
|
|
|
82
83
|
This package contains reader functions to load common spatial omics formats into SpatialData. Currently, we provide support for:
|
|
83
84
|
|
|
84
|
-
- NanoString CosMx
|
|
85
|
-
- MCMICRO (output data)
|
|
86
|
-
- Steinbock (output data)
|
|
87
85
|
- 10x Genomics Visium
|
|
86
|
+
- 10x Genomics Visium HD
|
|
88
87
|
- 10x Genomics Xenium
|
|
89
|
-
- Curio Seeker
|
|
90
88
|
- Akoya PhenoCycler (formerly CODEX)
|
|
91
|
-
-
|
|
89
|
+
- Curio Seeker
|
|
92
90
|
- DBiT-seq
|
|
91
|
+
- MCMICRO (output data)
|
|
92
|
+
- NanoString CosMx
|
|
93
|
+
- Steinbock (output data)
|
|
94
|
+
- Vizgen MERSCOPE (MERFISH)
|
|
93
95
|
|
|
94
96
|
## Getting started
|
|
95
97
|
|
|
@@ -6,21 +6,22 @@
|
|
|
6
6
|
[![Documentation][badge-docs]][link-docs]
|
|
7
7
|
[](https://zenodo.org/badge/latestdoi/544045123)
|
|
8
8
|
|
|
9
|
-
[badge-tests]: https://github.com/scverse/spatialdata-io/actions/workflows/
|
|
10
|
-
[link-tests]: https://github.com/scverse/spatialdata-io/actions/workflows/
|
|
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
11
|
[badge-docs]: https://img.shields.io/readthedocs/spatialdata-io
|
|
12
12
|
|
|
13
13
|
This package contains reader functions to load common spatial omics formats into SpatialData. Currently, we provide support for:
|
|
14
14
|
|
|
15
|
-
- NanoString CosMx
|
|
16
|
-
- MCMICRO (output data)
|
|
17
|
-
- Steinbock (output data)
|
|
18
15
|
- 10x Genomics Visium
|
|
16
|
+
- 10x Genomics Visium HD
|
|
19
17
|
- 10x Genomics Xenium
|
|
20
|
-
- Curio Seeker
|
|
21
18
|
- Akoya PhenoCycler (formerly CODEX)
|
|
22
|
-
-
|
|
19
|
+
- Curio Seeker
|
|
23
20
|
- DBiT-seq
|
|
21
|
+
- MCMICRO (output data)
|
|
22
|
+
- NanoString CosMx
|
|
23
|
+
- Steinbock (output data)
|
|
24
|
+
- Vizgen MERSCOPE (MERFISH)
|
|
24
25
|
|
|
25
26
|
## Getting started
|
|
26
27
|
|
|
@@ -15,14 +15,15 @@ I/O for the `spatialdata` project.
|
|
|
15
15
|
:toctree: generated
|
|
16
16
|
|
|
17
17
|
codex
|
|
18
|
-
curio
|
|
19
18
|
cosmx
|
|
19
|
+
curio
|
|
20
|
+
dbit
|
|
21
|
+
mcmicro
|
|
22
|
+
merscope
|
|
23
|
+
steinbock
|
|
20
24
|
visium
|
|
25
|
+
visium_hd
|
|
21
26
|
xenium
|
|
22
|
-
steinbock
|
|
23
|
-
merscope
|
|
24
|
-
mcmicro
|
|
25
|
-
dbit
|
|
26
27
|
```
|
|
27
28
|
|
|
28
29
|
### Conversion functions
|
|
@@ -98,6 +98,7 @@ intersphinx_mapping = {
|
|
|
98
98
|
"xarray": ("https://docs.xarray.dev/en/stable/", None),
|
|
99
99
|
"datatree": ("https://datatree.readthedocs.io/en/latest/", None),
|
|
100
100
|
"shapely": ("https://shapely.readthedocs.io/en/stable/", None),
|
|
101
|
+
"imageio": ("https://imageio.readthedocs.io/en/stable/", None),
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
# List of patterns, relative to source directory, that match files and
|
|
@@ -125,6 +126,7 @@ nitpick_ignore = [
|
|
|
125
126
|
("py:class", "Path"),
|
|
126
127
|
("py:class", "AnnData"),
|
|
127
128
|
("py:class", "SpatialData"),
|
|
129
|
+
("py:func", "imageio.imread"), # maybe this can be fixed
|
|
128
130
|
]
|
|
129
131
|
|
|
130
132
|
|
|
@@ -8,6 +8,7 @@ from spatialdata_io.readers.mcmicro import mcmicro
|
|
|
8
8
|
from spatialdata_io.readers.merscope import merscope
|
|
9
9
|
from spatialdata_io.readers.steinbock import steinbock
|
|
10
10
|
from spatialdata_io.readers.visium import visium
|
|
11
|
+
from spatialdata_io.readers.visium_hd import visium_hd
|
|
11
12
|
from spatialdata_io.readers.xenium import (
|
|
12
13
|
xenium,
|
|
13
14
|
xenium_aligned_image,
|
|
@@ -26,6 +27,7 @@ __all__ = [
|
|
|
26
27
|
"xenium_aligned_image",
|
|
27
28
|
"xenium_explorer_selection",
|
|
28
29
|
"dbit",
|
|
30
|
+
"visium_hd",
|
|
29
31
|
]
|
|
30
32
|
|
|
31
33
|
__version__ = version("spatialdata-io")
|
{spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/_constants/_constants.py
RENAMED
|
@@ -93,8 +93,17 @@ class XeniumKeys(ModeEnum):
|
|
|
93
93
|
CELL_NUCLEUS_AREA = "nucleus_area"
|
|
94
94
|
|
|
95
95
|
# morphology images
|
|
96
|
+
# before version 2.0.0
|
|
96
97
|
MORPHOLOGY_MIP_FILE = "morphology_mip.ome.tif"
|
|
97
98
|
MORPHOLOGY_FOCUS_FILE = "morphology_focus.ome.tif"
|
|
99
|
+
# from version 2.0.0
|
|
100
|
+
MORPHOLOGY_FOCUS_DIR = "morphology_focus"
|
|
101
|
+
MORPHOLOGY_FOCUS_CHANNEL_IMAGE = "morphology_focus_{:04}.ome.tif"
|
|
102
|
+
# from analysis_summary.html > Image QC of https://www.10xgenomics.com/datasets/preview-data-ffpe-human-lung-cancer-with-xenium-multimodal-cell-segmentation-1-standard
|
|
103
|
+
MORPHOLOGY_FOCUS_CHANNEL_0 = "DAPI" # nuclear
|
|
104
|
+
MORPHOLOGY_FOCUS_CHANNEL_1 = "ATP1A1/CD45/E-Cadherin" # boundary
|
|
105
|
+
MORPHOLOGY_FOCUS_CHANNEL_2 = "18S" # interior - RNA
|
|
106
|
+
MORPHOLOGY_FOCUS_CHANNEL_3 = "AlphaSMA/Vimentin" # interior - protein
|
|
98
107
|
|
|
99
108
|
# post-xenium images
|
|
100
109
|
ALIGNED_IF_IMAGE_SUFFIX = "if_image.ome.tif"
|
|
@@ -104,6 +113,14 @@ class XeniumKeys(ModeEnum):
|
|
|
104
113
|
ALIGNMENT_FILE_SUFFIX_TO_REMOVE = ".ome.tif"
|
|
105
114
|
ALIGNMENT_FILE_SUFFIX_TO_ADD = "alignment.csv"
|
|
106
115
|
|
|
116
|
+
# specs keys
|
|
117
|
+
ANALYSIS_SW_VERSION = "analysis_sw_version"
|
|
118
|
+
|
|
119
|
+
# zarr file with labels file and cell summary keys
|
|
120
|
+
CELLS_ZARR = "cells.zarr.zip"
|
|
121
|
+
NUCLEUS_COUNT = "nucleus_count"
|
|
122
|
+
Z_LEVEL = "z_level"
|
|
123
|
+
|
|
107
124
|
|
|
108
125
|
@unique
|
|
109
126
|
class VisiumKeys(ModeEnum):
|
|
@@ -210,3 +227,60 @@ class DbitKeys(ModeEnum):
|
|
|
210
227
|
BARCODE_POSITION = "barcode_list"
|
|
211
228
|
# image
|
|
212
229
|
IMAGE_LOWRES_FILE = "tissue_lowres_image.png"
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
@unique
|
|
233
|
+
class VisiumHDKeys(ModeEnum):
|
|
234
|
+
"""Keys for *10X Genomics Visium hd* formatted dataset."""
|
|
235
|
+
|
|
236
|
+
# directories
|
|
237
|
+
SPATIAL = "spatial"
|
|
238
|
+
DEFAULT_BIN = "square_008um"
|
|
239
|
+
BIN_PREFIX = "square_"
|
|
240
|
+
MICROSCOPE_IMAGE = "microscope_image"
|
|
241
|
+
|
|
242
|
+
# counts and locations files
|
|
243
|
+
FILTERED_COUNTS_FILE = "filtered_feature_bc_matrix.h5"
|
|
244
|
+
RAW_COUNTS_FILE = "raw_feature_bc_matrix.h5"
|
|
245
|
+
TISSUE_POSITIONS_FILE = "tissue_positions.parquet"
|
|
246
|
+
|
|
247
|
+
# images
|
|
248
|
+
IMAGE_HIRES_FILE = "spatial/tissue_hires_image.png"
|
|
249
|
+
IMAGE_LOWRES_FILE = "spatial/tissue_lowres_image.png"
|
|
250
|
+
IMAGE_CYTASSIST = "spatial/cytassist_image.tiff"
|
|
251
|
+
|
|
252
|
+
# scalefactors
|
|
253
|
+
SCALEFACTORS_FILE = "scalefactors_json.json"
|
|
254
|
+
|
|
255
|
+
# scalefactors keys
|
|
256
|
+
SCALEFACTORS_HIRES = "tissue_hires_scalef"
|
|
257
|
+
SCALEFACTORS_LOWRES = "tissue_lowres_scalef"
|
|
258
|
+
SCALEFACTORS_SPOT_DIAMETER_FULLRES = "spot_diameter_fullres"
|
|
259
|
+
SCALEFACTORS_BIN_SIZE_UM = "bin_size_um"
|
|
260
|
+
SCALEFACTORS_MICRONS_PER_PIXEL = "microns_per_pixel"
|
|
261
|
+
|
|
262
|
+
# locations keys
|
|
263
|
+
LOCATIONS_X = "pxl_col_in_fullres"
|
|
264
|
+
LOCATIONS_Y = "pxl_row_in_fullres"
|
|
265
|
+
BARCODE = "barcode"
|
|
266
|
+
IN_TISSUE = "in_tissue"
|
|
267
|
+
ARRAY_ROW = "array_row"
|
|
268
|
+
ARRAY_COL = "array_col"
|
|
269
|
+
|
|
270
|
+
# table keys
|
|
271
|
+
REGION_KEY = "region"
|
|
272
|
+
INSTANCE_KEY = "location_id"
|
|
273
|
+
|
|
274
|
+
# feature slice file (it contains transformation matrices in the metadata)
|
|
275
|
+
FEATURE_SLICE_FILE = "feature_slice.h5"
|
|
276
|
+
|
|
277
|
+
# METADATA_KEYS
|
|
278
|
+
METADATA_JSON = "metadata_json"
|
|
279
|
+
HD_LAYOUT_JSON = "hd_layout_json"
|
|
280
|
+
TRANSFORM = "transform"
|
|
281
|
+
TRANSFORM_MATRICES = "transform_matrices"
|
|
282
|
+
CYTASSIST_COLROW_TO_SPOT_COLROW = ("cytassist_colrow_to_spot_colrow",)
|
|
283
|
+
SPOT_COLROW_TO_CYTASSIST_COLROW = ("spot_colrow_to_cytassist_colrow",)
|
|
284
|
+
MICROSCOPE_COLROW_TO_SPOT_COLROW = ("microscope_colrow_to_spot_colrow",)
|
|
285
|
+
SPOT_COLROW_TO_MICROSCOPE_COLROW = ("spot_colrow_to_microscope_colrow",)
|
|
286
|
+
FILE_FORMAT = "file_format"
|
{spatialdata_io-0.1.0rc0 → spatialdata_io-0.1.2}/src/spatialdata_io/converters/legacy_anndata.py
RENAMED
|
@@ -8,7 +8,7 @@ from spatialdata import (
|
|
|
8
8
|
SpatialData,
|
|
9
9
|
get_centroids,
|
|
10
10
|
get_extent,
|
|
11
|
-
|
|
11
|
+
join_spatialelement_table,
|
|
12
12
|
to_circles,
|
|
13
13
|
)
|
|
14
14
|
from spatialdata._core.operations._utils import transform_to_data_extent
|
|
@@ -149,8 +149,8 @@ def to_legacy_anndata(
|
|
|
149
149
|
shapes = to_circles(element)
|
|
150
150
|
circles_sdata = SpatialData(tables={table_name: table}, shapes={region_name: shapes})
|
|
151
151
|
|
|
152
|
-
joined_elements, new_table =
|
|
153
|
-
sdata=circles_sdata,
|
|
152
|
+
joined_elements, new_table = join_spatialelement_table(
|
|
153
|
+
sdata=circles_sdata, spatial_element_names=region_name, table_name=table_name, how="inner", match_rows="left"
|
|
154
154
|
)
|
|
155
155
|
|
|
156
156
|
# the table after the filtering must not be empty
|