diff --git a/pyproject.toml b/pyproject.toml index e5d02b6..8180e13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "vitessce" -version = "3.7.8" +version = "3.7.9" authors = [ { name="Mark Keller", email="mark_keller@hms.harvard.edu" }, ] diff --git a/src/vitessce/widget.py b/src/vitessce/widget.py index c26d4b3..10693f0 100644 --- a/src/vitessce/widget.py +++ b/src/vitessce/widget.py @@ -181,7 +181,7 @@ def get_uid_str(uid): "react-dom": "https://cdn.vitessce.io/react-dom@18.2.0/index.js", "react-dom/client": "https://cdn.vitessce.io/react-dom@18.2.0/es2022/client.mjs", // Replaced with version-specific URL below. - "vitessce": "https://cdn.vitessce.io/vitessce@3.8.5/dist/index.min.js", + "vitessce": "https://cdn.vitessce.io/vitessce@VERSION/dist/index.min.js", }, }; /* @@ -191,7 +191,7 @@ def get_uid_str(uid): "react-dom": "https://cdn.vitessce.io/react-dom@18.2.0/index_dev.js", "react-dom/client": "https://cdn.vitessce.io/react-dom@18.2.0/es2022/client.development.mjs", // Replaced with version-specific URL below. - "vitessce": "https://cdn.vitessce.io/@vitessce/dev@3.8.5/dist/index.js", + "vitessce": "https://cdn.vitessce.io/@vitessce/dev@VERSION/dist/index.js", }, }; */ @@ -729,7 +729,7 @@ class VitessceWidget(anywidget.AnyWidget): next_port = DEFAULT_PORT - js_package_version = Unicode('3.8.5').tag(sync=True) + js_package_version = Unicode('3.8.8').tag(sync=True) js_dev_mode = Bool(False).tag(sync=True) custom_js_url = Unicode('').tag(sync=True) plugin_esm = List(trait=Unicode(''), default_value=[]).tag(sync=True) @@ -742,7 +742,7 @@ class VitessceWidget(anywidget.AnyWidget): store_urls = List(trait=Unicode(''), default_value=[]).tag(sync=True) - def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.8.5', 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, server_host=None): + def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.8.8', 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, server_host=None): """ Construct a new Vitessce widget. Not intended to be instantiated directly; instead, use ``VitessceConfig.widget``. @@ -876,7 +876,7 @@ def _plugin_command(self, params, buffers): # Launch Vitessce using plain HTML representation (no ipywidgets) -def ipython_display(config, height=600, theme='auto', base_url=None, host_name=None, uid=None, port=None, proxy=False, js_package_version='3.8.5', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, page_mode=False, page_esm=None, server_host=None): +def ipython_display(config, height=600, theme='auto', base_url=None, host_name=None, uid=None, port=None, proxy=False, js_package_version='3.8.8', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, page_mode=False, page_esm=None, server_host=None): from IPython.display import display, HTML uid_str = "vitessce" + get_uid_str(uid) diff --git a/src/vitessce/wrappers.py b/src/vitessce/wrappers.py index c05bd53..b7a5380 100644 --- a/src/vitessce/wrappers.py +++ b/src/vitessce/wrappers.py @@ -1432,6 +1432,10 @@ def __init__(self, sdata_path: Optional[str] = None, sdata_url: Optional[str] = :type obs_segmentations_path: Optional[str] :param obs_points_path: Path to a points element, by default None :type obs_points_path: Optional[str] + :param str feature_labels_path: Path to a table var column containing feature labels (e.g., alternate gene symbols), instead of the default index column of the `var` dataframe. + :param list[str] obs_embedding_paths: Column names like `['obsm/X_umap', 'obsm/X_pca']` for showing scatterplots + :param list[str] obs_embedding_names: Overriding names like `['UMAP', 'PCA']` for displaying above scatterplots + :param list[str] obs_embedding_dims: Dimensions along which to get data for the scatterplot, like `[[0, 1], [4, 5]]` where `[0, 1]` is just the normal x and y but `[4, 5]` could be comparing the third and fourth principal components, for example. """ raise_error_if_zero_or_more_than_one([ sdata_path, @@ -1551,6 +1555,7 @@ def generator(base_url): options = gen_sdata_obs_segmentations_schema(options, self._obs_segmentations_path, self._table_path, self._coordinate_system) options = gen_sdata_obs_points_schema(options, self._obs_points_path, self._table_path, self._coordinate_system) options = gen_feature_labels_schema(self._feature_labels, options) + options = gen_obs_embedding_schema(options, self._mappings_obsm, self._mappings_obsm_names, self._mappings_obsm_dims) if len(options.keys()) > 0: obj_file_def = { "fileType": ft.SPATIALDATA_ZARR_ZIP.value if self.is_zip else ft.SPATIALDATA_ZARR.value, diff --git a/tests/test_wrappers.py b/tests/test_wrappers.py index 4479055..046108f 100644 --- a/tests/test_wrappers.py +++ b/tests/test_wrappers.py @@ -481,7 +481,10 @@ def test_spatial_data_with_base_dir(self): 'obsSets': [{'name': 'Cell Type', 'path': 'obs/CellType'}], 'tablePath': 'tables/table' }, - 'image': {'path': 'images/picture'} + 'image': {'path': 'images/picture'}, + 'obsEmbedding': [ + {'dims': [0, 1], 'embeddingType': 'UMAP', 'path': 'obsm/X_umap'}, + ], }}) def test_spatial_data_with_base_dir_2(self):