zellerlab / siamcat

R package for Statistical Inference of Associations between Microbial Communities And host phenoType
https://siamcat.embl.de/
52 stars 16 forks source link

Error in train.model() while running randomforest and enet #42

Closed wasifmohdkhan closed 1 year ago

wasifmohdkhan commented 1 year ago

Hello,

Thanks for developing this package.

I encountered an error while running the command train.model(sc_obj, method = "randomForest")

The error is Error in tune(method = "grid_search", task = task, learner = lrn.fold, : unused argument (resolution = grid.size) I am able to run the "lasso" model successfully but I encounter this error while running "randomforest" and "enet". I used to run this command successfully in the past. I think the error is after the Siamcat update 2.4

Here is the sessionInfo:

> sessionInfo()
R version 4.3.0 (2023-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C               LC_TIME=en_CA.UTF-8        LC_COLLATE=en_CA.UTF-8     LC_MONETARY=en_CA.UTF-8   
 [6] LC_MESSAGES=en_CA.UTF-8    LC_PAPER=en_CA.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C       

time zone: America/Winnipeg
tzcode source: system (glibc)

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

other attached packages:
[1] here_1.0.1      SIAMCAT_2.4.0   mlr3_0.16.0     phyloseq_1.44.0

loaded via a namespace (and not attached):
  [1] beanplot_1.3.1          bitops_1.0-7            pROC_1.18.0             gridExtra_2.3           permute_0.9-7           rlang_1.1.1            
  [7] magrittr_2.0.3          gridBase_0.4-7          ade4_1.7-22             matrixStats_0.61.0      compiler_4.3.0          mgcv_1.8-42            
 [13] vctrs_0.6.3             reshape2_1.4.4          stringr_1.5.0           fastmap_1.1.0           pkgconfig_2.0.3         shape_1.4.6            
 [19] crayon_1.5.2            backports_1.4.1         XVector_0.40.0          PRROC_1.3.1             utf8_1.2.3              rmarkdown_2.22         
 [25] nloptr_2.0.0            xfun_0.39               glmnet_4.1-7            zlibbioc_1.46.0         mlr3misc_0.12.0         GenomeInfoDb_1.36.0    
 [31] jsonlite_1.8.5          biomformat_1.28.0       progress_1.2.2          rhdf5filters_1.12.1     uuid_1.1-0              Rhdf5lib_1.22.0        
 [37] parallel_4.3.0          prettyunits_1.1.1       cluster_2.1.4           R6_2.5.1                stringi_1.7.12          RColorBrewer_1.1-3     
 [43] parallelly_1.36.0       boot_1.3-28             numDeriv_2016.8-1.1     knitr_1.37              Rcpp_1.0.10             iterators_1.0.14       
 [49] IRanges_2.34.1          Matrix_1.5-4.1          splines_4.3.0           igraph_1.2.11           tidyselect_1.2.0        yaml_2.3.5             
 [55] rstudioapi_0.14         mlr3tuning_0.18.0       vegan_2.6-4             codetools_0.2-19        listenv_0.8.0           lattice_0.21-8         
 [61] tibble_3.2.1            lmerTest_3.1-3          plyr_1.8.6              Biobase_2.60.0          evaluate_0.15           future_1.32.0          
 [67] survival_3.5-3          Biostrings_2.68.1       infotheo_1.2.0.1        pillar_1.9.0            corrplot_0.92           checkmate_2.0.0        
 [73] foreach_1.5.2           stats4_4.3.0            generics_0.1.2          rprojroot_2.0.2         bbotk_0.7.2             RCurl_1.98-1.12        
 [79] S4Vectors_0.38.1        hms_1.1.3               ggplot2_3.4.2           munsell_0.5.0           scales_1.2.1            minqa_1.2.4            
 [85] globals_0.16.2          glue_1.6.2              LiblineaR_2.10-22       tools_4.3.0             data.table_1.14.8       lme4_1.1-28            
 [91] rhdf5_2.44.0            grid_4.3.0              ape_5.7-1               colorspace_2.1-0        paradox_0.11.1          nlme_3.1-162           
 [97] GenomeInfoDbData_1.2.10 palmerpenguins_0.1.0    cli_3.6.1               fansi_1.0.4             dplyr_1.1.2             gtable_0.3.3           
[103] digest_0.6.29           BiocGenerics_0.46.0     lgr_0.4.4               htmltools_0.5.5         multtest_2.56.0         lifecycle_1.0.3        
[109] mlr3learners_0.5.6      MASS_7.3-59  
jakob-wirbel commented 1 year ago

Hi @wasifmohdkhan

thank you so much for spotting this! The error originates from a dependency of the mlr3 universe, where the function for the internal hyperparameter tuning was changed. It is fixed in the development version of SIAMCAT already, so you can install it from Github and it should work (please let me know if it does work 😄). It will be updated in the Bioconductor release soon!

require("devtools")
devtools::install_github(repo = 'zellerlab/siamcat')

The version should be SIAMCAT 2.5.1 and then this error should not occur anymore Cheers Jakob