dviraran / SingleR

SingleR: Single-cell RNA-seq cell types Recognition (legacy version)
GNU General Public License v3.0
263 stars 98 forks source link

Does singleR re-do PCA and clustering? #82

Open Zepeng-Mu opened 5 years ago

Zepeng-Mu commented 5 years ago

Hi,

I am wondering whether singleR re-do PCA and clustering on my original Seurat object. Based on UMAP, the output from singleR is different from my Seurat object. But I do not think this is mentioned in the singleR method. Maybe I messed up my dataset, so I just want to make sure.

Thank you so much!

dviraran commented 5 years ago

Hi,

If you use the CreateSinglerSeuratObject function it creates a Seurat object before creating a SingleR object. If you already have a Seurat Object use the CreateSinglerObject function. Both are explained here.

Best, Dvir

Zepeng-Mu commented 5 years ago

This is really helpful. Thanks!

Zepeng-Mu commented 5 years ago

Hi, I am now creating a singleR object from my Seurat object.

singler <- CreateSinglerObject(
  counts = as.matrix(GetAssayData(seuratDt, slot = "counts", assay = "RNA")),
  annot = seuratDt@meta.data$seurat_clusters,
  project.name = "ST83_integrated",
  min.genes = 0,
  technology = "10X",
  species = "Human",
  ref.list = NULL,
  normalize.gene.length = F
)

singler$seurat <- seuratDt
singler$meta.data$orig.ident = seuratDt@meta.data$orig.ident

singler$meta.data$xy = seuratDt@reductions$umap@cell.embeddings
singler$meta.data$clusters = seuratDt@active.ident

But convertSingleR2Browser reports an error: Error in `.rowNamesDF<-`(x, value = value) : invalid 'row.names' length.

How could I solve this?

Thank you so much!

dviraran commented 5 years ago

Not sure what is going on. Try annot = NULL instead.

Zepeng-Mu commented 5 years ago

Unfortunately, annot = NULL does not work either.