kanaverse / kana

Single cell analysis in the browser
https://kanaverse.org/kana/
MIT License
142 stars 12 forks source link

Feature request: Re-analysing a user-specified subset of data #112

Closed PeteHaitch closed 1 year ago

PeteHaitch commented 2 years ago

It would be great if it were possible to select a subset of cells and re-analyse that subset. E.g., In a dataset of PBMCs, select all 'B cells' (based on the cluster annotations) and re-analyse to look for subclusters within the B cell population. Is this something planned for future release or that would be feasible to implement?

jkanche commented 2 years ago

that's a great idea. we could enable this by making the cluster names clickable and automatically open a new session with this subset.

What really happens in the background is the app would subset the cells in that cluster, create a new h5ad and store this in the browser. Tracking the provenance of datasets and subsets is left to the user.

PeteHaitch commented 2 years ago

Awesome! Thank you for considering the suggestion and for making such a great app.

LTLA commented 1 year ago

It took a while, but we accidentally added this feature as a combination of other features.

The workflow goes like this:

This allows you to subset by cluster numbers or custom selections (choose 1 for cells inside the selection). And of course, you can pick any of your existing annotations if you want.

Admittedly, this isn't the streamlined experience I was thinking about in #120, but I would argue that this approach is more transparent and reproducible, as the user is obliged to save a copy of the original analysis. If we just added an "analyze subset" button directly, kana would have to keep track of the provenance of the subsets - tracking how they were generated in the configuration, invalidating them if the parent analysis changes, saving them in the results, etc...

PeteHaitch commented 1 year ago

Thanks!

If someone has a processed dataset in another format (e.g., .rds containing a SingleCellExperiment object) can they go directly to loading it and "subsetting by annotation"?

LTLA commented 1 year ago

Of course: Screenshot 2023-05-03 at 4 23 12 PM

PeteHaitch commented 1 year ago

Fantastic, thank you!