cellBrowser icon indicating copy to clipboard operation
cellBrowser copied to clipboard

feature request: split view based on annotation

Open kriemo opened this issue 4 years ago • 7 comments

Commonly, collaborators using the cellbrowser request a "split" view to allow them to see cells from different samples/conditions/treatments in separate panes. They want to be able to split the dataset based on a cell annotation so that the distribution of features or other annotations can be rapidly visualized across samples/conditions/treatments. This is distinct from the split screen feature because the split screen shows all cells in each pane, whereas the proposed feature would only include cells from each unique annotation value.

From a coding perspective, when building the browser, perhaps annotations with no more than a few unique values (~4?) could be identified as valid annotations to allow the user to split by. The UI could then be changed to include an item under the View menu (e.g. split by attribute), or a separate button next to layouts ("split by"). When selected this could bring up a dropdown selection of annotations that are valid for the user to split the dataset.

Would it be possible to implement such a feature? I don't have experience with javascript, but could try to implement if there is interest. Thanks.

kriemo avatar Sep 17 '20 14:09 kriemo

Hi, @kriemo.

Interesting feature request. Do you have any images or sketches of what this would look like?

As an alternative, would a "hide all but selected" option be sufficient?

matthewspeir avatar Oct 12 '20 22:10 matthewspeir

Hi @matthewspeir , Thanks for the response. Very timely as another collaborator just requested the same feature.

Here's a sketch of the idea: split-feature-request-cb

A split-view feature is available in the loupe cell browser from 10x genomics, so I hope you don't mind me using their platform to provide another example of the proposed feature:

split-feature-request

This feature is very helpful when there are different conditions in the same experiment (e.g. WT v. KO, or 4 different development stages). With the split view you can quickly see the distribution of cells across each condition (and associated gene expression or annotations).

The "hide all but selected approach" would provide some of the proposed functionality if it could be applied to each split screen separately, although the # of conditions would be limited to 2 with the current split implementation.

kriemo avatar Oct 12 '20 23:10 kriemo

Hmmm...how about a button "only show these cells" on the right-side legend of the values? That would scale to more values...

maximilianh avatar Oct 13 '20 12:10 maximilianh

I think that would work. Would it be possible to "only show these cells" independently for each split screen?

kriemo avatar Oct 13 '20 15:10 kriemo

I finally got back to this. inspired by cellxgene, when you mouse over a cluster label, all the cluster's cells are highlighted and all others are colored in grey. Demo here: https://cells-test.gi.ucsc.edu/?ds=cortex-dev

I think this should solve the problem that is behind this ticket/feature request...

maximilianh avatar Jan 24 '24 16:01 maximilianh

Many thanks for getting back to this request and for your continued work on this project. The split view that I had in mind is different than highlighting cells based on an annotation and i believe would be a useful feature for the browser.

The functionality that I was proposing is instead the following:

  • allow the user to select a categorical annotation to use for the split view, such as the "RegionName" annotation in the https://cells-test.gi.ucsc.edu/?ds=cortex-dev dataset. Perhaps this could be a dropdown menu named "Split by Annotation" underneath the "Label by non-num. Annotation" menu.

  • Once selected the layout panel would be split into a grid of multiple panels, with one panel for each category in the annotation (e.g. 4 panels for the RegionName annotation, one for Cortex, GE, Choroid, and Presumptive cortex).

  • Each panel would only contain the cells from each respective annotation category, (e.g. only the Cortex cells in the Cortex pane)

  • It would be necessary to limit this "Split by annotation" option to annotations with a relatively small number of categories ( 25?) to avoid making too many panels that would be impossible to visualize.

With this "split by annotation" option the user could color cells by an annotation or gene expression value and rapidly assess the how the annotation or gene expression value is distributed across the annotation used for the split view. E.g. in the example from Oct 2020, if the dataset is split by a genotype annotation, then one could easily see how a gene expression value differs between WT vs KO cells.

A related request was in #253

kriemo avatar Feb 07 '24 21:02 kriemo

Hi Kent, many thanks for your suggestion and for sending in suggestions. The problem with multi-splitting is that - as you say - they don't work well when you have many splits...

Maybe we can track back a little to your "user story", the original problem, I have the impression that it's "the user could color cells by an annotation or gene expression value and rapidly assess the how the annotation or gene expression value is distributed across the annotation used for the split view."

I guess what you as the user want here is to see how one annotation is distributed in the cells split by another annotation. Wouldn't this be easier to see in violin/barchart/dotplots? Or just a barchart graph: you select e.g. "RegionName" and get one barchart or even pie chart per region, and on each, you can see the different percentages of values in the field "Cell type" are shown? I have a feeling that such a feature would solve your problem better and may be easier to implement that 20 different UMAP plots, where each has only 80 pixels of screen width?

We just got yet another request from another user, who also wants to see how two different annotation fields related to each other. This has come up a lot, I understand why "split screen" would solve it, but I want to make sure first that another, simpler plot, won't solve it better before I embark on a big rewrite of how split screen is organized internally...

On Wed, Feb 7, 2024 at 10:56 PM Kent Riemondy @.***> wrote:

Many thanks for getting back to this request and for your continued work on this project. The split view that I had in mind is different than highlighting cells based on an annotation and i believe would be a useful feature for the browser.

The functionality that I was proposing is instead the following:

allow the user to select a categorical annotation to use for the split view, such as the "RegionName" annotation in the https://cells-test.gi.ucsc.edu/?ds=cortex-dev dataset. Perhaps this could be a dropdown menu named "Split by Annotation" underneath the "Label by non-num. Annotation" menu.

Once selected the layout panel would be split into a grid of multiple panels, with one panel for each category in the annotation (e.g. 4 panels for the RegionName annotation, one for Cortex, GE, Choroid, and Presumptive cortex).

Each panel would only contain the cells from each respective annotation category, (e.g. only the Cortex cells in the Cortex pane)

It would be necessary to limit this "Split by annotation" option to annotations with a relatively small number of categories ( 25?) to avoid making too many panels that would be impossible to visualize.

With this "split by annotation" option the user could color cells by an annotation or gene expression value and rapidly assess the how the annotation or gene expression value is distributed across the annotation used for the split view. E.g. in the example from Oct 2020, if the dataset is split by a genotype annotation, then one could easily see how a gene expression value differs between WT vs KO cells.

A related request was in #253 https://github.com/maximilianh/cellBrowser/issues/253

— Reply to this email directly, view it on GitHub https://github.com/maximilianh/cellBrowser/issues/189#issuecomment-1933004365, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACL4TKJLMJA662XM6W7RIDYSP2CJAVCNFSM4RQR3PIKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJTGMYDANBTGY2Q . You are receiving this because you commented.Message ID: @.***>

maximilianh avatar Feb 12 '24 13:02 maximilianh