spatialdata-js-util 0.1.0__py3-none-any.whl
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_js_util/__init__.py +107 -0
- spatialdata_js_util/cli.py +803 -0
- spatialdata_js_util/codecs/__init__.py +67 -0
- spatialdata_js_util/codecs/backends.py +250 -0
- spatialdata_js_util/codecs/chunks.py +40 -0
- spatialdata_js_util/codecs/encoding.py +154 -0
- spatialdata_js_util/codecs/htj2k_wasm.py +266 -0
- spatialdata_js_util/codecs/names.py +26 -0
- spatialdata_js_util/codecs/probe/multicomponent.j2c +0 -0
- spatialdata_js_util/codecs/probe/multicomponent.json +3 -0
- spatialdata_js_util/codecs/probe/multicomponent.npy +0 -0
- spatialdata_js_util/codecs/vendor/__init__.py +1 -0
- spatialdata_js_util/codecs/vendor/encode-plane.mjs +164 -0
- spatialdata_js_util/codecs/vendor/openjph/index.mjs +131 -0
- spatialdata_js_util/codecs/vendor/openjph/wasm/libopenjph.mjs +2 -0
- spatialdata_js_util/codecs/vendor/openjph/wasm/libopenjph.wasm +0 -0
- spatialdata_js_util/codecs/vendor/openjph/wasm/libopenjph_simd.mjs +2 -0
- spatialdata_js_util/codecs/vendor/openjph/wasm/libopenjph_simd.wasm +0 -0
- spatialdata_js_util/codecs/zarr_codec.py +149 -0
- spatialdata_js_util/errors.py +5 -0
- spatialdata_js_util/images.py +849 -0
- spatialdata_js_util/index_permutations.py +311 -0
- spatialdata_js_util/points.py +445 -0
- spatialdata_js_util/points_zarr.py +799 -0
- spatialdata_js_util/provenance.py +17 -0
- spatialdata_js_util/pyramids.py +318 -0
- spatialdata_js_util/runners.py +458 -0
- spatialdata_js_util/store.py +305 -0
- spatialdata_js_util/tables.py +310 -0
- spatialdata_js_util/tui/__init__.py +0 -0
- spatialdata_js_util/tui/app.py +112 -0
- spatialdata_js_util/tui/models.py +45 -0
- spatialdata_js_util/tui/screens.py +1255 -0
- spatialdata_js_util/tui/widgets.py +50 -0
- spatialdata_js_util/verify.py +338 -0
- spatialdata_js_util-0.1.0.dist-info/METADATA +412 -0
- spatialdata_js_util-0.1.0.dist-info/RECORD +40 -0
- spatialdata_js_util-0.1.0.dist-info/WHEEL +5 -0
- spatialdata_js_util-0.1.0.dist-info/entry_points.txt +7 -0
- spatialdata_js_util-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"""Utilities for reading and writing browser-oriented SpatialData stores.
|
|
2
|
+
|
|
3
|
+
Three kinds of optimization live here, all aimed at making a SpatialData store
|
|
4
|
+
cheap to read incrementally over HTTP from `SpatialData.js`:
|
|
5
|
+
|
|
6
|
+
* **images** — recompress rasters with JPEG 2000 or HTJ2K so tiles decode in the
|
|
7
|
+
browser (`recompress_spatialdata`).
|
|
8
|
+
* **points** — Morton-sort Points Parquet with sentinel bounding-box rows and
|
|
9
|
+
controlled row groups, so a viewport maps to a few row-group reads
|
|
10
|
+
(`write_morton_points_parquet`); or write the experimental multiscale Zarr
|
|
11
|
+
layout, levels of uniform samples in tile and feature order
|
|
12
|
+
(`write_points_zarr_store`).
|
|
13
|
+
* **tables** — convert AnnData matrices to CSC so reading one gene is one
|
|
14
|
+
contiguous range read (`convert_store_tables_to_csc`).
|
|
15
|
+
|
|
16
|
+
Installing this distribution also registers the image codecs with zarr-python,
|
|
17
|
+
so `spatialdata.read_zarr` can open stores written here — see
|
|
18
|
+
`spatialdata_js_util.codecs.zarr_codec`.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from .codecs import (
|
|
22
|
+
CODEC_HTJ2K_LEGACY,
|
|
23
|
+
CODEC_HTJ2K_OPENJPH,
|
|
24
|
+
CODEC_JPEG2K,
|
|
25
|
+
backend_report,
|
|
26
|
+
htj2k_available,
|
|
27
|
+
is_htj2k_codec,
|
|
28
|
+
register_codecs,
|
|
29
|
+
)
|
|
30
|
+
from .images import (
|
|
31
|
+
HTJ2K_PRESETS,
|
|
32
|
+
HTJ2K_QUALITY_FLOOR_LSB,
|
|
33
|
+
JP2K_PRESETS,
|
|
34
|
+
RecompressedSpatialData,
|
|
35
|
+
dtype_quantum,
|
|
36
|
+
htj2k_preset_quality,
|
|
37
|
+
recompress_spatialdata,
|
|
38
|
+
resolve_recompression_config,
|
|
39
|
+
)
|
|
40
|
+
from .pyramids import (
|
|
41
|
+
PyramidResult,
|
|
42
|
+
add_pyramids,
|
|
43
|
+
has_pyramid,
|
|
44
|
+
resolve_scale_factors,
|
|
45
|
+
)
|
|
46
|
+
from .points import (
|
|
47
|
+
MORTON_CODE_2D_COLUMN,
|
|
48
|
+
MORTON_CODE_EXTREME_VALUE_INDICATOR,
|
|
49
|
+
MORTON_COARSE_COLUMN,
|
|
50
|
+
ColumnEncodingPlan,
|
|
51
|
+
build_spatialdata_multiscale_metadata,
|
|
52
|
+
morton_sort_points,
|
|
53
|
+
plan_column_encodings,
|
|
54
|
+
write_morton_points_parquet,
|
|
55
|
+
write_multiscale_points_parquet,
|
|
56
|
+
)
|
|
57
|
+
from .points_zarr import (
|
|
58
|
+
POINTS_ZARR_VERSION,
|
|
59
|
+
add_points_zarr_to_store,
|
|
60
|
+
write_points_zarr,
|
|
61
|
+
write_points_zarr_store,
|
|
62
|
+
)
|
|
63
|
+
from .tables import (
|
|
64
|
+
CscConversion,
|
|
65
|
+
anndata_to_csc,
|
|
66
|
+
convert_store_tables_to_csc,
|
|
67
|
+
to_csc,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
__all__ = [
|
|
71
|
+
"CODEC_HTJ2K_LEGACY",
|
|
72
|
+
"CODEC_HTJ2K_OPENJPH",
|
|
73
|
+
"CODEC_JPEG2K",
|
|
74
|
+
"HTJ2K_PRESETS",
|
|
75
|
+
"HTJ2K_QUALITY_FLOOR_LSB",
|
|
76
|
+
"JP2K_PRESETS",
|
|
77
|
+
"MORTON_CODE_2D_COLUMN",
|
|
78
|
+
"MORTON_CODE_EXTREME_VALUE_INDICATOR",
|
|
79
|
+
"MORTON_COARSE_COLUMN",
|
|
80
|
+
"POINTS_ZARR_VERSION",
|
|
81
|
+
"ColumnEncodingPlan",
|
|
82
|
+
"CscConversion",
|
|
83
|
+
"PyramidResult",
|
|
84
|
+
"RecompressedSpatialData",
|
|
85
|
+
"add_points_zarr_to_store",
|
|
86
|
+
"add_pyramids",
|
|
87
|
+
"anndata_to_csc",
|
|
88
|
+
"backend_report",
|
|
89
|
+
"build_spatialdata_multiscale_metadata",
|
|
90
|
+
"convert_store_tables_to_csc",
|
|
91
|
+
"dtype_quantum",
|
|
92
|
+
"has_pyramid",
|
|
93
|
+
"htj2k_available",
|
|
94
|
+
"htj2k_preset_quality",
|
|
95
|
+
"is_htj2k_codec",
|
|
96
|
+
"morton_sort_points",
|
|
97
|
+
"plan_column_encodings",
|
|
98
|
+
"recompress_spatialdata",
|
|
99
|
+
"register_codecs",
|
|
100
|
+
"resolve_recompression_config",
|
|
101
|
+
"resolve_scale_factors",
|
|
102
|
+
"to_csc",
|
|
103
|
+
"write_morton_points_parquet",
|
|
104
|
+
"write_multiscale_points_parquet",
|
|
105
|
+
"write_points_zarr",
|
|
106
|
+
"write_points_zarr_store",
|
|
107
|
+
]
|