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

peakAnnoEnrichment fxn gives error "CRsparse_colSums" not resolved from current namespace (Matrix) #2140

Open
BartBryant opened this issue Mar 21, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@BartBryant
Copy link

Screenshot 2024-03-21 at 4 59 39 PM

running ArchR up to Ch12 and I get an error message with the peakAnnoEnrichment ( )

of note, I am using SeuratObject_4.1.3 and Seurat_4.3.0 as previous tutorial required these versions of Seurat

any help from anyone would be awesome!

danke
barT

@BartBryant BartBryant added the bug Something isn't working label Mar 21, 2024
@rcorces
Copy link
Collaborator

rcorces commented Mar 21, 2024

Hi @BartBryant! Thanks for using ArchR! Lately, it has been very challenging for me to keep up with maintenance of this package and all of my other
responsibilities as a PI. I have not been responding to issue posts and I have not been pushing updates to the software. We are actively searching to hire
a computational biologist to continue to develop and maintain ArchR and related tools. If you know someone who might be a good fit, please let us know!
In the meantime, your issue will likely go without a reply. Most issues with ArchR right not relate to compatibility. Try reverting to R 4.1 and Bioconductor 3.15.
Newer versions of Seurat and Matrix also are causing issues. Sorry for not being able to provide active support for this package at this time.

@shamer3
Copy link

shamer3 commented Jun 6, 2024

I managed to remedy this error by downgrading my Matrix package to version 1.5-0 from 1.6-5

@ZhangFuchang
Copy link

ZhangFuchang commented Jun 29, 2024

If the Matrix version (greater than 1.6.0, such as 1.6.5) is too high (but Signal or Seurat depends on Matrix at least 1.63 or above), an error will be reported, indicating that the CRsparse_colSums class does not exist
Solution: Download the source code packages for Matrix 1.6.0 and Matrix 1.6.5, and move some of the code related to the CRsparse_colSums class definition from Matrix 1.6.0 to version 1.6.5, Matrix1.6.0 is the last version that also includes the CPsparse_colSums class definition.

  1. Copy the following line and all the after lines of code in src/sparse. c in version Matrix1.6.0:
    SEXP CRsparse_colSums(SEXP obj, SEXP narm, SEXP mean, SEXP sparse)
    Paste the code to src/sparse. c in Matrix 1.6.5.
  2. Then copy the code related to the NEW-OBJECT OF CLASS definition from src/Mutils. c in Matrix 1.6.0 to src/sparse. c in Matrix 1.6.5,
    That is the following paragraph:
    SEXP NEW_OBJECT_OF_CLASS(const char *what)
    {
    SEXP class = PROTECT(MAKE_CLASS(what)), obj = NEW_OBJECT(class);
    UNPROTECT(1);
    return obj;
    }
  3. Add the following code before the last line of code in src/sparse. h in 1.6.5:
    #include "sparseVector.h"
    SEXP v2spV(SEXP);

# define NEW_OBJECT(class_def) R_do_new_object(class_def)
# define MAKE_CLASS(what) R_do_MAKE_CLASS(what)
SEXP NEW_OBJECT_OF_CLASS(const char *what);

SEXP CRsparse_colSums(SEXP obj, SEXP narm, SEXP mean, SEXP sparse);
SEXP CRsparse_rowSums(SEXP obj, SEXP narm, SEXP mean, SEXP sparse);
4. In Matrix 1.6.5 of src/init. c, add the following code at the end of the code block defined by CallDEF:
CALLDEF(CRsparse_colSums, 4),
CALLDEF(CRsparse_rowSums, 4),

Then recompile the source code for Matrix 1.6.5

The Matrix website for version 1.6.0 is: https://github.com/r-wasm/Matrix
The Matrix website for version 1.6.5 is: https://cran.r-project.org/web/packages/Matrix/index.html
Test:
Library (Matrix)
then enter
Matrix:: CRsparse_colSums
to see if this class can load properly.

@ZhangFuchang
Copy link

Hi @BartBryant! Thanks for using ArchR! Lately, it has been very challenging for me to keep up with maintenance of this package and all of my other responsibilities as a PI. I have not been responding to issue posts and I have not been pushing updates to the software. We are actively searching to hire a computational biologist to continue to develop and maintain ArchR and related tools. If you know someone who might be a good fit, please let us know! In the meantime, your issue will likely go without a reply. Most issues with ArchR right not relate to compatibility. Try reverting to R 4.1 and Bioconductor 3.15. Newer versions of Seurat and Matrix also are causing issues. Sorry for not being able to provide active support for this package at this time.

If the Matrix version (greater than 1.6.0, such as 1.6.5) is too high (but Signal or Seurat depends on Matrix at least 1.63 or above), an error will be reported, indicating that the CRsparse_colSums class does not exist
Solution: Download the source code packages for Matrix 1.6.0 and Matrix 1.6.5, and move some of the code related to the CRsparse_colSums class definition from Matrix 1.6.0 to version 1.6.5, Matrix1.6.0 is the last version that also includes the CPsparse_colSums class definition.

  1. Copy the following line and all the after lines of code in src/sparse. c in version Matrix1.6.0:
    SEXP CRsparse_colSums(SEXP obj, SEXP narm, SEXP mean, SEXP sparse)
    Paste the code to src/sparse. c in Matrix 1.6.5.
  2. Then copy the code related to the NEW-OBJECT OF CLASS definition from src/Mutils. c in Matrix 1.6.0 to src/sparse. c in Matrix 1.6.5,
    That is the following paragraph:
    SEXP NEW_OBJECT_OF_CLASS(const char *what)
    {
    SEXP class = PROTECT(MAKE_CLASS(what)), obj = NEW_OBJECT(class);
    UNPROTECT(1);
    return obj;
    }
  3. Add the following code before the last line of code in src/sparse. h in 1.6.5:
    #include "sparseVector.h"
    SEXP v2spV(SEXP);

# define NEW_OBJECT(class_def) R_do_new_object(class_def)
# define MAKE_CLASS(what) R_do_MAKE_CLASS(what)
SEXP NEW_OBJECT_OF_CLASS(const char *what);

SEXP CRsparse_colSums(SEXP obj, SEXP narm, SEXP mean, SEXP sparse);
SEXP CRsparse_rowSums(SEXP obj, SEXP narm, SEXP mean, SEXP sparse);
4. In Matrix 1.6.5 of src/init. c, add the following code at the end of the code block defined by CallDEF:
CALLDEF(CRsparse_colSums, 4),
CALLDEF(CRsparse_rowSums, 4),

Then recompile the source code for Matrix 1.6.5

The Matrix website for version 1.6.0 is: https://github.com/r-wasm/Matrix
The Matrix website for version 1.6.5 is: https://cran.r-project.org/web/packages/Matrix/index.html
Test:
Library (Matrix)
then enter
Matrix:: CRsparse_colSums
to see if this class can load properly.

@ZhangFuchang
Copy link

I managed to remedy this error by downgrading my Matrix package to version 1.5-0 from 1.6-5

If the Matrix version (greater than 1.6.0, such as 1.6.5) is too high (but Signal or Seurat depends on Matrix at least 1.63 or above), an error will be reported, indicating that the CRsparse_colSums class does not exist
Solution: Download the source code packages for Matrix 1.6.0 and Matrix 1.6.5, and move some of the code related to the CRsparse_colSums class definition from Matrix 1.6.0 to version 1.6.5, Matrix1.6.0 is the last version that also includes the CPsparse_colSums class definition.

  1. Copy the following line and all the after lines of code in src/sparse. c in version Matrix1.6.0:
    SEXP CRsparse_colSums(SEXP obj, SEXP narm, SEXP mean, SEXP sparse)
    Paste the code to src/sparse. c in Matrix 1.6.5.
  2. Then copy the code related to the NEW-OBJECT OF CLASS definition from src/Mutils. c in Matrix 1.6.0 to src/sparse. c in Matrix 1.6.5,
    That is the following paragraph:
    SEXP NEW_OBJECT_OF_CLASS(const char *what)
    {
    SEXP class = PROTECT(MAKE_CLASS(what)), obj = NEW_OBJECT(class);
    UNPROTECT(1);
    return obj;
    }
  3. Add the following code before the last line of code in src/sparse. h in 1.6.5:
    #include "sparseVector.h"
    SEXP v2spV(SEXP);

# define NEW_OBJECT(class_def) R_do_new_object(class_def)
# define MAKE_CLASS(what) R_do_MAKE_CLASS(what)
SEXP NEW_OBJECT_OF_CLASS(const char *what);

SEXP CRsparse_colSums(SEXP obj, SEXP narm, SEXP mean, SEXP sparse);
SEXP CRsparse_rowSums(SEXP obj, SEXP narm, SEXP mean, SEXP sparse);
4. In Matrix 1.6.5 of src/init. c, add the following code at the end of the code block defined by CallDEF:
CALLDEF(CRsparse_colSums, 4),
CALLDEF(CRsparse_rowSums, 4),

Then recompile the source code for Matrix 1.6.5

The Matrix website for version 1.6.0 is: https://github.com/r-wasm/Matrix
The Matrix website for version 1.6.5 is: https://cran.r-project.org/web/packages/Matrix/index.html
Test:
Library (Matrix)
then enter
Matrix:: CRsparse_colSums
to see if this class can load properly.

@alekseybelikov
Copy link

same problem

motifsUp <- peakAnnoEnrichment(
    seMarker = markerTest,
    ArchRProj = projHeme5,
    peakAnnotation = "Motif",
    cutOff = "FDR <= 0.1 & Log2FC >= 0.5"
  )

{
"name": "ERROR",
"message": "Error in .Call("CRsparse_colSums", x, na.rm, FALSE, sparseResult): "CRsparse_colSums" not resolved from current namespace (Matrix)
",
"stack": "Error in .Call("CRsparse_colSums", x, na.rm, FALSE, sparseResult): "CRsparse_colSums" not resolved from current namespace (Matrix)
Traceback:

  1. peakAnnoEnrichment(seMarker = markerTest, ArchRProj = projHeme5,
    . peakAnnotation = "Motif", cutOff = "FDR <= 0.1 & Log2FC >= 0.5")
  2. lapply(seq_len(ncol(seMarker)), function(x) {
    . .logDiffTime(sprintf("Computing Enrichments %s of %s", x,
    . ncol(seMarker)), t1 = tstart, verbose = TRUE, logFile = logFile)
    . idx <- which(passMat[, x])
    . if (method == "bgd") {
    . .computeEnrichment(matches, idx, c(idx, as.vector(bgdPeaks[idx,
    . ])))
    . }
    . else {
    . .computeEnrichment(matches, idx, seq_len(nrow(matches)))
    . }
    . }) %>% SimpleList
  3. SimpleList(.)
  4. lapply(seq_len(ncol(seMarker)), function(x) {
    . .logDiffTime(sprintf("Computing Enrichments %s of %s", x,
    . ncol(seMarker)), t1 = tstart, verbose = TRUE, logFile = logFile)
    . idx <- which(passMat[, x])
    . if (method == "bgd") {
    . .computeEnrichment(matches, idx, c(idx, as.vector(bgdPeaks[idx,
    . ])))
    . }
    . else {
    . .computeEnrichment(matches, idx, seq_len(nrow(matches)))
    . }
    . })
  5. FUN(X[[i]], ...)
  6. .computeEnrichment(matches, idx, seq_len(nrow(matches)))
  7. Matrix::colSums(matchCompare)
  8. Matrix::colSums(matchCompare)
  9. .local(x, na.rm, dims, ...)"
    }

ArchR-peakAnnoEnrichment-1819e661f4a5e-Date-2024-10-22_Time-14-39-10.035534.log

@alekseybelikov
Copy link

If the Matrix version (greater than 1.6.0, such as 1.6.5) is too high (but Signal or Seurat depends on Matrix at least 1.63 or above), an error will be reported, indicating that the CRsparse_colSums class does not exist Solution: Download the source code packages for Matrix 1.6.0 and Matrix 1.6.5, and move some of the code related to the CRsparse_colSums class definition from Matrix 1.6.0 to version 1.6.5, Matrix1.6.0 is the last version that also includes the CPsparse_colSums class definition.

  1. Copy the following line and all the after lines of code in src/sparse. c in version Matrix1.6.0:
    SEXP CRsparse_colSums(SEXP obj, SEXP narm, SEXP mean, SEXP sparse)
    Paste the code to src/sparse. c in Matrix 1.6.5.
  2. Then copy the code related to the NEW-OBJECT OF CLASS definition from src/Mutils. c in Matrix 1.6.0 to src/sparse. c in Matrix 1.6.5,
    That is the following paragraph:
    *SEXP NEW_OBJECT_OF_CLASS(const char what)
    {
    SEXP class = PROTECT(MAKE_CLASS(what)), obj = NEW_OBJECT(class);
    UNPROTECT(1);
    return obj;
    }
  3. Add the following code before the last line of code in src/sparse. h in 1.6.5:
    #include "sparseVector.h"
    SEXP v2spV(SEXP);

# define NEW_OBJECT(class_def) R_do_new_object(class_def) # define MAKE_CLASS(what) R_do_MAKE_CLASS(what) *SEXP NEW_OBJECT_OF_CLASS(const char what);

SEXP CRsparse_colSums(SEXP obj, SEXP narm, SEXP mean, SEXP sparse); SEXP CRsparse_rowSums(SEXP obj, SEXP narm, SEXP mean, SEXP sparse); 4. In Matrix 1.6.5 of src/init. c, add the following code at the end of the code block defined by CallDEF: CALLDEF(CRsparse_colSums, 4), CALLDEF(CRsparse_rowSums, 4),

Then recompile the source code for Matrix 1.6.5

The Matrix website for version 1.6.0 is: https://github.com/r-wasm/Matrix The Matrix website for version 1.6.5 is: https://cran.r-project.org/web/packages/Matrix/index.html Test: Library (Matrix) then enter Matrix:: CRsparse_colSums to see if this class can load properly.

even upon downgrading to Matrix_1.6-0 the problem persists
ArchR-peakAnnoEnrichment-1819e324ac9fc-Date-2024-10-22_Time-15-27-31.258346.log

@alekseybelikov
Copy link

Seems to be solved by

satijalab/seurat#8202 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants