Splitting a Nebulosa (Seurat wrapper) visualization by treatment group
2
0
Entering edit mode
2.9 years ago
Aaron ▴ 30

In the Seurat wrapper-package "Nebulosa," is there a way to split a plot_density() visualization by e.g. treatment groups, like, for example, the "split.by" option in Seurat's FeaturePlot()? I have been looking through the documentation but haven't found anything explicit. If not, how might I (a very basic R user) be able to achieve this? For reference, I have linked the plot_density() documentation here (https://rdrr.io/bioc/Nebulosa/man/plot_density.html).

Nebulosa Seurat plot_density • 2.8k views
ADD COMMENT
7
Entering edit mode
2.9 years ago
theHumanBorch ▴ 240

plot_density() is returning a ggplot2 object, so you can actually modify using that system, for instance facet_grid() or facet_wrap()

plot_density(SeuratObj, "feature") + 
    facet_grid(.~SeuratObj$variable)

enter image description here

ADD COMMENT
0
Entering edit mode

@theHumanBorch this is perfect, thank you!

ADD REPLY
1
Entering edit mode
2.9 years ago

Doesn't appear possible with that package. You can get something similar with dittoSeq's dittoDimHex function, but it won't be using a kernel density estimate or any sort of imputation, just binning cells and displaying median, average, total expression, etc.

It has a typical split.by argument for faceting.

ADD COMMENT

Login before adding your answer.

Traffic: 1110 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6