This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Sub clustering from Seurat Object

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?

scrna trajectory seurat pseudotime

enter image description here

want to make a graph like that

2 answers

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)

Log in to answer this question.