Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ArzooShamoon opened this issue May 13, 2024 · 5 comments

Comments

@ArzooShamoon
Copy link

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
Copy link
Member

LTLA commented May 13, 2024

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
Copy link

adRn-s commented Jun 18, 2024

HenrikBengtsson/matrixStats#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.

@CakeManka
Copy link

"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."
this is a fasle means to handle error.
changing the raw code is a correct manner.

@CakeManka
Copy link

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.

i think there are a question in the raw code. in the fact, i can not use this package just only change the version of MatrixGenerics, sparseMatrixStats and DelayedMatrixStats.

@adRn-s
Copy link

adRn-s commented Nov 18, 2024

HenrikBengtsson/matrixStats#246

@CakeManka Please check that link, I got answers from core maintainers. They're aiming to fix it in the new release. Apparently, the situation is extremely complex and takes time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants