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

Unable to run scDblFinder - "as_cholmod_sparse" does not exist #91

Open
sunnlife1978 opened this issue Nov 24, 2023 · 5 comments
Open

Comments

@sunnlife1978
Copy link

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

@plger
Copy link
Owner

plger commented Nov 24, 2023

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

@sguizard
Copy link

sguizard commented Feb 7, 2024

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

@daymecita
Copy link

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!

@plger plger changed the title Unable to run scDblFinder Unable to run scDblFinder - "as_cholmod_sparse" does not exist Mar 8, 2024
@lauren-tjoeka
Copy link

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 😊

@inse0274
Copy link

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!

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

6 participants