diff --git a/DESCRIPTION b/DESCRIPTION
index dc049d25..792a3be2 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Package: MiscMetabar
Type: Package
Title: Miscellaneous Functions for Metabarcoding Analysis
-Version: 0.8.00
+Version: 0.9.1
Authors@R: person("Adrien", "Taudière", email = "adrien.taudiere@zaclys.net",
role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0003-1088-1182"))
Description: Facilitate the description, transformation, exploration, and reproducibility of metabarcoding analyses. 'MiscMetabar' is mainly built on top of the 'phyloseq', 'dada2' and 'targets' R packages. It helps to build reproducible and robust bioinformatics pipelines in R. 'MiscMetabar' makes ecological analysis of alpha and beta-diversity easier, more reproducible and more powerful by integrating a large number of tools. Important features are described in Taudière A. (2023)
-p <- MiscMetabar::hill_pq(data_fungi, variable = "Height")
-p$plot_Hill_0
p <- MiscMetabar::hill_pq(data_fungi, fact = "Height")
+p$plot_Hill_0
+#> NULL
-p$plot_tuckey
p$plot_tuckey
+#> NULL
See also the tutorial of the microbiome package for an alternative using the non-parametric Kolmogorov-Smirnov test for two-group comparisons when there are no relevant @@ -199,10 +191,174 @@
From the help of glmulti package :
+++glmulti finds what are the n best models (the confidence set of +models) among all possible models (the candidate set, as specified by +the user). Models are fitted with the specified fitting function +(default is glm) and are ranked with the specified Information Criterion +(default is aicc). The best models are found either through exhaustive +screening of the candidates, or using a genetic algorithm, which allows +very large candidate sets to be adressed. The output can be used for +model selection, variable selection, and multimodel inference.
+
+library("glmulti")
+formula <- "Hill_0 ~ Hill_1 + Abundance + Time + Height"
+res_glmulti <-
+ glmutli_pq(data_fungi, formula = formula, level = 1)
+#> Initialization...
+#> TASK: Exhaustive screening of candidate set.
+#> Fitting...
+#> Completed.
+res_glmulti
+#> estimates unconditional_interval nb_model importance
+#> Hill_1 3.062117997 1.868174e-01 8 1
+#> Abundance 0.002959644 8.478374e-08 8 1
+#> Time 0.789091999 2.443263e-01 8 1
+#> HeightLow 6.884340946 3.444196e+01 8 1
+#> HeightMiddle 0.339123798 3.727962e+01 8 1
+#> alpha variable
+#> Hill_1 8.570200e-01 Hill_1
+#> Abundance 5.773492e-04 Abundance
+#> Time 9.800932e-01 Time
+#> HeightLow 1.163660e+01 HeightLow
+#> HeightMiddle 1.210648e+01 HeightMiddle
+
+ggplot(data = res_glmulti, aes(x = estimates, y = variable)) +
+ geom_point(
+ size = 2,
+ alpha = 1,
+ show.legend = FALSE
+ ) +
+ geom_vline(
+ xintercept = 0,
+ linetype = "dotted",
+ linewidth = 1
+ ) +
+ geom_errorbar(
+ aes(xmin = estimates - alpha, xmax = estimates + alpha),
+ width = 0.8,
+ position = position_dodge(width = 0.8),
+ alpha = 0.7,
+ show.legend = FALSE
+ ) +
+ geom_label(aes(label = nb_model), nudge_y = 0.3, size = 3) +
+ xlab("Standardized estimates") +
+ ylab(formula)
+
+ggplot(data = res_glmulti, aes(
+ x = importance,
+ y = as.factor(variable),
+ fill = estimates
+)) +
+ geom_bar(
+ stat = "identity",
+ show.legend = FALSE,
+ alpha = 0.8
+ ) +
+ xlim(c(0, 1)) +
+ geom_label(aes(label = nb_model, x = 0.1),
+ size = 3,
+ fill = "white"
+ ) +
+ scale_fill_viridis_b() +
+ xlab("Importance") +
+ ylab(formula)
+formula <- "Hill_0 ~ Abundance + Time + Height"
+res_glmulti_interaction <-
+ glmutli_pq(data_fungi, formula = formula, level = 2)
+#> Initialization...
+#> TASK: Exhaustive screening of candidate set.
+#> Fitting...
+#>
+#> After 50 models:
+#> Best model: Hill_0~1+Abundance+Time+Time:Abundance+Height:Abundance+Height:Time
+#> Crit= 1069.11608982306
+#> Mean crit= 1218.19009955263
+#> Completed.
+res_glmulti_interaction
+#> estimates unconditional_interval nb_model importance
+#> HeightHigh:Time 0.1004073616 4.167750e-02 8 0.04216251
+#> Abundance:HeightHigh 0.0001609310 8.984023e-08 8 0.09020701
+#> HeightLow -0.7865687564 9.769200e+00 32 0.24714664
+#> HeightMiddle -2.6419930721 2.789953e+01 32 0.24714664
+#> HeightLow:Time -0.6511123699 1.599292e+00 32 0.55051517
+#> HeightMiddle:Time -1.3322473025 3.078720e+00 32 0.55051517
+#> Abundance:Time -0.0001068559 4.586032e-09 32 0.81587143
+#> Abundance:HeightLow 0.0011137659 7.957713e-07 32 0.86967993
+#> Abundance:HeightMiddle 0.0017155970 1.245718e-06 32 0.86967993
+#> Abundance 0.0024839088 8.790126e-07 32 0.90902176
+#> Time 2.7869220741 2.663548e+00 32 0.92512111
+#> alpha variable
+#> HeightHigh:Time 4.006348e-01 HeightHigh:Time
+#> Abundance:HeightHigh 5.877776e-04 Abundance:HeightHigh
+#> HeightLow 6.171172e+00 HeightLow
+#> HeightMiddle 1.038989e+01 HeightMiddle
+#> HeightLow:Time 2.491898e+00 HeightLow:Time
+#> HeightMiddle:Time 3.449710e+00 HeightMiddle:Time
+#> Abundance:Time 1.335247e-04 Abundance:Time
+#> Abundance:HeightLow 1.759641e-03 Abundance:HeightLow
+#> Abundance:HeightMiddle 2.198334e-03 Abundance:HeightMiddle
+#> Abundance 1.847287e-03 Abundance
+#> Time 3.214276e+00 Time
+
+ggplot(data = res_glmulti_interaction, aes(x = estimates, y = variable)) +
+ geom_point(
+ size = 2,
+ alpha = 1,
+ show.legend = FALSE
+ ) +
+ geom_vline(
+ xintercept = 0,
+ linetype = "dotted",
+ linewidth = 1
+ ) +
+ geom_errorbar(
+ aes(xmin = estimates - alpha, xmax = estimates + alpha),
+ width = 0.8,
+ position = position_dodge(width = 0.8),
+ alpha = 0.7,
+ show.legend = FALSE
+ ) +
+ geom_label(aes(label = nb_model), nudge_y = 0.3, size = 3) +
+ xlab("Standardized estimates") +
+ ylab(formula)
+
+ggplot(data = res_glmulti_interaction, aes(
+ x = importance,
+ y = as.factor(variable),
+ fill = estimates
+)) +
+ geom_bar(
+ stat = "identity",
+ show.legend = FALSE,
+ alpha = 0.8
+ ) +
+ xlim(c(0, 1)) +
+ geom_label(aes(label = nb_model, x = 0.1),
+ size = 3,
+ fill = "white"
+ ) +
+ scale_fill_viridis_b() +
+ xlab("Importance") +
+ ylab(formula)
++#> [127] viridisLite_0.4.2 mvtnorm_1.2-4 +#> [129] tidytree_0.4.6 scales_1.3.0 +#> [131] crayon_1.5.2 rlang_1.1.3 +#> [133] multcomp_1.4-25sessionInfo() #> R version 4.3.3 (2024-02-29) #> Platform: x86_64-pc-linux-gnu (64-bit) @@ -213,12 +369,12 @@
Session information#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.13.so; LAPACK version 3.9.0 #> #> locale: -#> [1] LC_CTYPE=fr_FR.UTF-8 LC_NUMERIC=C -#> [3] LC_TIME=fr_FR.UTF-8 LC_COLLATE=fr_FR.UTF-8 -#> [5] LC_MONETARY=fr_FR.UTF-8 LC_MESSAGES=fr_FR.UTF-8 -#> [7] LC_PAPER=fr_FR.UTF-8 LC_NAME=C -#> [9] LC_ADDRESS=C LC_TELEPHONE=C -#> [11] LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=C +#> [1] LC_CTYPE=fr_FR.UTF-8 LC_NUMERIC=C +#> [3] LC_TIME=fr_FR.UTF-8 LC_COLLATE=fr_FR.UTF-8 +#> [5] LC_MONETARY=fr_FR.UTF-8 LC_MESSAGES=fr_FR.UTF-8 +#> [7] LC_PAPER=fr_FR.UTF-8 LC_NAME=fr_FR.UTF-8 +#> [9] LC_ADDRESS=fr_FR.UTF-8 LC_TELEPHONE=fr_FR.UTF-8 +#> [11] LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=fr_FR.UTF-8 #> #> time zone: Europe/Paris #> tzcode source: system (glibc) @@ -227,9 +383,10 @@
Session information#> [1] stats graphics grDevices utils datasets methods base #> #> other attached packages: -#> [1] ggh4x_0.2.8 MicrobiotaProcess_1.14.1 MiscMetabar_0.8.00 -#> [4] purrr_1.0.2 dplyr_1.1.4 dada2_1.30.0 -#> [7] Rcpp_1.0.12 ggplot2_3.5.0 phyloseq_1.46.0 +#> [1] glmulti_1.0.8 leaps_3.1 rJava_1.0-11 +#> [4] ggh4x_0.2.8 MicrobiotaProcess_1.14.1 MiscMetabar_0.9.1 +#> [7] purrr_1.0.2 dplyr_1.1.4 dada2_1.30.0 +#> [10] Rcpp_1.0.12 ggplot2_3.5.0 phyloseq_1.46.0 #> #> loaded via a namespace (and not attached): #> [1] libcoin_1.0-10 RColorBrewer_1.1-3 @@ -252,8 +409,8 @@
Session information#> [35] iterators_1.0.14 pkgconfig_2.0.3 #> [37] Matrix_1.6-5 R6_2.5.1 #> [39] fastmap_1.1.1 GenomeInfoDbData_1.2.11 -#> [41] MatrixGenerics_1.14.0 aplot_0.2.2 -#> [43] digest_0.6.35 ggnewscale_0.4.10 +#> [41] MatrixGenerics_1.14.0 digest_0.6.35 +#> [43] aplot_0.2.2 ggnewscale_0.4.10 #> [45] colorspace_2.1-0 ShortRead_1.60.0 #> [47] patchwork_1.2.0 S4Vectors_0.40.2 #> [49] textshaping_0.3.7 GenomicRanges_1.54.1 @@ -295,9 +452,10 @@
Session information#> [121] parallel_4.3.3 pkgdown_2.0.7 #> [123] latticeExtra_0.6-30 jpeg_0.1-10 #> [125] bitops_1.0-7 ggstar_1.0.4 -#> [127] mvtnorm_1.2-4 tidytree_0.4.6 -#> [129] scales_1.3.0 crayon_1.5.2 -#> [131] rlang_1.1.3 multcomp_1.4-25