statdivlab / corncob

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

error in demo data #124

Closed Ivy-ops closed 3 years ago

Ivy-ops commented 3 years ago

Hi developer,

I encounter below error in applying package on cluster. May I have your help? Thanks! However, I have no problem in running this on my local computer.

> library(corncob)
> data(soil_phylo)
> soil <- soil_phylo %>%
+ phyloseq::subset_samples(DayAmdmt %in% c(11,21)) %>%
+ phyloseq::tax_glom("Phylum")

> da_analysis <- differentialTest(formula = ~ DayAmdmt,
+                                 phi.formula = ~ DayAmdmt,
+                                 formula_null = ~ 1,
+                                 phi.formula_null = ~ DayAmdmt,
+                                 test = "Wald", boot = FALSE,
+                                 data = soil,
+                                 fdr_cutoff = 0.05)
Error in differentialTest(formula = ~DayAmdmt, phi.formula = ~DayAmdmt,  : 
  All models failed to converge! 

           If you are seeing this, it is likely that your model is overspecified. This occurs when your sample size is not large enough to estimate all the parameters of your model. This is most commonly due to categorical variables that include many categories. 

           Alternatively, double-check your values for the arguments `link`, `phi.link`, and `method` to makes sure that they follow the specified options. 

           To confirm you have fixed the issue, try running a model for a single taxon with bbdml.

My system info:

sessionInfo()


R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server 7.9 (Maipo)

Matrix products: default BLAS: /usr/lib64/libblas.so.3.4.2 LAPACK: /usr/lib64/liblapack.so.3.4.2

locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages: [1] phyloseq_1.34.0 corncob_0.2.0

loaded via a namespace (and not attached): [1] Rcpp_1.0.6 ape_5.5 lattice_0.20-44
[4] prettyunits_1.1.1 Biostrings_2.58.0 assertthat_0.2.1
[7] foreach_1.5.1 utf8_1.2.1 slam_0.1-48
[10] R6_2.5.0 plyr_1.8.6 stats4_4.0.3
[13] ggplot2_3.3.3 pillar_1.6.1 zlibbioc_1.36.0
[16] rlang_0.4.11 progress_1.2.2 rstudioapi_0.13
[19] data.table_1.14.0 vegan_2.5-7 S4Vectors_0.28.1
[22] Matrix_1.3-3 detectseparation_0.2 splines_4.0.3
[25] stringr_1.4.0 igraph_1.2.6 munsell_0.5.0
[28] ROI_1.0-0 numDeriv_2016.8-1.1 compiler_4.0.3
[31] pkgconfig_2.0.3 BiocGenerics_0.36.1 multtest_2.46.0
[34] mgcv_1.8-36 biomformat_1.18.0 tidyselect_1.1.1
[37] tibble_3.1.2 IRanges_2.24.1 codetools_0.2-18
[40] fansi_0.5.0 permute_0.9-5 crayon_1.4.1
[43] dplyr_1.0.6 MASS_7.3-54 rhdf5filters_1.2.1
[46] grid_4.0.3 registry_0.5-1 nlme_3.1-152
[49] jsonlite_1.7.2 gtable_0.3.0 lifecycle_1.0.0
[52] DBI_1.1.1 magrittr_2.0.1 scales_1.1.1
[55] stringi_1.6.2 XVector_0.30.0 reshape2_1.4.4
[58] ellipsis_0.3.2 generics_0.1.0 vctrs_0.3.8
[61] lpSolveAPI_5.5.2.0-17.7 ROI.plugin.lpsolve_1.0-0 Rhdf5lib_1.12.1
[64] iterators_1.0.13 tools_4.0.3 ade4_1.7-16
[67] Biobase_2.50.0 glue_1.4.2 purrr_0.3.4
[70] hms_1.1.0 parallel_4.0.3 survival_3.2-11
[73] colorspace_2.0-1 rhdf5_2.34.0 cluster_2.1.2

bryandmartin commented 3 years ago

Hi @Ivy-ops ,

Just to clarify my understanding here: you are running that exact chunk of code on both your local machine and a cluster, and it failed only on the cluster?

Can you try adding inits (see documentation) to your input?

Ivy-ops commented 3 years ago

Hi @bryandmartin , Thanks for the feedback. Yes, you are correct. I installed corncob on cluster and local computer. Error shows on cluster, while running on local computer have no error. May I please know how to set inits? I see in tutorial. Optional initializations for model fit using formula and phi.formula as rows of a matrix. It is embarrassed that I still do not know how to set inits. Thanks!!

bryandmartin commented 3 years ago

Closing this in response to your email.

For posterioty, it was a package install issue. The solution was to manually install “trust” and “optimr”.