Comments (8)
I will close this now that we have vitessce/vitessce#807 and open a new issue for integrating it here
from vitessce-python.
Yes 'CellType'
is just specific to one .h5ad
file I was working with at the time. I started to move away from it on this branch https://github.com/vitessce/vitessce-python/blob/keller-mark/widget-method/vitessce/wrappers.py#L315 where I added a parameter for the AnnDataWrapper
contructor to identify which column of adata.obs
to use for cell sets. This is still a bit limiting though since as you point out there can be multiple columns with categorical data and we may want to output all of them as multiple cell set hierarchies. Maybe we can instead support a list of columns, like cell_set_obs_cols = []
and then the user could write something like AnnDataWrapper(adata, cell_set_obs_cols=["CellType", "leiden"])
based on the columns they want to use for cell sets.
from vitessce-python.
When reading straight from JS, I think it may be helpful if the options object is reversed:
{
"type": "cell-sets",
"fileType": "anndata-cell-sets.zarr",
"url": "http://127.0.0.1:8081/habib.zarr",
"options": {
"sets": ["obs.cellType", "obs.leiden"]
}
and
{
"type": "cells",
"fileType": "anndata-cells.zarr",
"url": "http://127.0.0.1:8081/habib.zarr",
"options": {
"xy": "obsm.spatial",
"poly": "obsm.polygon",
"mappings": {
"UMAP": {
"key": "obsm.X_umap",
"dims": [0, 1],
},
"PCA": {
"key": "obsm.X_pca",
"dims": [3, 5], // use principal components 4 and 6
},
}
}
},
from vitessce-python.
I was just typing that...the sets example was making me think that the direction was wrong in how I laid things out... I am still not a fan of magic strings but I like where it's headed. I think we should try to cover our bases in Python around customization as much as possible and then port it to Javascript/JSON since once it's out in JS, we can't take it back whereas here we have a bit of a sandbox here to play in. I'll try loading Matt's datasets as well as going out and looking for others on the internet.
from vitessce-python.
When these are the values rather than the keys, we don't need to use magic strings, we can use arrays like ["obsm", "X_umap"]
which would mean obsm.X_umap
from vitessce-python.
Maybe
{
"type": "cell-sets",
"fileType": "anndata-cell-sets.zarr",
"url": "http://127.0.0.1:8081/habib.zarr",
"options": {
"sets": [["obs","CellType"], ["obs", "leiden"]]
}
where each element of "sets" is a path to the column that should be used to define each cell set hierarchy
from vitessce-python.
When these are the values rather than the keys, we don't need to use magic strings, we can use arrays like
["obsm", "X_umap"]
which would meanobsm.X_umap
I was referring more to sets
as a key as opposed to xy
and poly
for example, but perhaps I am being too nit-picky. sets
does not exist in our json schema but xy
and poly
do.
from vitessce-python.
Ah I see. Actually then something more like the cell-sets-tabular schema may be better https://github.com/hubmapconsortium/vitessce/blob/master/src/schemas/cell-sets-tabular.schema.json
Maybe
{
"type": "cell-sets",
"fileType": "anndata-cell-sets.zarr",
"url": "http://127.0.0.1:8081/habib.zarr",
"options": [
{
"group_name": "Cell Type",
"set_name": ["obs", "CellType"],
"prediction_score": ["obs", "CellTypeScore"]
},
{
"group_name": "Leiden Clustering",
"set_name": ["obs", "leiden"]
}
]
where set_name
and prediction_score
are assumed to be paths to AnnData columns, and group_name
is assumed to be the name of the hierarchy, and cell_id
is not needed since it would be automatically assigned based on the Cell IDs in the AnnData index.
This has the benefit of easily supporting the prediction score/confidence values as well.
from vitessce-python.
Related Issues (20)
- Convert spatialdata-plot plotting tree to Vitessce config
- Failed to load model class "Anymodel" HOT 2
- Publish a Vitessce notebook on Posit Connect HOT 11
- AnnDataWrapper - support for obsSpots, obsPoints, etc.
- OmeTiffWrapper - support coordinationValues and fileType: "image.ome-tiff"
- Minimal example for obsSegmentations.json for visualizing polygons in Spatial View HOT 2
- Adding scale bar to spatial view image
- ValueError: data too large for non-BigTIFF file HOT 4
- Additional improvements to adata_to_multivec_zarr function
- Add option for widget to communicate directly with Zarr store (no local HTTP server) HOT 2
- Bumping supported Anndata Version? HOT 1
- Support automatic instantiation of Wrapper objects HOT 2
- Support using JSX for writing plugin views
- Setting colors for obsSets? HOT 2
- Helper function to use adata.uns[obs_set_col + "_colors"] for initial obs set colors
- Notebooks environment.yml PackageNotFoundError for starlette==0.14.0
- Notebooks errors (list)
- Adding Vitessce widgets to a visualization dashboard HOT 1
- Define a plugin class/dataclass to couple on_config_change and anywidget.invoke handlers with plugin_esm
- Support writing plugin_esm using local file with anywidget FileContents
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vitessce-python.