vitessce 3.6.6__py3-none-any.whl → 3.6.8__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.
- vitessce/file_def_utils.py +5 -11
- vitessce/widget.py +8 -3
- vitessce/wrappers.py +15 -10
- {vitessce-3.6.6.dist-info → vitessce-3.6.8.dist-info}/METADATA +1 -1
- {vitessce-3.6.6.dist-info → vitessce-3.6.8.dist-info}/RECORD +7 -7
- {vitessce-3.6.6.dist-info → vitessce-3.6.8.dist-info}/WHEEL +0 -0
- {vitessce-3.6.6.dist-info → vitessce-3.6.8.dist-info}/licenses/LICENSE +0 -0
vitessce/file_def_utils.py
CHANGED
|
@@ -3,8 +3,6 @@ from __future__ import annotations
|
|
|
3
3
|
from functools import partial
|
|
4
4
|
from typing import Optional
|
|
5
5
|
|
|
6
|
-
import numpy as np
|
|
7
|
-
|
|
8
6
|
|
|
9
7
|
def gen_obs_embedding_schema(options: dict, paths: Optional[list[str]] = None, names: Optional[list[str]] = None, dims: Optional[list[list[int]]] = None):
|
|
10
8
|
if paths is not None:
|
|
@@ -127,29 +125,25 @@ gen_obs_points_schema = partial(gen_path_schema, "obsPoints")
|
|
|
127
125
|
gen_feature_labels_schema = partial(gen_path_schema, "featureLabels")
|
|
128
126
|
|
|
129
127
|
|
|
130
|
-
def gen_sdata_image_schema(options, path: str, coordinate_system: Optional[str] = None
|
|
128
|
+
def gen_sdata_image_schema(options, path: str, coordinate_system: Optional[str] = None) -> dict:
|
|
131
129
|
if path is not None:
|
|
132
130
|
options["image"] = {
|
|
133
131
|
"path": path
|
|
134
132
|
}
|
|
135
|
-
if affine_transformation is not None:
|
|
136
|
-
options["image"]['coordinateTransformations'] = affine_transformation
|
|
137
133
|
if coordinate_system is not None:
|
|
138
134
|
options["image"]['coordinateSystem'] = coordinate_system
|
|
139
135
|
return options
|
|
140
136
|
|
|
141
137
|
|
|
142
|
-
def
|
|
138
|
+
def gen_sdata_obs_segmentations_schema(options, path: str, table_path: str = "tables/table", coordinate_system: Optional[str] = None) -> dict:
|
|
143
139
|
if path is not None:
|
|
144
|
-
options["
|
|
140
|
+
options["obsSegmentations"] = {
|
|
145
141
|
"path": path
|
|
146
142
|
}
|
|
147
143
|
if table_path is not None:
|
|
148
|
-
options["
|
|
149
|
-
if affine_transformation is not None:
|
|
150
|
-
options["labels"]['coordinateTransformations'] = affine_transformation
|
|
144
|
+
options["obsSegmentations"]['tablePath'] = table_path
|
|
151
145
|
if coordinate_system is not None:
|
|
152
|
-
options["
|
|
146
|
+
options["obsSegmentations"]['coordinateSystem'] = coordinate_system
|
|
153
147
|
return options
|
|
154
148
|
|
|
155
149
|
|
vitessce/widget.py
CHANGED
|
@@ -131,6 +131,11 @@ def launch_vitessce_io(config, theme='light', port=None, base_url=None, host_nam
|
|
|
131
131
|
port, DEFAULT_PORT, proxy=proxy, base_url=base_url, host_name=host_name)
|
|
132
132
|
config_dict = config.to_dict(base_url=base_url)
|
|
133
133
|
routes = config.get_routes()
|
|
134
|
+
|
|
135
|
+
stores = config.get_stores(base_url=base_url)
|
|
136
|
+
if len(stores) > 0:
|
|
137
|
+
raise ValueError('One or more files in this configuration have been provided via Zarr store, which can only be loaded via the widget. Either use VitessceConfig.widget or VitessceConfig.display (instead of .web_app), or provide the files via _path or _url (rather than _store) parameters.')
|
|
138
|
+
|
|
134
139
|
serve_routes(config, routes, use_port)
|
|
135
140
|
vitessce_url = f"http://vitessce.io/#?theme={theme}&url=data:," + quote_plus(
|
|
136
141
|
json.dumps(config_dict))
|
|
@@ -626,7 +631,7 @@ class VitessceWidget(anywidget.AnyWidget):
|
|
|
626
631
|
|
|
627
632
|
next_port = DEFAULT_PORT
|
|
628
633
|
|
|
629
|
-
js_package_version = Unicode('3.6.
|
|
634
|
+
js_package_version = Unicode('3.6.10').tag(sync=True)
|
|
630
635
|
js_dev_mode = Bool(False).tag(sync=True)
|
|
631
636
|
custom_js_url = Unicode('').tag(sync=True)
|
|
632
637
|
plugin_esm = List(trait=Unicode(''), default_value=[]).tag(sync=True)
|
|
@@ -639,7 +644,7 @@ class VitessceWidget(anywidget.AnyWidget):
|
|
|
639
644
|
|
|
640
645
|
store_urls = List(trait=Unicode(''), default_value=[]).tag(sync=True)
|
|
641
646
|
|
|
642
|
-
def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.6.
|
|
647
|
+
def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.6.10', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, prefer_local=True, invoke_timeout=300000, invoke_batched=True, page_mode=False, page_esm=None, prevent_scroll=True):
|
|
643
648
|
"""
|
|
644
649
|
Construct a new Vitessce widget.
|
|
645
650
|
|
|
@@ -775,7 +780,7 @@ class VitessceWidget(anywidget.AnyWidget):
|
|
|
775
780
|
# Launch Vitessce using plain HTML representation (no ipywidgets)
|
|
776
781
|
|
|
777
782
|
|
|
778
|
-
def ipython_display(config, height=600, theme='auto', base_url=None, host_name=None, uid=None, port=None, proxy=False, js_package_version='3.6.
|
|
783
|
+
def ipython_display(config, height=600, theme='auto', base_url=None, host_name=None, uid=None, port=None, proxy=False, js_package_version='3.6.10', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, page_mode=False, page_esm=None):
|
|
779
784
|
from IPython.display import display, HTML
|
|
780
785
|
uid_str = "vitessce" + get_uid_str(uid)
|
|
781
786
|
|
vitessce/wrappers.py
CHANGED
|
@@ -12,8 +12,6 @@ from pathlib import PurePath, PurePosixPath
|
|
|
12
12
|
import warnings
|
|
13
13
|
import zarr
|
|
14
14
|
|
|
15
|
-
import numpy as np
|
|
16
|
-
|
|
17
15
|
if TYPE_CHECKING:
|
|
18
16
|
import lamindb as ln
|
|
19
17
|
from spatialdata import SpatialData
|
|
@@ -29,7 +27,7 @@ from vitessce.file_def_utils import (
|
|
|
29
27
|
gen_obs_labels_schema,
|
|
30
28
|
gen_obs_sets_schema,
|
|
31
29
|
gen_sdata_image_schema,
|
|
32
|
-
|
|
30
|
+
gen_sdata_obs_segmentations_schema,
|
|
33
31
|
gen_sdata_obs_spots_schema,
|
|
34
32
|
gen_sdata_obs_sets_schema,
|
|
35
33
|
gen_sdata_obs_feature_matrix_schema,
|
|
@@ -1401,7 +1399,7 @@ SpatialDataWrapperType = TypeVar('SpatialDataWrapperType', bound='SpatialDataWra
|
|
|
1401
1399
|
|
|
1402
1400
|
class SpatialDataWrapper(AnnDataWrapper):
|
|
1403
1401
|
|
|
1404
|
-
def __init__(self, sdata_path: Optional[str] = None, sdata_url: Optional[str] = None, sdata_store: Optional[Union[str, zarr.storage.StoreLike]] = None, sdata_artifact: Optional[ln.Artifact] = None, image_path: Optional[str] = None, region: Optional[str] = None, coordinate_system: Optional[str] = None,
|
|
1402
|
+
def __init__(self, sdata_path: Optional[str] = None, sdata_url: Optional[str] = None, sdata_store: Optional[Union[str, zarr.storage.StoreLike]] = None, sdata_artifact: Optional[ln.Artifact] = None, image_path: Optional[str] = None, region: Optional[str] = None, coordinate_system: Optional[str] = None, obs_spots_path: Optional[str] = None, obs_segmentations_path: Optional[str] = None, table_path: str = "tables/table", coordination_values=None, **kwargs):
|
|
1405
1403
|
"""
|
|
1406
1404
|
Wrap a SpatialData object.
|
|
1407
1405
|
|
|
@@ -1421,8 +1419,8 @@ class SpatialDataWrapper(AnnDataWrapper):
|
|
|
1421
1419
|
:type affine_transformation: Optional[np.ndarray]
|
|
1422
1420
|
:param obs_spots_path: Location of shapes that should be interpreted as spot observations, by default None
|
|
1423
1421
|
:type obs_spots_path: Optional[str]
|
|
1424
|
-
:param
|
|
1425
|
-
:type
|
|
1422
|
+
:param obs_segmentations_path: Path to a labels or shapes element (segmentation bitmask label image or segmentation polygon shapes), by default None
|
|
1423
|
+
:type obs_segmentations_path: Optional[str]
|
|
1426
1424
|
"""
|
|
1427
1425
|
raise_error_if_zero_or_more_than_one([
|
|
1428
1426
|
sdata_path,
|
|
@@ -1437,14 +1435,21 @@ class SpatialDataWrapper(AnnDataWrapper):
|
|
|
1437
1435
|
kwargs.get('adata_artifact', None)
|
|
1438
1436
|
])
|
|
1439
1437
|
super().__init__(adata_path=sdata_path, adata_url=sdata_url, adata_store=sdata_store, adata_artifact=sdata_artifact, **kwargs)
|
|
1438
|
+
if "labels_path" in kwargs:
|
|
1439
|
+
warnings.warn("`labels_path` is deprecated. Use `obs_segmentations_path` instead.", DeprecationWarning)
|
|
1440
|
+
self._obs_segmentations_path = kwargs["labels_path"]
|
|
1441
|
+
if "shapes_path" in kwargs:
|
|
1442
|
+
warnings.warn("`shapes_path` is deprecated. Use `obs_segmentations_path` instead.", DeprecationWarning)
|
|
1443
|
+
if "affine_transformation" in kwargs:
|
|
1444
|
+
warnings.warn("`affine_transformation` is deprecated. Store transformations in the SpatialData object, then specify `coordinate_system`.", DeprecationWarning)
|
|
1445
|
+
|
|
1440
1446
|
self.local_dir_uid = make_unique_filename(".sdata.zarr")
|
|
1441
1447
|
self._image_path = image_path
|
|
1442
1448
|
self._region = region
|
|
1443
1449
|
self._coordinate_system = coordinate_system
|
|
1444
|
-
self._affine_transformation = affine_transformation
|
|
1445
1450
|
self._kwargs = kwargs
|
|
1446
1451
|
self._obs_spots_path = obs_spots_path
|
|
1447
|
-
self.
|
|
1452
|
+
self._obs_segmentations_path = obs_segmentations_path
|
|
1448
1453
|
if self._adata_path is not None:
|
|
1449
1454
|
self.zarr_folder = 'spatialdata.zarr'
|
|
1450
1455
|
self.obs_type_label = None
|
|
@@ -1530,8 +1535,8 @@ class SpatialDataWrapper(AnnDataWrapper):
|
|
|
1530
1535
|
options = gen_sdata_obs_feature_matrix_schema(options, self._expression_matrix, self._gene_var_filter, self._matrix_gene_var_filter, self._region)
|
|
1531
1536
|
options = gen_sdata_obs_sets_schema(options, self._obs_set_elems, self._obs_set_names, self._table_path, self._region)
|
|
1532
1537
|
options = gen_sdata_obs_spots_schema(options, self._obs_spots_path, self._table_path, self._region, self._coordinate_system)
|
|
1533
|
-
options = gen_sdata_image_schema(options, self._image_path, self._coordinate_system
|
|
1534
|
-
options =
|
|
1538
|
+
options = gen_sdata_image_schema(options, self._image_path, self._coordinate_system)
|
|
1539
|
+
options = gen_sdata_obs_segmentations_schema(options, self._obs_segmentations_path, self._table_path, self._coordinate_system)
|
|
1535
1540
|
options = gen_feature_labels_schema(self._feature_labels, options)
|
|
1536
1541
|
if len(options.keys()) > 0:
|
|
1537
1542
|
obj_file_def = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vitessce
|
|
3
|
-
Version: 3.6.
|
|
3
|
+
Version: 3.6.8
|
|
4
4
|
Summary: Jupyter widget facilitating interactive visualization of spatial single-cell data with Vitessce
|
|
5
5
|
Project-URL: repository, https://github.com/vitessce/vitessce-python
|
|
6
6
|
Author-email: Mark Keller <mark_keller@hms.harvard.edu>
|
|
@@ -3,13 +3,13 @@ vitessce/config.py,sha256=GLiFSYh-ACJvQhrEVu3-nqFj1HtlCF86V_mMDljvwFo,81206
|
|
|
3
3
|
vitessce/config_converter.py,sha256=IRPnGPGaETvJbYZNUv2pe54SHHHsDY9VWo3JRjSI5FM,14681
|
|
4
4
|
vitessce/constants.py,sha256=nBMH55TcnSavcpvYE-epyx3cJ0iDS31eHsL_1e9qb9M,15360
|
|
5
5
|
vitessce/export.py,sha256=L7j5sVC0nBSqGocFWQyyHImSiAF4IjXhmqV1QtpuNc4,3874
|
|
6
|
-
vitessce/file_def_utils.py,sha256=
|
|
6
|
+
vitessce/file_def_utils.py,sha256=heFDrJMO4fYoondtVALjUiIxe4swOiR24KVGEu8ZTM0,6688
|
|
7
7
|
vitessce/repr.py,sha256=qMmefmZ3E-3sRVxeI5q1DTZnfuwbXKiA85eyqk5MCT4,2287
|
|
8
8
|
vitessce/responses.py,sha256=Z6Wo4AXN-RyzmxMPhSuhpIsHTItHM4GyIgMLGoVEYcU,339
|
|
9
9
|
vitessce/routes.py,sha256=U8T-L-3QCD_tAbPF8LsUlSMhPWNbyzbLNUnxP9Z9s9o,2140
|
|
10
10
|
vitessce/utils.py,sha256=obzjj65qsagu60_yuhGc-0jmHO-BW0Y-bDs0FgrBqLY,981
|
|
11
|
-
vitessce/widget.py,sha256=
|
|
12
|
-
vitessce/wrappers.py,sha256=
|
|
11
|
+
vitessce/widget.py,sha256=hZ_125LOPck9-2U6uvdVKqbMHgpg9iPmI_Xc1cGQsJE,34985
|
|
12
|
+
vitessce/wrappers.py,sha256=gbJggLGoFTRa1odnBvBDE5EspQ8vc_CpNq_eTbZBGSM,76091
|
|
13
13
|
vitessce/data_utils/__init__.py,sha256=3mWi1lMjoj4_dNbhMOvyE-HEJu0qpMzcmkhfz_5T6n8,361
|
|
14
14
|
vitessce/data_utils/anndata.py,sha256=iLa5-bRezHgBzL_XCHO7w0pc0RQ4urzZbDsqJbBYeCk,10668
|
|
15
15
|
vitessce/data_utils/entities.py,sha256=X8enC_TQbgwBzjgD1x53IPS6aVr9wyP0s-NLuYBeMeU,11705
|
|
@@ -18,7 +18,7 @@ vitessce/data_utils/ome.py,sha256=tJHlSHbZTxpjRgYfTxbYMS9zSnSHQwJVWPZpREAvHtU,55
|
|
|
18
18
|
vitessce/widget_plugins/__init__.py,sha256=lto2GXnc7KwjIoT-jvzyRYLj0XTJG3uxoX45Hc9EcWA,82
|
|
19
19
|
vitessce/widget_plugins/demo_plugin.py,sha256=14S7nOxdlKSxIHw9DUcNCN83NE_U1EMPy2D4k0FDues,1797
|
|
20
20
|
vitessce/widget_plugins/spatial_query.py,sha256=CYxvmMT1Je_jguikPROQxlegkPgIIzemKGbZSJfZMyI,12314
|
|
21
|
-
vitessce-3.6.
|
|
22
|
-
vitessce-3.6.
|
|
23
|
-
vitessce-3.6.
|
|
24
|
-
vitessce-3.6.
|
|
21
|
+
vitessce-3.6.8.dist-info/METADATA,sha256=Qo9mzHK9MCLR7aEbmdwa0E5YAQCOcet9G0pPcRc8G-U,9826
|
|
22
|
+
vitessce-3.6.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
23
|
+
vitessce-3.6.8.dist-info/licenses/LICENSE,sha256=sNNpI0PQ57AW8_XnTAjU5Yw8YBA_DRNkVHrHYpCIhRU,1067
|
|
24
|
+
vitessce-3.6.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|