satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.27k stars 910 forks source link

how to implement the the old "gene.groups" option in SplitDotPlotGG #3174

Closed jingzhangorg closed 4 years ago

jingzhangorg commented 4 years ago

Hi, I am trying to replicate the DotPlot by gene groups as shown in the previous issue (https://github.com/satijalab/seurat/issues/681)

However, SplitDotPlotGG was replaced by DotPlot, where I can not find the option for gene.groups (Add labeling bars to the top of the plot). Would you please suggest how to plot a figure with different gene panels?

Also, another question is that how to add a hierarchical clustering of the clusters on one side of the DotPlot? I searched but did not see an option here

Thank you

meltager commented 4 years ago

Me either having this problem, it was every convenient to have the labels of the genes on the same figure as well as the separation of genes make it easier to realise the graph and the marker genes, please if there is any method to do it post it, if not please consider adding it back in the next versions

jaisonj708 commented 4 years ago

Feature groups and hierarchical clustering of idents in DotPlot is now available in the development version of Seurat. To install the development version of Seurat, please see the instructions here.

Example usage:

library(SeuratData)
InstallData("pbmc3k")
data("pbmc3k")
pbmc3k
Idents(pbmc3k) <- as.vector(pbmc3k[['seurat_annotations',drop=T]])
Idents(pbmc3k, which(is.na(Idents(pbmc3k)))) <- "Unknown"

Bcellmarks  <- c("CD19","CD79A","CD79B","MS4A1")
HLAmarks <- c("HLA-DQA1", "HLA-DQB1", "HLA-DRB3")
Monomarks <- c("CD14","VCAN","FCN1")
Tcellmarks <- c("CD3D","CD3E","CD3G","IL7R","TRAC","TRGC2","TRDC", "CD8A", "CD8B", "CD4")
DCmarks <- c(HLAmarks,"CLEC10A","CLEC9A")
platelet <- c("GP9","PF4")

features <- list("B cell" = Bcellmarks, "T cell" = Tcellmarks, "DC" = DCmarks, "Monocyte" = Monomarks, "Platelet" = platelet)
DotPlot(object = pbmc3k, features=features, cluster.idents=T) + theme(axis.text.x = element_text(angle = 90))
Screen Shot 2020-07-08 at 3 47 05 PM
jorgedb98 commented 7 months ago

Hello, Is there a way to modify the theme of the labels for the "B cell" and so on the top of the plot? Like adding angle and face using theme in ggplot?