spatialdata-io 0.1.5__tar.gz → 0.1.6__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.5 → spatialdata_io-0.1.6}/.flake8 +2 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/.github/workflows/test.yaml +3 -3
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/.mypy.ini +1 -1
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/.pre-commit-config.yaml +3 -3
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/.readthedocs.yaml +1 -1
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/CHANGELOG.md +6 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/PKG-INFO +3 -4
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/_version.py +2 -2
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/docs/conf.py +1 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/pyproject.toml +3 -3
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/_constants/_constants.py +1 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/_constants/_enum.py +2 -1
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/_docs.py +2 -1
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/_utils.py +2 -1
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/_utils/_read_10x_h5.py +4 -4
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/_utils/_utils.py +2 -11
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/cosmx.py +2 -2
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/dbit.py +7 -8
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/merscope.py +3 -2
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/steinbock.py +3 -3
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/stereoseq.py +2 -2
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/visium_hd.py +2 -2
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/xenium.py +3 -4
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/tests/test_xenium.py +1 -1
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/.bumpversion.cfg +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/.codecov.yaml +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/.editorconfig +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/.github/codecov.yml +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/.github/workflows/build.yaml +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/.github/workflows/prepare_test_data.yaml +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/.github/workflows/release.yaml +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/.gitignore +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/LICENSE +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/README.md +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/docs/Makefile +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/docs/_static/.gitkeep +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/docs/_templates/.gitkeep +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/docs/_templates/autosummary/class.rst +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/docs/api.md +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/docs/changelog.md +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/docs/contributing.md +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/docs/extensions/.gitkeep +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/docs/extensions/typed_returns.py +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/docs/index.md +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/docs/make.bat +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/docs/references.bib +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/docs/references.md +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/docs/template_usage.md +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/__init__.py +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/_constants/__init__.py +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/converters/__init__.py +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/converters/legacy_anndata.py +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/experimental/__init__.py +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/__init__.py +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/_utils/__init__.py +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/codex.py +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/curio.py +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/iss.py +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/mcmicro.py +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/seqfish.py +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/visium.py +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/tests/__init__.py +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/tests/converters/__init__.py +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/tests/converters/test_legacy_anndata.py +0 -0
- {spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/tests/test_basic.py +0 -0
|
@@ -18,7 +18,7 @@ jobs:
|
|
|
18
18
|
strategy:
|
|
19
19
|
fail-fast: false
|
|
20
20
|
matrix:
|
|
21
|
-
python: ["3.
|
|
21
|
+
python: ["3.10", "3.12"]
|
|
22
22
|
os: [ubuntu-latest]
|
|
23
23
|
|
|
24
24
|
env:
|
|
@@ -52,7 +52,7 @@ jobs:
|
|
|
52
52
|
pip install --pre -e ".[dev,test]"
|
|
53
53
|
|
|
54
54
|
- name: Download artifact of test data
|
|
55
|
-
if: matrix.python == '3.
|
|
55
|
+
if: matrix.python == '3.12'
|
|
56
56
|
uses: dawidd6/action-download-artifact@v2
|
|
57
57
|
with:
|
|
58
58
|
workflow: prepare_test_data.yaml
|
|
@@ -60,7 +60,7 @@ jobs:
|
|
|
60
60
|
path: ./data
|
|
61
61
|
|
|
62
62
|
- name: List the data directory
|
|
63
|
-
if: matrix.python == '3.
|
|
63
|
+
if: matrix.python == '3.12'
|
|
64
64
|
run: |
|
|
65
65
|
ls -l ./data
|
|
66
66
|
pwd
|
|
@@ -2,8 +2,8 @@ fail_fast: false
|
|
|
2
2
|
default_language_version:
|
|
3
3
|
python: python3
|
|
4
4
|
default_stages:
|
|
5
|
-
- commit
|
|
6
|
-
- push
|
|
5
|
+
- pre-commit
|
|
6
|
+
- pre-push
|
|
7
7
|
minimum_pre_commit_version: 2.16.0
|
|
8
8
|
repos:
|
|
9
9
|
- repo: https://github.com/psf/black
|
|
@@ -73,7 +73,7 @@ repos:
|
|
|
73
73
|
rev: v3.17.0
|
|
74
74
|
hooks:
|
|
75
75
|
- id: pyupgrade
|
|
76
|
-
args: [--py3-plus, --
|
|
76
|
+
args: [--py3-plus, --py310-plus, --keep-runtime-typing]
|
|
77
77
|
- repo: local
|
|
78
78
|
hooks:
|
|
79
79
|
- id: forbid-to-commit
|
|
@@ -8,6 +8,12 @@ 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.6] - 2024-11-26
|
|
12
|
+
|
|
13
|
+
- (MERSCOPE) added `feature_key` attribute for points (i.e., the `'gene'` column) #210
|
|
14
|
+
- (Visium HD) get transformation matrices even when only images are parsed #215
|
|
15
|
+
- Support for `xarray.DataTree` (which was moved from `datatree.DataTree`) #232
|
|
16
|
+
|
|
11
17
|
## [0.1.5] - 2024-09-25
|
|
12
18
|
|
|
13
19
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: spatialdata-io
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
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
|
|
@@ -36,8 +36,7 @@ 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
|
-
|
|
40
|
-
Requires-Python: >=3.9
|
|
39
|
+
Requires-Python: >=3.10
|
|
41
40
|
Requires-Dist: anndata
|
|
42
41
|
Requires-Dist: dask-image
|
|
43
42
|
Requires-Dist: h5py
|
|
@@ -48,7 +47,7 @@ Requires-Dist: pyarrow
|
|
|
48
47
|
Requires-Dist: readfcs
|
|
49
48
|
Requires-Dist: scanpy
|
|
50
49
|
Requires-Dist: scikit-image
|
|
51
|
-
Requires-Dist: spatialdata>=0.2.
|
|
50
|
+
Requires-Dist: spatialdata>=0.2.6
|
|
52
51
|
Requires-Dist: tifffile>=2023.8.12
|
|
53
52
|
Provides-Extra: dev
|
|
54
53
|
Requires-Dist: bump2version; extra == 'dev'
|
|
@@ -90,6 +90,7 @@ source_suffix = {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
intersphinx_mapping = {
|
|
93
|
+
"python": ("https://docs.python.org/3", None),
|
|
93
94
|
"anndata": ("https://anndata.readthedocs.io/en/stable/", None),
|
|
94
95
|
"spatialdata": ("https://scverse-spatialdata.readthedocs.io/en/latest/", None),
|
|
95
96
|
"numpy": ("https://numpy.org/doc/stable/", None),
|
|
@@ -10,7 +10,7 @@ dynamic= [
|
|
|
10
10
|
]
|
|
11
11
|
description = "SpatialData IO for common techs"
|
|
12
12
|
readme = "README.md"
|
|
13
|
-
requires-python = ">=3.
|
|
13
|
+
requires-python = ">=3.10"
|
|
14
14
|
license = {file = "LICENSE"}
|
|
15
15
|
authors = [
|
|
16
16
|
{name = "scverse"},
|
|
@@ -25,7 +25,7 @@ dependencies = [
|
|
|
25
25
|
"anndata",
|
|
26
26
|
"numpy",
|
|
27
27
|
"scanpy",
|
|
28
|
-
"spatialdata>=0.2.
|
|
28
|
+
"spatialdata>=0.2.6",
|
|
29
29
|
"scikit-image",
|
|
30
30
|
"h5py",
|
|
31
31
|
"joblib",
|
|
@@ -83,7 +83,7 @@ skip_glob = ["docs/*"]
|
|
|
83
83
|
|
|
84
84
|
[tool.black]
|
|
85
85
|
line-length = 120
|
|
86
|
-
target-version = ['
|
|
86
|
+
target-version = ['py310']
|
|
87
87
|
include = '\.pyi?$'
|
|
88
88
|
exclude = '''
|
|
89
89
|
(
|
{spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/readers/_utils/_read_10x_h5.py
RENAMED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
# code below taken from https://github.com/scverse/scanpy/blob/master/scanpy/readwrite.py
|
|
32
32
|
|
|
33
33
|
from pathlib import Path
|
|
34
|
-
from typing import Any
|
|
34
|
+
from typing import Any
|
|
35
35
|
|
|
36
36
|
import h5py
|
|
37
37
|
import numpy as np
|
|
@@ -40,8 +40,8 @@ from spatialdata._logging import logger
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
def _read_10x_h5(
|
|
43
|
-
filename:
|
|
44
|
-
genome:
|
|
43
|
+
filename: str | Path,
|
|
44
|
+
genome: str | None = None,
|
|
45
45
|
gex_only: bool = True,
|
|
46
46
|
) -> AnnData:
|
|
47
47
|
"""
|
|
@@ -96,7 +96,7 @@ def _read_10x_h5(
|
|
|
96
96
|
return adata
|
|
97
97
|
|
|
98
98
|
|
|
99
|
-
def _read_v3_10x_h5(filename:
|
|
99
|
+
def _read_v3_10x_h5(filename: str | Path, *, start: Any | None = None) -> AnnData:
|
|
100
100
|
"""Read hdf5 file from Cell Ranger v3 or later versions."""
|
|
101
101
|
with h5py.File(str(filename), "r") as f:
|
|
102
102
|
try:
|
|
@@ -3,9 +3,8 @@ from __future__ import annotations
|
|
|
3
3
|
import os
|
|
4
4
|
from collections.abc import Mapping
|
|
5
5
|
from pathlib import Path
|
|
6
|
-
from typing import Any,
|
|
6
|
+
from typing import Any, Union
|
|
7
7
|
|
|
8
|
-
import numpy as np
|
|
9
8
|
from anndata import AnnData, read_text
|
|
10
9
|
from h5py import File
|
|
11
10
|
|
|
@@ -13,19 +12,11 @@ from spatialdata_io.readers._utils._read_10x_h5 import _read_10x_h5
|
|
|
13
12
|
|
|
14
13
|
PathLike = Union[os.PathLike, str] # type:ignore[type-arg]
|
|
15
14
|
|
|
16
|
-
try:
|
|
17
|
-
from numpy.typing import NDArray
|
|
18
|
-
|
|
19
|
-
NDArrayA = NDArray[Any]
|
|
20
|
-
except (ImportError, TypeError):
|
|
21
|
-
NDArray = np.ndarray
|
|
22
|
-
NDArrayA = np.ndarray
|
|
23
|
-
|
|
24
15
|
|
|
25
16
|
def _read_counts(
|
|
26
17
|
path: str | Path,
|
|
27
18
|
counts_file: str,
|
|
28
|
-
library_id:
|
|
19
|
+
library_id: str | None = None,
|
|
29
20
|
**kwargs: Any,
|
|
30
21
|
) -> tuple[AnnData, str]:
|
|
31
22
|
path = Path(path)
|
|
@@ -5,7 +5,7 @@ import re
|
|
|
5
5
|
from collections.abc import Mapping
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
from types import MappingProxyType
|
|
8
|
-
from typing import Any
|
|
8
|
+
from typing import Any
|
|
9
9
|
|
|
10
10
|
import dask.array as da
|
|
11
11
|
import numpy as np
|
|
@@ -38,7 +38,7 @@ __all__ = ["cosmx"]
|
|
|
38
38
|
@inject_docs(cx=CosmxKeys)
|
|
39
39
|
def cosmx(
|
|
40
40
|
path: str | Path,
|
|
41
|
-
dataset_id:
|
|
41
|
+
dataset_id: str | None = None,
|
|
42
42
|
transcripts: bool = True,
|
|
43
43
|
imread_kwargs: Mapping[str, Any] = MappingProxyType({}),
|
|
44
44
|
image_models_kwargs: Mapping[str, Any] = MappingProxyType({}),
|
|
@@ -4,7 +4,6 @@ import os
|
|
|
4
4
|
import re
|
|
5
5
|
from pathlib import Path
|
|
6
6
|
from re import Pattern
|
|
7
|
-
from typing import Optional, Union
|
|
8
7
|
|
|
9
8
|
import anndata as ad
|
|
10
9
|
import numpy as np
|
|
@@ -27,9 +26,9 @@ def _check_path(
|
|
|
27
26
|
path: Path,
|
|
28
27
|
pattern: Pattern[str],
|
|
29
28
|
key: DbitKeys,
|
|
30
|
-
path_specific:
|
|
29
|
+
path_specific: str | Path | None = None,
|
|
31
30
|
optional_arg: bool = False,
|
|
32
|
-
) -> tuple[
|
|
31
|
+
) -> tuple[Path | None, bool]:
|
|
33
32
|
"""
|
|
34
33
|
Check that the path is valid and match a regex pattern.
|
|
35
34
|
|
|
@@ -218,11 +217,11 @@ def _xy2edges(xy: list[int], scale: float = 1.0, border: bool = True, border_sca
|
|
|
218
217
|
|
|
219
218
|
@inject_docs(vx=DbitKeys)
|
|
220
219
|
def dbit(
|
|
221
|
-
path:
|
|
222
|
-
anndata_path:
|
|
223
|
-
barcode_position:
|
|
224
|
-
image_path:
|
|
225
|
-
dataset_id:
|
|
220
|
+
path: str | Path | None = None,
|
|
221
|
+
anndata_path: str | None = None,
|
|
222
|
+
barcode_position: str | None = None,
|
|
223
|
+
image_path: str | None = None,
|
|
224
|
+
dataset_id: str | None = None,
|
|
226
225
|
border: bool = True,
|
|
227
226
|
border_scale: float = 1,
|
|
228
227
|
) -> SpatialData:
|
|
@@ -2,10 +2,10 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import re
|
|
4
4
|
import warnings
|
|
5
|
-
from collections.abc import Mapping
|
|
5
|
+
from collections.abc import Callable, Mapping
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
from types import MappingProxyType
|
|
8
|
-
from typing import Any,
|
|
8
|
+
from typing import Any, Literal
|
|
9
9
|
|
|
10
10
|
import anndata
|
|
11
11
|
import dask.dataframe as dd
|
|
@@ -303,6 +303,7 @@ def _get_points(transcript_path: Path, transformations: dict[str, BaseTransforma
|
|
|
303
303
|
transcript_df,
|
|
304
304
|
coordinates={"x": MerscopeKeys.GLOBAL_X, "y": MerscopeKeys.GLOBAL_Y},
|
|
305
305
|
transformations=transformations,
|
|
306
|
+
feature_key=MerscopeKeys.GENE_KEY,
|
|
306
307
|
)
|
|
307
308
|
transcripts["gene"] = transcripts["gene"].astype("category")
|
|
308
309
|
return transcripts
|
|
@@ -4,7 +4,7 @@ import os
|
|
|
4
4
|
from collections.abc import Mapping
|
|
5
5
|
from pathlib import Path
|
|
6
6
|
from types import MappingProxyType
|
|
7
|
-
from typing import Any, Literal
|
|
7
|
+
from typing import Any, Literal
|
|
8
8
|
|
|
9
9
|
import anndata as ad
|
|
10
10
|
from dask_image.imread import imread
|
|
@@ -95,7 +95,7 @@ def _get_images(
|
|
|
95
95
|
sample: str,
|
|
96
96
|
imread_kwargs: Mapping[str, Any] = MappingProxyType({}),
|
|
97
97
|
image_models_kwargs: Mapping[str, Any] = MappingProxyType({}),
|
|
98
|
-
) ->
|
|
98
|
+
) -> SpatialImage | MultiscaleSpatialImage:
|
|
99
99
|
image = imread(path / SteinbockKeys.IMAGES_DIR / f"{sample}{SteinbockKeys.IMAGE_SUFFIX}", **imread_kwargs)
|
|
100
100
|
return Image2DModel.parse(data=image, transformations={sample: Identity()}, rgb=None, **image_models_kwargs)
|
|
101
101
|
|
|
@@ -106,6 +106,6 @@ def _get_labels(
|
|
|
106
106
|
labels_kind: str,
|
|
107
107
|
imread_kwargs: Mapping[str, Any] = MappingProxyType({}),
|
|
108
108
|
image_models_kwargs: Mapping[str, Any] = MappingProxyType({}),
|
|
109
|
-
) ->
|
|
109
|
+
) -> SpatialImage | MultiscaleSpatialImage:
|
|
110
110
|
image = imread(path / labels_kind / f"{sample}{SteinbockKeys.LABEL_SUFFIX}", **imread_kwargs).squeeze()
|
|
111
111
|
return Labels2DModel.parse(data=image, transformations={sample: Identity()}, **image_models_kwargs)
|
|
@@ -5,7 +5,7 @@ import re
|
|
|
5
5
|
from collections.abc import Mapping
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
from types import MappingProxyType
|
|
8
|
-
from typing import Any
|
|
8
|
+
from typing import Any
|
|
9
9
|
|
|
10
10
|
import anndata as ad
|
|
11
11
|
import h5py
|
|
@@ -29,7 +29,7 @@ __all__ = ["stereoseq"]
|
|
|
29
29
|
@inject_docs(xx=SK)
|
|
30
30
|
def stereoseq(
|
|
31
31
|
path: str | Path,
|
|
32
|
-
dataset_id:
|
|
32
|
+
dataset_id: str | None = None,
|
|
33
33
|
read_square_bin: bool = True,
|
|
34
34
|
optional_tif: bool = False,
|
|
35
35
|
imread_kwargs: Mapping[str, Any] = MappingProxyType({}),
|
|
@@ -79,7 +79,7 @@ def visium_hd(
|
|
|
79
79
|
image_models_kwargs
|
|
80
80
|
Keyword arguments for :class:`spatialdata.models.Image2DModel`.
|
|
81
81
|
anndata_kwargs
|
|
82
|
-
Keyword arguments for :func:`anndata.read_h5ad`.
|
|
82
|
+
Keyword arguments for :func:`anndata.io.read_h5ad`.
|
|
83
83
|
|
|
84
84
|
Returns
|
|
85
85
|
-------
|
|
@@ -107,7 +107,6 @@ def visium_hd(
|
|
|
107
107
|
)
|
|
108
108
|
|
|
109
109
|
metadata, hd_layout = _parse_metadata(path, filename_prefix)
|
|
110
|
-
transform_matrices = _get_transform_matrices(metadata, hd_layout)
|
|
111
110
|
file_format = hd_layout[VisiumHDKeys.FILE_FORMAT]
|
|
112
111
|
if file_format != "1.0":
|
|
113
112
|
warnings.warn(
|
|
@@ -347,6 +346,7 @@ def visium_hd(
|
|
|
347
346
|
suffix="_cytassist_image",
|
|
348
347
|
)
|
|
349
348
|
image = images[dataset_id + "_cytassist_image"]
|
|
349
|
+
transform_matrices = _get_transform_matrices(metadata, hd_layout)
|
|
350
350
|
affine0 = transform_matrices["cytassist_colrow_to_spot_colrow"]
|
|
351
351
|
affine1 = transform_matrices["spot_colrow_to_microscope_colrow"]
|
|
352
352
|
set_transformation(image, Sequence([affine0, affine1]), "global")
|
|
@@ -10,7 +10,7 @@ import zipfile
|
|
|
10
10
|
from collections.abc import Mapping
|
|
11
11
|
from pathlib import Path
|
|
12
12
|
from types import MappingProxyType
|
|
13
|
-
from typing import Any
|
|
13
|
+
from typing import Any
|
|
14
14
|
|
|
15
15
|
import dask.array as da
|
|
16
16
|
import numpy as np
|
|
@@ -22,7 +22,6 @@ import zarr
|
|
|
22
22
|
from anndata import AnnData
|
|
23
23
|
from dask.dataframe import read_parquet
|
|
24
24
|
from dask_image.imread import imread
|
|
25
|
-
from datatree.datatree import DataTree
|
|
26
25
|
from geopandas import GeoDataFrame
|
|
27
26
|
from joblib import Parallel, delayed
|
|
28
27
|
from pyarrow import Table
|
|
@@ -38,7 +37,7 @@ from spatialdata.models import (
|
|
|
38
37
|
TableModel,
|
|
39
38
|
)
|
|
40
39
|
from spatialdata.transformations.transformations import Affine, Identity, Scale
|
|
41
|
-
from xarray import DataArray
|
|
40
|
+
from xarray import DataArray, DataTree
|
|
42
41
|
|
|
43
42
|
from spatialdata_io._constants._constants import XeniumKeys
|
|
44
43
|
from spatialdata_io._docs import inject_docs
|
|
@@ -364,7 +363,7 @@ def _decode_cell_id_column(cell_id_column: pd.Series) -> pd.Series:
|
|
|
364
363
|
|
|
365
364
|
|
|
366
365
|
def _get_polygons(
|
|
367
|
-
path: Path, file: str, specs: dict[str, Any], n_jobs: int, idx:
|
|
366
|
+
path: Path, file: str, specs: dict[str, Any], n_jobs: int, idx: ArrayLike | None = None
|
|
368
367
|
) -> GeoDataFrame:
|
|
369
368
|
def _poly(arr: ArrayLike) -> Polygon:
|
|
370
369
|
return Polygon(arr[:-1])
|
|
@@ -46,7 +46,7 @@ def test_roundtrip_with_data_limits() -> None:
|
|
|
46
46
|
# pointing to "data".
|
|
47
47
|
# The GitHub workflow "prepare_test_data.yaml" takes care of downloading the datasets and uploading an artifact for the
|
|
48
48
|
# tests to use
|
|
49
|
-
@pytest.mark.skipif(sys.version_info < (3,
|
|
49
|
+
@pytest.mark.skipif(sys.version_info < (3, 12), reason="Test requires Python 3.10 or higher")
|
|
50
50
|
@pytest.mark.parametrize(
|
|
51
51
|
"dataset,expected",
|
|
52
52
|
[
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{spatialdata_io-0.1.5 → spatialdata_io-0.1.6}/src/spatialdata_io/converters/legacy_anndata.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|