statdivlab / corncob

Count Regression for Correlated Observations with the Beta-binomial
103 stars 22 forks source link

Issue with bbml #177

Closed SROY19930311 closed 2 months ago

SROY19930311 commented 3 months ago

I am getting this error while running bbdml

Error: object 'matrixOps' not found whilst loading namespace 'slam'

Please help.

adw96 commented 3 months ago

Hello — in order to help you we need more information. Please provide further details including a sessionInfo(), confirmation that you can run the examples, and the code that’s causing issues. Cheers, Amy

SROY19930311 commented 3 months ago

Hello, Here is the session info:

sessionInfo() R version 4.1.1 (2021-08-10) Platform: aarch64-apple-darwin20 (64-bit) Running under: macOS 14.2.1

Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] magrittr_2.0.3 phyloseq_1.38.0 corncob_0.4.1

loaded via a namespace (and not attached): [1] backports_1.4.1 plyr_1.8.8 igraph_1.3.5 splines_4.1.1
[5] GenomeInfoDb_1.30.1 ggplot2_3.5.1 foreach_1.5.2 fansi_1.0.3
[9] checkmate_2.1.0 cluster_2.1.4 remotes_2.5.0 Biostrings_2.62.0
[13] colorspace_2.0-3 dplyr_1.1.4 callr_3.7.6 crayon_1.5.2
[17] RCurl_1.98-1.9 jsonlite_1.8.8 survival_3.4-0 iterators_1.0.14
[21] ape_5.6-2 glue_1.6.2 registry_0.5-1 gtable_0.3.5
[25] zlibbioc_1.40.0 XVector_0.34.0 pkgbuild_1.4.4 Rhdf5lib_1.16.0
[29] BiocGenerics_0.40.0 scales_1.3.0 Rcpp_1.0.11 stats4_4.1.1
[33] pkgconfig_2.0.3 utf8_1.2.2 tidyselect_1.2.0 rlang_1.1.3
[37] reshape2_1.4.4 munsell_0.5.1 tools_4.1.1 cli_3.6.1
[41] generics_0.1.3 ade4_1.7-20 biomformat_1.22.0 stringr_1.5.1
[45] processx_3.8.0 nlme_3.1-160 compiler_4.1.1 rstudioapi_0.14
[49] curl_5.2.1 tibble_3.2.1 stringi_1.7.8 ps_1.7.2
[53] desc_1.4.3 forcats_1.0.0 lattice_0.20-45 Matrix_1.5-1
[57] vegan_2.6-4 permute_0.9-7 multtest_2.50.0 vctrs_0.6.5
[61] trust_0.1-8 pillar_1.9.0 lifecycle_1.0.4 rhdf5filters_1.6.0
[65] data.table_1.14.4 bitops_1.0-7 R6_2.5.1 IRanges_2.28.0
[69] codetools_0.2-18 MASS_7.3-58.1 rhdf5_2.38.1 S4Vectors_0.32.4
[73] GenomeInfoDbData_1.2.7 mgcv_1.8-41 parallel_4.1.1 grid_4.1.1
[77] Biobase_2.54.0

###################### I could run the example file with no covariates but not with covariate DayAmdmt. This problem also exists when I run the same code with my data.

corncob <- bbdml(formula = OTU.1 ~ DayAmdmt,

  • phi.formula = ~ DayAmdmt,
  • data = soil) Error: object 'matrixOps' not found whilst loading namespace 'slam'
adw96 commented 3 months ago

I’m going to assign @svteichman and @gthopkins to help you out. Sarah, would you mind leading this (Grant’s quals are Friday, but I want him to take over this stuff soon). Thanks, to both of you!

svteichman commented 3 months ago

Sounds good! I'll start looking into it, and if it takes me longer than the end of the week I'll pass it off to Grant with my thoughts on it.

svteichman commented 3 months ago

Hi @SROY19930311,

Could you please tell me the output of running the following code in your console: packageVersion("slam").

If the result is not 0.1-50 through 0.1-52, could you try removing the slam package and reinstalling it? You can do this with the functions remove.packages("slam") and install.packages("slam"). After doing this, can you confirm that you still run into this error?

I am not able to reproduce this error on my personal computer, which suggests to me that it is an issue with one of the dependencies for corncob. If this approach doesn't help, then we can consider other options.

Best, Sarah

SROY19930311 commented 3 months ago

Dear Sarah,

packageVersion("slam") [1] ‘0.1.52’

I then removed the package and tried to reinstall it. It says this: Warning in install.packages : installation of package ‘slam’ had non-zero exit status

I then downloaded the package from CRAN and installed it manually from the Zip folder I downloaded.

The problem still persists.

Thank you Shamik

svteichman commented 3 months ago

@SROY19930311, when you run packageVersion("slam"), what do you get?

SROY19930311 commented 3 months ago

I get this

packageVersion("slam") [1] ‘0.1.52’

svteichman commented 3 months ago

@SROY19930311 What version of R do you have? What is the result when you type version in R? From checking the namespace of slam it seems that matrixOps is only created for R version 4.3.0 and later. If you have an earlier version, I'd suggest updating R and then trying again.

@adw96, if this is indeed the problem, do you think that we should update the version of R that corncob depends on? Right now it is "Depends: R (>= 3.2)".

adw96 commented 3 months ago

Thanks, @svteichman -- what functionality uses slam? ie how essential is the dependency?

svteichman commented 3 months ago

@adw96 I'll look into it! It's not one of our dependencies, so I imagine it's a dependency of a dependency, and it appears to come up when we put covariates into the bbdml() function. But I can look a little deeper into which of the functions that we call, calls this matrixOps class.

SROY19930311 commented 3 months ago

Hello, This is my R version "R version 4.1.1 (2021-08-10)". If the problem is resolved with my current R-version. I would want that. I have other packages that might not work with R 4.3.0. Let me know your thoughts.

Thank you Shamik

svteichman commented 3 months ago

In that case, I'm going to tag @gthopkins. @gthopkins, when you get the chance, do you mind looking into which dependency is using the matrixObs class from bbdml(), and see if there is a workaround for previous versions of R?

gthopkins commented 3 months ago

@svteichman Yes, I will take the lead on this!

gthopkins commented 3 months ago

@SROY19930311 we have attempted to fix this error in pull request #178 by removing our dependence on the slam package. Please re-install corncob and let us know if this resolves your error when you use the bbdml() function.

adw96 commented 2 months ago

closing -- feel free to reopen if the issue persists.

Thank you so much for your help, @gthopkins and @svteichman !!!!!