B
BarCodeR documentationEmbedded documentation — works offline
/

Analysis — Methodological guide

1. Purpose and module structure#

The Analysis tab contains six statistical families: differential abundance, ordination, matrix comparison, association networks, PERMANOVA/dispersion, and clustering. They answer different questions and are not interchangeable. Every result depends on the dataset, taxonomic level, filtering, transformation, distance, model, covariates and experimental design.

2. Shared operating model#

Scientific parameters require a new run; visual settings normally reuse the last result. An old figure may remain visible after a scientific parameter changes, so always check the “recalculation required” state. Differential analysis, ordination, matrix comparison, networks and clustering use independent local staged filters. These filters do not alter datasets() and must be reproduced in the Filtration tab to become persistent. A method can fail because of insufficient samples, replicates or taxa, missing metadata/tree, invalid data type, a non-estimable model or a missing package.

3. Differential abundance analysis#

Available engines are ANCOM-BC2, LinDA, ALDEx2, corncob and MaAsLin 3. They estimate related but non-identical quantities: natural-log fold changes, log2 fold changes, CLR differences or logit coefficients. Models may include a main factor, a reference level, covariates and, where supported, random effects. Changing the reference changes the sign. Complete confounding cannot be corrected by adding a covariate. ALDEx2 and corncob do not support random effects and are excluded when they are requested. These methods primarily expect count data; transformed, negative or proportional data can be invalid.

4. Multi-engine consensus#

Comparison mode applies a shared prevalence filter so all engines test the same taxa. Consensus compares adjusted significance and effect direction, never effect magnitude because scales are incompatible. corncob dispersion and MaAsLin 3 prevalence are separate biological questions and do not enter the abundance vote. Use a consistent multiple-testing correction, usually Benjamini-Hochberg, and interpret q-value, effect, prevalence, abundance and agreement together.

5. Ordination methods#

PCA summarizes a transformed Euclidean matrix; PCoA represents a distance matrix; NMDS preserves distance ranks; CCA, RDA and dbRDA constrain community structure by metadata. Raw-count PCA is often driven by library size and dominant taxa. PCoA may have negative eigenvalues for non-Euclidean distances. NMDS requires stress, convergence, goodness and Shepard diagnostics. CCA is generally suited to long unimodal gradients, whereas RDA is suited to shorter linear gradients; DCA length can guide the choice.

6. Ordination settings and diagnostics#

Transformations include relative abundance, Hellinger, log1p, CLR and VST. CLR requires a positive pseudo-count; VST requires DESeq2. Not all transformation-distance combinations are coherent: CLR plus Bray-Curtis is problematic, Aitchison already uses log-ratio geometry, Jaccard fits presence/absence, and UniFrac requires a matched phylogenetic tree. Rarefaction requires integer counts, discards reads and may remove samples. Overlays such as ellipses or envfit vectors aid interpretation but are not causal tests. Saved ordinations can be compared with Procrustes.

7. Matrix comparison#

This module compares datasets measured on the same biological units. Sample matching is mandatory and may use cleaned names or metadata keys. Duplicated or ambiguous keys invalidate the analysis. Mantel tests distance-matrix correlation; Procrustes/PROTEST aligns ordinations and identifies samples with large residuals; co-inertia finds shared axes; MCOA builds a multi-dataset consensus from the intersection of common samples. Additional views include overlap, A/B PCoA, alpha diversity, PERMANOVA, dispersion and taxonomic intersections.

8. Association networks#

Nodes are taxa and edges are statistical associations, not proven ecological interactions. Preparation can aggregate taxa, filter prevalence/abundance, remove unassigned taxa, normalize and transform. Methods include CLR correlations, proportionality, SPIEC-EASI, SparCC, gCoda, CCLasso and mixOmics sPLS. Composition-aware methods apply their own processing, so external transformations may be disabled to prevent double correction. Edge robustness can be assessed with q-values and bootstrap stability. Hubs and modules remain hypotheses.

9. Network comparison and multi-domain networks#

Networks may be inferred separately by metadata group and compared through shared/specific edges, signs, hubs, modules and Jaccard similarity. Unequal group sizes can create apparent differences through unequal power. Multi-domain mode combines matched marker datasets and uses common samples only. Outputs include interactive graphs, domain interaction matrices, Sankey/Chord views, edge tables and GraphML. Cross-domain edges do not demonstrate direct biological interaction.

10. PERMANOVA and dispersion#

PERMANOVA (adonis2) tests group-centroid differences in a distance space. PERMDISP (betadisper) tests differences in within-group dispersion. A significant PERMANOVA with significant PERMDISP is potentially confounded by dispersion. Models may include covariates, free formulas, permutation blocks, sequential or marginal tests and pairwise contrasts. Sequential results depend on term order; marginal R² values are not necessarily additive. Permutation strata are essential for paired or repeated designs.

11. Clustering#

Clustering is unsupervised and can group samples, taxa or both. Transformations and distances define similarity. Hierarchical linkage methods are compared using cophenetic correlation; Ward methods are excluded for incompatible distances. Candidate cluster numbers are assessed with silhouette, Dunn index, height jumps and cluster sizes. The statistically preferred k is not automatically biologically meaningful. Heatmap scaling by taxa highlights patterns but removes absolute abundance differences.

12. Transformations, distances and data type#

Raw counts plus Bray emphasize absolute abundance; relative abundance plus Bray emphasizes composition; presence/absence plus Jaccard emphasizes shared taxa; CLR/Euclidean or Aitchison emphasizes log-ratios; UniFrac emphasizes phylogeny. Metabarcoding data are compositional. Rarefaction, ALDEx2, ANCOM-BC and several network methods expect counts. Never treat CLR values as reads. A pseudo-count enables logarithms but does not determine the biological meaning of zeros.

13. Experimental design and interpretation#

Statistics cannot replace biological replication. Too many covariates for too few samples produce unstable models. Complete confounding prevents separation of effects. Interactions require observations in all relevant combinations. Thousands of taxon-level tests require adjusted p-values. Permutation resolution is limited: 999 permutations give a minimum p-value near 0.001. Biological importance requires effect size, R², stability, prevalence, abundance and ecological plausibility, not significance alone.

14. Histories, exports and reproducibility#

Each submodule stores snapshots in the current project only after explicit saving. Snapshots may include parameters, results, PNG, RDS, XLSX/TSV, logs and package versions. “R code” exports attempt to reproduce the saved result and may depend on the snapshot RDS, package versions and random seeds. Supported figures can be reused in MultiView. Network GraphML exports can be opened in Cytoscape or Gephi.

15. Performance and dependencies#

Expensive cases include multiple differential engines at ASV level, NMDS and many permutations, MCOA, bootstrapped SPIEC-EASI networks, pairwise PERMANOVA and large clustering matrices. Start at an aggregated rank, filter rare taxa, limit engines/contrasts/permutations and reduce network size. Optional packages include ANCOMBC, MicrobiomeStat, ALDEx2, corncob, maaslin3, vegan, ade4, SpiecEasi, propr, gCoda, CCLasso, mixOmics, DESeq2 and openxlsx. Cancellation may only occur between non-interruptible units.

16. Troubleshooting#

Symptom Likely reason Action
Old figure Run not restarted Check dirty state and rerun
Engine skipped Missing package or incompatible data/model Read log and change engine/settings
CLR + Bray warning Incoherent geometry Use Aitchison/Euclidean or another transform
UniFrac unavailable Missing or unmatched tree Check tips and rooting
Few common samples Bad matching key Review duplicates and name cleaning
Dense/empty network Edge threshold or low power Adjust filtering and robustness thresholds
PERMANOVA and PERMDISP significant Dispersion confounding Interpret cautiously
Ward unavailable Incompatible distance Use a compatible distance or linkage

17. Checklists and recommended workflow#

Validate counts, groups, reference, replicates, missing values, covariates and random effects before differential analysis. For ordination/PERMANOVA, choose transformation and distance together, define permutation blocks and inspect stress/eigenvalues/dispersion. For matrix comparison, validate matching keys and common samples. For networks, limit rare taxa and assess stability. Recommended sequence: Description → persistent filtering → descriptive ordination → dispersion/PERMANOVA → differential abundance → matrix comparison for multi-marker studies → networks/clustering for hypothesis generation → save figures/tables/code → save project.

18. Main limitations and verified sources#

Submodules have independent states and filters; a visible figure may be stale; engine effects use incompatible scales; not all engines support random effects; PERMANOVA can be dispersion-sensitive; matrix comparison depends entirely on matching; networks are associations, not causality; clustering is highly preparation-dependent; heavy methods consume substantial memory/time; histories require manual saving. Sources were verified in modules/analyse/ (main, daa_ancombc, ordination, comparaison_matrices, reseaux_d_association, _shared/fct_permanova.R, permanova_dispersion, clustering) and the corresponding architecture files.