-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vitessce Integration Design Document #1074
Comments
@ngreenwald @camisowers @alex-l-kong @jranek Let me know your thoughts. |
This looks great! If we're already going to be looking into AnnData for post-clustering, seems like we should plan on using that for vitesse as well, at least until we make the full switch over to spatialdata. Is there a way to show segmentations/masks of things that aren't cells? For example, if we have two or three regions in a given image, is there a way to highlight which cells are in which regions? Or maybe display the regions as a layer? If it's the case that adding more visualizations isn't much work, it would be great to take a look through what other types of visualizations people have done with Vitesse, so we can make a priority list of which stuff to implement in MVP, which to add to the queue, etc. |
Maybe tomorrow you, @camisowers, and @jranek can have a brief discussion about how to split up the tasks for AnnData conversion. Seems like 1 important thing to have is a notebook that takes a finalized cell table and creates an AnnData object. Are there any other tools that would be broadly useful? |
@ngreenwald Yeah, segmentation masks can be of anything and you can have multiple of them, and use layers to turn them on and off. |
Looks cool! We can take the existing OME TIFF conversion code and add it into a notebook that also does the AnnData conversion for the cell table. |
Great stuff. I think we can also add something like this into the Pixie pipeline where we store the training and subsetted table as AnnData as well. It will also allow us to visualize the pixel and cell masks a lot more easily. The How interactive/customizable is Vitesse for something like the metacluster remapping process? If it will be easy to integrate here then, radically speaking, we could nuke the existing pipeline (it's really clunky). |
@alex-l-kong Vitesse would not be able to edit data for the metacluster remapping process, Napari however, would be ideal for that. It's mainly "read-only" intended for data showcases for publications, or projects. |
This is for internal use only; if you'd like to open an issue or request a new feature, please open a bug or enhancement issue
Instructions
This document should be filled out prior to embarking on any project that will take more than a couple of hours to complete. The goal is to make sure that everyone is on the same page for the functionality and requirements of new features. Therefore, it's important that this is detailed enough to catch any misunderstandings beforehand. For larger projects, it can be useful to first give a high-level sketch, and then go back and fill in the details. For smaller ones, filling the entire thing out at once can be sufficient.
Relevant background
Vitessce is a visualization tool for spatial single cell data. It can be used as a standalone web application, an embedded web component, or as a widget in Jupyter Lab. HuBMAP uses this to visualize certain datasets on their data portal.
Here is a brief overview of the components for a Vitessce HuBMAP Dataset: HBM892.CCDZ.345. One thing that's nice is we can download the Jupyter Notebook which creates this Vitessce visualization.
This visualization is composed of the following Views:
There are coordination values and scopes with which "glue" views together. For example, hovering over a point in the UMAP scatter plot will also highlight the corresponding point in the Spatial view, along with the corresponding row in the Heatmap view.
Keep in mind that Vitessce works best with a single image per visualization.
File Types and File Formats
With Vitessce, there are many ways to organize the data for ingestion.
Implementation with current Cell Table + TIFF Files
Assuming we have a finalized Cell Table with respect to a single image, we can organize the data for a Vitessce visualization as follows:
Necessary - Observation Feature Matrix (csv)
Necessary - Observation Sets (csv)
Maps each observation (cell id) to one or more sets.
Mainly for assigning cells to clusters, cell types, groups, lineages, etc...
Necessary - Observation Segmentations (OME TIFF)
Necessary - Image (OME TIFF / OME Zarr)
Optional - Observation Embedding (csv)
Optional - [Feature labels / Observation Labels] (csv)
Implementation with AnnData + TIFF Files
In the case where we have an AnnData Zarr object, organizing the data is much easier.
Convert the FOV to a multichannel OME-TIFF.
For example, we mainly need to provide the following:
X
: The observation by feature matrix (cell-by-marker)obs
: The observation metadata (cell metadata)var
: The feature metadata (marker metadata)obsm
: The observation embeddings (UMAP, TSNE, etc...)X_
, whereX_umap
is the UMAP embedding ofX
.layers
: The image data (cell segmentation mask, image, etc...)Implementation with
SpatialData
In the case where we have a
SpatialData
object, it's more straightforward than theAnnData
implementation.We just need the
SpatialData
object subset with a particular FOV of interest. The image is aZarr
store, and theAnnData
is the Table object. The same notes aboutAnnData
apply.Creating Views and Coordination Values
Depending on the data, the use case you can organize views in multiple ways.
For example, with the Bone Marrow data, we have MIBI, MALDI, and HnE images. We can create a Vitessce visualization with the following views:
The user has artistic freedom to select what works best for them and the data they're trying to visualize. This is an iterative process which can be run in a Jupyter Notebook.
Example Code from some HuBMAP stuff in July:
This is a rather basic view with just the Image, segmentation mask and a layer controller for the channels.
Vitessce configurations can be applied to other images, segmentation masks and cell tables as well. So a user can develop their ideal visualization structure on one FOV, and then easily apply it to other FOVs of interest.
It is not much more effort to go from a simple view such as in the example code, to a complex view like the HuBMAP one.
Exporting and Data Hosting
Once the user is satisfied with their current Vitessce Visualization, the configuration schema can be exported (along with the data) to a Zarr store a supplementary JSON file.
This can be loaded locally, or ideally hosted on a cloud service (AWS, GCloud) for easy storage.
Viewing the Data
When it comes to viewing the data object, we can set up a lab GitHub Pages site, or add the view to the existing lab site.
Timeline
Estimated date when a fully implemented version will be ready for review: N/A
Estimated date when the finalized project will be merged in: N/A
Resources
There are a lot of examples and resources for Vitessce.
More examples out in the wild:
The text was updated successfully, but these errors were encountered: