plger / scDblFinder

Methods for detecting doublets in single-cell sequencing data

Home Page:https://plger.github.io/scDblFinder/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to run scDblFinder - "as_cholmod_sparse" does not exist

sunnlife1978 opened this issue · comments

I'm working on a Seurat object that has been normalised and scaled and I now want to find the doublets.

sceobj <- as.SingleCellExperiment(sobj)
doublet_res <- scDblFinder(sceobj)

Here's the error message:

Error in (function (A, nv = 5, nu = nv, maxit = 1000, work = nv + 7, reorth = TRUE, :
the 'as_cholmod_sparse' function does not exist in the 'Matrix' package

nor does traceback.

14.
(function (A, nv = 5, nu = nv, maxit = 1000, work = nv + 7, reorth = TRUE,
tol = 1e-05, v = NULL, right_only = FALSE, verbose = FALSE,
scale = NULL, center = NULL, shift = NULL, mult = NULL, fastpath = TRUE,
svtol = tol, smallest = FALSE, ...) ...
13.
do.call(irlba, c(args, list(A = x, center = stats$center, scale = stats$scale)))
12.
(function (x, k = 5, nu = k, nv = k, center = FALSE, scale = FALSE,
deferred = FALSE, extra.work = 7, ..., fold = Inf, BPPARAM = SerialParam())
{
if (nu == 0 && nv == 0 && k == 0) { ...
11.
do.call(FUN, c(list(x = x, k = k, nu = nu, nv = nv, center = center,
scale = scale, BPPARAM = BPPARAM, ...), ARGS(BSPARAM)))
10.
runSVD(x, k = rank, nu = ifelse(get.pcs, rank, 0), nv = ifelse(get.rotation,
rank, 0), center = center, scale = scale, ...)
9.
runSVD(x, k = rank, nu = ifelse(get.pcs, rank, 0), nv = ifelse(get.rotation,
rank, 0), center = center, scale = scale, ...)
8.
.local(x, ...)
7.
runPCA(x, rank = ncomponents, BSPARAM = BSPARAM, BPPARAM = BPPARAM)
6.
runPCA(x, rank = ncomponents, BSPARAM = BSPARAM, BPPARAM = BPPARAM)
5.
.local(x, ...)
4.
scater::calculatePCA(e, ncomponents = dims, subset_row = seq_len(nrow(e)),
ntop = nrow(e), BSPARAM = BiocSingular::IrlbaParam())
3.
scater::calculatePCA(e, ncomponents = dims, subset_row = seq_len(nrow(e)),
ntop = nrow(e), BSPARAM = BiocSingular::IrlbaParam())
2.
.defaultProcessing(e, dims = dims)
1.
scDblFinder(sceobj)

looking carefully on the net I couldn't find any trace of an 'as.cholmod_sparse' function in the Matrix or irlba package.
I must admit I'm completely lost...
can you help me please

Alex

Hi,

If you google around you'll see that this is a major issue that broke dozens of Bioconductor packages (and Seurat as well), I'm afraid there's nothing I can do about this, as it's not related to my package but to underlying dependencies.
Specifically, changes in the new version of the Matrix package breaks binaries of lots of packages depending on it, see for instance this issue on irlba. To fix this all developers will have to recompile their binaries from source, but none of them was alerted to this before Matrix was changed... when they've updated you'll be able to fix the problem using update.packages(), but until then you've got 2 alternatives:

  1. downgrade Matrix to v1.6-1 (or anything below 1.6-2), or
  2. re-build the other packages (right now irlba, but I'm not sure if it's the only one) from source (which you can do by specifying the type="source" argument).

Hope this helps,
Pierre-Luc

Hi, if you are still interested by a solution, you can use conda to create an environment with the right Matrix version.

conda create -n scbdlfinder
conda activate scdblfinder
conda install r-matrix=1.6_1 bioconductor-scdblfinder r-seurat

Hi!
I had the same problem, and just donwgrading Matrix v1.6-1 didn't work. One also needs to re-install irlba.

I hope it helps!

got it working as per this thread !! thank you @plger and @hennion . I used the latest Matrix (1.6-5) and irlba (2.3.5.1) package versions installed from source and importantly started with a clean environment! scDblFinder did not work unless I started with a clean environment.

Hope this helps anyone wanting to avoid downgrading their packages 😊

got it working as per this thread !! thank you @plger and @hennion . I used the latest Matrix (1.6-5) and irlba (2.3.5.1) package versions installed from source and importantly started with a clean environment! scDblFinder did not work unless I started with a clean environment.

Hope this helps anyone wanting to avoid downgrading their packages 😊

Worked perfectly ! Thank you so much!