Skip to contents

Rules for the package development

Documentation

  • Always indicate required params (required)
  • Indicate default values only when (i) a set of values is possible [e.g "bray" for the parameter method in vegan::vegdist()] or (ii) when this value is well thought out and a good default value for most users [e.g. the number of permutation or processors, or the level of identity to cluster at 97%].
  • Indicate the type for logical and integer params.
  • Homogenize the params names across function.
  • Prefer ASVs to OTUs denomination, even thought both are almost interchangeable in the MiscMetabar package.

Lifecycle

  • Experimental: First status for a function
  • Maturing: Some tests and/or analyses make stronger these functions
  • Stable: Good level of confidence

Tests and examples

Special cases of external softwares

Some examples and test required the installation of external softwares. I used MiscMetabar internal functions (such as [is_vsearch_installed()]) to conditionnaly test (if(is_vsearch_installed()){...test...}) and run examples #' @examplesIf is_vsearch_installed().

Special case of CRAN

I use \donttest{} for some long examples (in roxygen documentation) and testthat::skip_on_cran() in long test.

Special case of windows

Some tests and examples are not tested on windows. I used testthat::skip_on_os("windows") inside test and #' @examplesIf tolower(Sys.info()[["sysname"]]) != "windows" in examples (roxygen documentation). Here is a list of functions with some limitations or not working at all on windows OS:

  • [build_phytree_pq()]
  • [count_seq()]
  • [cutadapt_remove_primers()]
  • [krona()]
  • [merge_krona()]
  • [multipatt_pq()]
  • [plot_tsne_pq()]
  • [rotl_pq()]
  • [save_pq()]
  • [tax_datatable()]
  • [track_wkflow()]
  • [track_wkflow_samples()]
  • [tsne_pq()]
  • [venn_pq()]

Session information

## R version 4.3.2 (2023-10-31)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 22.04.3 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
## 
## locale:
##  [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
##  [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
##  [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
## [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
## 
## time zone: UTC
## tzcode source: system (glibc)
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## loaded via a namespace (and not attached):
##  [1] vctrs_0.6.5       cli_3.6.2         knitr_1.45        rlang_1.1.3      
##  [5] xfun_0.42         stringi_1.8.3     purrr_1.0.2       textshaping_0.3.7
##  [9] jsonlite_1.8.8    glue_1.7.0        htmltools_0.5.7   ragg_1.2.7       
## [13] sass_0.4.8        rmarkdown_2.25    evaluate_0.23     jquerylib_0.1.4  
## [17] fastmap_1.1.1     yaml_2.3.8        lifecycle_1.0.4   memoise_2.0.1    
## [21] stringr_1.5.1     compiler_4.3.2    fs_1.6.3          systemfonts_1.0.5
## [25] digest_0.6.34     R6_2.5.1          magrittr_2.0.3    bslib_0.6.1      
## [29] tools_4.3.2       pkgdown_2.0.7     cachem_1.0.8      desc_1.4.3