Skip to content

Commit 2eccf8c

Browse files
committed
Support featureLabels and obsEmbedding in SpatialDataWrapper
1 parent 424313f commit 2eccf8c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/vitessce/wrappers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,6 +1432,10 @@ def __init__(self, sdata_path: Optional[str] = None, sdata_url: Optional[str] =
14321432
:type obs_segmentations_path: Optional[str]
14331433
:param obs_points_path: Path to a points element, by default None
14341434
:type obs_points_path: Optional[str]
1435+
: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.
1436+
:param list[str] obs_embedding_paths: Column names like `['obsm/X_umap', 'obsm/X_pca']` for showing scatterplots
1437+
:param list[str] obs_embedding_names: Overriding names like `['UMAP', 'PCA']` for displaying above scatterplots
1438+
: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.
14351439
"""
14361440
raise_error_if_zero_or_more_than_one([
14371441
sdata_path,
@@ -1551,6 +1555,7 @@ def generator(base_url):
15511555
options = gen_sdata_obs_segmentations_schema(options, self._obs_segmentations_path, self._table_path, self._coordinate_system)
15521556
options = gen_sdata_obs_points_schema(options, self._obs_points_path, self._table_path, self._coordinate_system)
15531557
options = gen_feature_labels_schema(self._feature_labels, options)
1558+
options = gen_obs_embedding_schema(options, self._mappings_obsm, self._mappings_obsm_names, self._mappings_obsm_dims)
15541559
if len(options.keys()) > 0:
15551560
obj_file_def = {
15561561
"fileType": ft.SPATIALDATA_ZARR_ZIP.value if self.is_zip else ft.SPATIALDATA_ZARR.value,

0 commit comments

Comments
 (0)