I want to create a sub-cluster and then plot it from a Seurat Object. For example from a group of different cell types I want to plot just the dendritic cells in R-studio. How can I do that?
I want to create a sub-cluster and then plot it from a Seurat Object. For example from a group of different cell types I want to plot just the dendritic cells in R-studio. How can I do that?
If you are using DOHeatmap to plot, you can pass the subcluster using the WhichCells function.
# check the syntax, as I go by heart
Idents(srtObject) <- "cellID"
myDC <- WhichCells(object = srtObject, idents = "cDC2A")
DoHeatmap(srtObject, cells = myDC)
Otherwise you can use subset
to obtain a seurat object only containing your cells of interest.
Idents(srtObject) <- "cellID"
newObject <- subset(srtObject, idents = "cDC2A")
Idents(dc) <-"CellID" newObj <- subset(dc,Idents="cDC2A") Warning: The following arguments are not used: Idents Error in CellsByIdentities(object = object, cells = cells, ...) : unused argument (Idents = "cDC2A") myDC<-WhichCells(dc,idents = "cDC2A") Error in WhichCells.Seurat(dc, idents = "cDC2A") : Cannot find the following identities in the object: cDC2A
top 10 HVG
myDC<-WhichCells(dc,idents = "cDC2") Error in WhichCells.Seurat(dc, idents = "cDC2") : Cannot find the following identities in the object: cDC2
Still facing errors, can we give cluster numbers instead of cluster identity ?
like myDC<-WhichCells(dc,idents =Cluster0)
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
want to make a graph like that