dviraran / SingleR

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

invalid 'row.names' length when use convertSingleR2Browser #54

Open panxiaoguang opened 5 years ago

panxiaoguang commented 5 years ago

when i use

singler.new = convertSingleR2Browser(singler)

i have some error

Error in `.rowNamesDF<-`(x, value = value) : invalid 'row.names' length

my code is:

library(Seurat)
library(SingleR)
data<-Read10X(data.dir = '/Users/su/Documents/Single/hg38/filtered_gene_bc_matrices/GRCh38')
singler = CreateSinglerObject(counts=data, annot = NULL, project.name="ovary", min.genes = 0,
                              technology = "10X", species = "Human", citation = "",
                              ref.list = list(), normalize.gene.length = F, variable.genes = "de",
                              fine.tune = F, do.signatures = F, clusters = NULL, do.main.types = T, 
                              reduce.file.size = T, numCores = SingleR.numCores)
ovary<-readRDS("/Users/su/Documents/Single/hg38/ovary.rds")
singler$meta.data$orig.ident = ovary@meta.data$orig.ident
singler$meta.data$xy = ovary@reductions$umap@cell.embeddings # the umap coordinates
singler$meta.data$clusters = ovary@active.ident
singler.new = convertSingleR2Browser(singler)

everythings are ok except create new single objects

panxiaoguang commented 5 years ago

I think : first,I use CreateSinglerObject to create a single objects and cluster=null,but it still create a cluster ,however, my seurat also create a cluster . the two cluster is different

dviraran commented 5 years ago

It creates clusters based on the SingleR clustering, but it doesn't fit the ovary@active.ident clusters. You need to run CreateSinglerObject with clusters = ovary@active.ident.

I will fix this issue in a further version, but this is how it is for now...

panxiaoguang commented 5 years ago

It creates clusters based on the SingleR clustering, but it doesn't fit the ovary@active.ident clusters. You need to run CreateSinglerObject with clusters = ovary@active.ident.

I will fix this issue in a further version, but this is how it is for now...

Thank you very much!

cyanosoma commented 5 years ago

when I set clusters = ovary@active.ident, I still got error. How should I fix my code?

dviraran commented 4 years ago

Can you please try the new SingleR version in bioconductor? all those issues should be avoided now.

https://bioconductor.org/packages/devel/bioc/html/SingleR.html

Best, Dvir

biobug16 commented 4 years ago

Even after passing Seurat clusters with CreateSinglerObject(), I am still getting the same error while using SingleR.DrawHeatmap(). Here is my command

singler = CreateSinglerObject(raw_count,annot = NULL, "SeuratProject", min.genes = 0,technology = "10X", species = "Human", citation = "",ref.list = list(), normalize.gene.length = F, variable.genes = "de",fine.tune = F, do.signatures = T, clusters = immune.combined$seurat_clusters, do.main.types = T,reduce.file.size = T, numCores = SingleR.numCores)

SingleR.DrawHeatmap(singler$singler[[1]]$SingleR.clusters.main, top.n = Inf, clusters = singler$meta.data$stim,fontsize_row = 20,label.size = 4)

The error message is: Error in .rowNamesDF<-(x, value = value) : invalid 'row.names' length)

Any help will be highly appreciated.

Thanks

dviraran commented 4 years ago

I strongly suggest using the new version - http://bioconductor.org/packages/release/bioc/html/SingleR.html and also posting issues in https://github.com/LTLA/SingleR instead of this repository.

Best, Dvir