Giter VIP home page Giter VIP logo

Comments (8)

keller-mark avatar keller-mark commented on June 21, 2024 1

I will close this now that we have vitessce/vitessce#807 and open a new issue for integrating it here

from vitessce-python.

keller-mark avatar keller-mark commented on June 21, 2024

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.

keller-mark avatar keller-mark commented on June 21, 2024

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.

ilan-gold avatar ilan-gold commented on June 21, 2024

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.

keller-mark avatar keller-mark commented on June 21, 2024

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.

keller-mark avatar keller-mark commented on June 21, 2024

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.

ilan-gold avatar ilan-gold commented on June 21, 2024

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

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.

keller-mark avatar keller-mark commented on June 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.