dviraran / SingleR

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

Cannot annotate cells #107

Closed AmelZulji closed 4 years ago

AmelZulji commented 5 years ago

Hi Dvir,

Thank you for developing such a useful tool!

I am trying to get familiar with SingleR and using it to annotate my human spinal cord data set. However, although I am pretty sure that the cells I am trying to analyse are oligodendrocytes (based on the expression of Oligodendrocytes-specific genes), SingleR failed to annotate cells. I am using following code:

singler = CreateSinglerObject(counts = oligoscounts, annot = NULL, project.name="analysis", min.genes = 0,
                              technology = "10X", species = "Human", citation = "",
                              ref.list = list(hpca), normalize.gene.length = F, variable.genes = "de",
                              fine.tune = T, do.signatures = T, clusters = NULL, do.main.types = T, 
                              reduce.file.size = T, numCores = SingleR.numCores)
singler$meta.data$xy = oligos1@reductions$tsne@cell.embeddings
singler$meta.data$clusters = oligos1@active.ident
out = SingleR.PlotTsne(singler$singler[[1]]$SingleR.single,
                       singler$meta.data$xy,do.label = F,
                       do.letters = T,labels = singler$meta.data$orig.ident, 
                       dot.size = 1.3,alpha=0.5,label.size = 6)

out$p

The result is: SingleR

Am I doing something wrong, or something else is problem?

Any help will be appreciated.

Kind regards, Amel Zulji

dviraran commented 5 years ago

You are presenting the orig.ident, not the cell annotations. Your input for orig.ident is NA. Just remove labels = singler$meta.data$orig.ident for the SingleR.PlotTsne call and it should work