dviraran / SingleR

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

bug in CreateBigSingleRObject #121

Open systemsgenomics opened 5 years ago

systemsgenomics commented 5 years ago

Found a couple of small bugs in CreateBigSingleRObject, but they caused a lot of issues for me. Default parameter min.genes was set to 200, whereas in CreateSinglerObject min.genes was set to 0. This caused issues when combining objects as dimensions to original count matrix was different.

function (counts, annot = NULL, project.name, xy, clusters, N = 10000, min.genes = 200, technology = "10X", species = "Human", citation = "", ref.list = list(), normalize.gene.length = F, variable.genes = "de", fine.tune = T, reduce.file.size = T, do.signatures = F, do.main.types = T, temp.dir = getwd(), numCores = SingleR.numCores) {

--> Fix:

CreateBigSingleRObject=function (counts, annot = NULL, project.name, xy, clusters, N = 10000, min.genes = 0, technology = "10X", species = "Human", citation = "", ref.list = list(), normalize.gene.length = F, variable.genes = "de", fine.tune = T, reduce.file.size = T, do.signatures = F, do.main.types = T, temp.dir = getwd(), numCores = SingleR.numCores) {

Furthermore, ref.list = list() parameter is not passed on to function CreateSinglerObject so you cannot assign a certain annotation object for CreateBigSingleRObject:

singler = CreateSinglerObject(counts[, A], annot = annot[A], project.name = project.name, min.genes = min.genes, technology = technology, species = species, citation = citation, do.signatures = do.signatures, clusters = NULL, numCores = numCores)

--> Fix:

singler = CreateSinglerObject(counts[, A], annot = annot[A], ref.list = ref.list,
                              project.name = project.name, min.genes = min.genes,
                              technology = technology, species = species, citation = citation,
                              do.signatures = do.signatures, clusters = NULL, numCores = numCores)
dviraran commented 5 years ago

Thanks. In the new version, available in https://bioconductor.org/packages/devel/bioc/html/SingleR.html, there is no problem running very big datasets, and thus, there is no such function.