microbiome / mia

Microbiome analysis
https://microbiome.github.io/mia/
Artistic License 2.0
50 stars 27 forks source link

Add PERMANOVA functions #657

Closed TuomasBorman closed 1 week ago

TuomasBorman commented 2 weeks ago

Add wrappers for vegan::adonis2()

antagomir commented 1 week ago

PERMANOVA (adonis2) and dbRDA are closely related.

It might be useful to cross-reference them and mention (perhaps also demonstrate) situation where they can be used for essentially similar purpose (e.g. two-group comparison). And perhaps then also situations where they differ.

PERMANOVA is non-parametric and makes less assumptions, (db)RDA has a bit wider scope overall.

library(vegan)
data(varespec, varechem)
g <-  sample(1:2, 24, replace=TRUE)

## dbrda
res.rda <- dbrda(varespec ~ g, dist="bray")
anova(res.rda)

res.ado <- adonis2(varespec ~ g, method = "bray")
res.ado
codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 91.20879% with 8 lines in your changes missing coverage. Please review.

Project coverage is 68.88%. Comparing base (c4ac515) to head (4813439). Report is 1 commits behind head on devel.

Files with missing lines Patch % Lines
R/getPERMANOVA.R 87.93% 7 Missing :warning:
R/runCCA.R 96.96% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## devel #657 +/- ## ========================================== + Coverage 68.63% 68.88% +0.24% ========================================== Files 44 45 +1 Lines 5516 5579 +63 ========================================== + Hits 3786 3843 +57 - Misses 1730 1736 +6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.