dviraran / SingleR

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

SingleR() error #150

Open Fathzadehm opened 2 years ago

Fathzadehm commented 2 years ago

Please post issues in https://github.com/LTLA/SingleR

Hi,

I am testing the SingleR on a pbmc dataset of ~13k cells. Here is the code with the following error:

Loading reference data with Ensembl annotations.

library(celldex) ref.data <- HumanPrimaryCellAtlasData(ensembl=TRUE, cell.ont = "all")

Performing predictions.

library(SingleR) predictions <- SingleR(test=pbmc, assay.type.test = 1, ref=ref.data, labels=ref.data$label.main)

Warning: The following arguments are not used: drop

Error in h(simpleError(msg, call)) :

error in evaluating the argument 'x' in selecting a method for function 'type': unused argument (drop = FALSE)

Error: no more error handlers available (recursive errors?); invoking 'abort' restart

I could not find the cause of this error. Thank you for being helpful.

arglatha commented 1 year ago

I am also getting this error, did you ever find a fix? Thanks!

Camila-goclowski commented 1 year ago

I was also running into this error and found that my issue was that I was inputting the entire reference object into the "ref" argument. I was able to overcome it by running GetAssayData on my reference AND test objects and used those outputs to then run SingleR. It would look something like this with your data:

test_assay <- GetAssayData(pbmc) ref_assay <- GetAssayData(ref.data)

predictions <- SingleR(test = test_assay, ref = ref_assay, labels = ref.data$label.main)

The SingleR book also explained that by default it assumes the use of a bulkRNA-seq reference dataset. I am not sure how exactly this relates back to the error we were receiving, but I am guessing it is related. I also found that setting the de.method argument to "wilcox" as opposed to the default "classic" allowed the function to run smoothly (may have something to do with using an scRNA-seq reference as opposed to bulk I am guessing).