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

irlba as_cholmod_sparse problems #115

Open
jlmelville opened this issue Nov 27, 2023 · 3 comments
Open

irlba as_cholmod_sparse problems #115

jlmelville opened this issue Nov 27, 2023 · 3 comments

Comments

@jlmelville
Copy link
Owner

This is not something I can fix in uwot, but just in case people are searching for this, if you see the error:

Error in irlba::irlba(L, nv = n, nu = 0, maxit = iters) : 
  function 'as_cholmod_sparse' not provided by package 'Matrix'
Called from: irlba::irlba(L, nv = n, nu = 0, maxit = iters)

then if you are able to reinstall the Matrix and irlba packages from source as recommended at bwlewis/irlba#70 (comment), this will fix the problem.

If not, another potential workaround is to install RSpectra via install.packages("RSpectra") and it should be used in preference to irlba for the spectral initialization.

If you are also using PCA explicitly (e.g. init = "spca" or pca = 100), then the following might work: install bigstatsr (install.packages("bigstatsr")) and set pca_method = "bigstatsr".

For either of these you may need to restart your session and explicitly load them for this to work. I've had mixed experience with it (the install packages are eventually picked up).

@jlmelville
Copy link
Owner Author

I believe the irlba/Matrix error will only occur if the C code (calling the irlba function with fastpath = TRUE) is executed. So master now contains an attempt to tryCatch that error and then try again with fastpath = FALSE. Does it work? It seems to, but I also thought that last time and it still caused a CRAN check error.

I also experimented with just embedding all of IRLBA's R code directly into this package. The embed-irlba branch contains this. Might also work, but it removes the C code entirely so would slow everything down for everyone. Integrating irlba's C code with uwot's C++ is non-trivial so I'm not going to spend time on that for now.

@jlmelville
Copy link
Owner Author

@LTLA are there R packages which wrap your https://github.com/LTLA/CppIrlba? Would it be fairly straightforward to do this?

@LTLA
Copy link
Contributor

LTLA commented Dec 26, 2024

assorthead vendors the IRLBA C++ code, but you'll have to compile it in uwot yourself. Most easily done with

LinkingTo: assorthead

... but assumes that you're willing to accept a compile-time dependency on BioC packages.

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

2 participants