SingleR-inc / SingleR

Clone of the Bioconductor repository for the SingleR package.
https://bioconductor.org/packages/devel/bioc/html/SingleR.html
GNU General Public License v3.0
165 stars 19 forks source link

Error: useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE. Traceback: #268

Open ArzooShamoon opened 1 month ago

ArzooShamoon commented 1 month ago

I tried to run singleR for cell type annotation to each cluster. head(Sample.combined) A data.frame: 10 × 6 orig.ident nCount_RNA nFeature_RNA percent.mt integrated_snn_res.0.5 seurat_clusters

MSC_AAACGAAAGAGAATCT-1 MSC 19477 4423 3.9533809 0 0 MSC_AAACGAAAGAGTCCGA-1 MSC 8237 3180 2.3188054 10 10 MSC_AAACGAACACAGCATT-1 MSC 4225 1859 7.3609467 4 4 MSC_AAACGCTCAAAGACGC-1 MSC 12958 3852 2.5158203 12 12 MSC_AAACGCTGTAACTAAG-1 MSC 874 294 0.5720824 1 1 MSC_AAAGAACGTACACTCA-1 MSC 6487 1351 1.0790812 1 1 MSC_AAAGGATTCTGTGCAA-1 MSC 1591 822 4.2740415 0 0 MSC_AAAGGGCAGCGTCAGA-1 MSC 27910 5472 3.2891437 0 0 MSC_AAAGGGCAGGAGAGGC-1 MSC 4829 995 0.5384138 9 9 MSC_AAAGGGCAGGTACCTT-1 MSC 18817 4437 2.4711697 0 0

ref <- celldex::HumanPrimaryCellAtlasData() colData(ref) results <- SingleR (test = as.SingleCellExperiment(Sample.combined), ref = ref, labels = ref$label.main) results

Error: useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE. Traceback:

SingleR(test = as.SingleCellExperiment(Sample.combined), ref = ref, . labels = ref$label.main) trainSingleR(ref, labels, genes = genes, sd.thresh = sd.thresh, . de.method = de.method, de.n = de.n, de.args = de.args, aggr.ref = aggr.ref, . aggr.args = aggr.args, recompute = recompute, restrict = restrict, . check.missing = FALSE, BNPARAM = BNPARAM, num.threads = num.threads, . BPPARAM = BPPARAM) mapply(FUN = .identify_genes, ref = ref, labels = labels, genes = genes, . MoreArgs = list(de.method = de.method, de.n = de.n, de.args = de.args, . BPPARAM = BPPARAM), SIMPLIFY = FALSE) (function (ref, labels, genes = "de", de.method = "classic", . de.n = NULL, de.args = list(), BPPARAM = BPPARAM) . { . if (length(labels) != ncol(ref)) { . stop("number of labels must be equal to number of cells") . } . if (.is_list(genes)) { . is.char <- vapply(genes, is.character, TRUE) . if (all(is.char)) { . genes <- .convert_per_label_set(genes) . } . else if (any(is.char)) { ... matrixStats::rowMedians(x, rows = rows, cols = cols, na.rm = na.rm, . dim. = dim., ..., useNames = useNames) deprecatedUseNamesNA() .Defunct(msg = "useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE.", . package = .packageName)

LTLA commented 1 month ago

Make sure your packages are up to date, in particular MatrixGenerics, sparseMatrixStats and DelayedMatrixStats; I can't remember exactly which one of them was passing along useNames=NA, but it should have been fixed now.

adRn-s commented 1 week ago

https://github.com/HenrikBengtsson/matrixStats/issues/246

This comes from matrixStats, downgrading should fix it temporarily:

remotes::install_version("matrixStats", version="1.1.0") # restart your session and run previous scripts

The default value of their functions now is useNames=TRUE. I am yet to find a changelog... this is so annoying.