The two scripts largely use the same MicrobiotaProcess functions; the main difference is *which `ps_` object you feed in for each task** (alpha, beta, composition plots).
What the “small” script currently does
- Creates one MPSE (often called
mpse_abund) from a taxa-filtered plotting object (e.g.ps.ng.tax_abund/ yourps_abund) and then runs alpha diversity + beta diversity + composition plotting all on that same MPSE. - It also uses rarefied abundance (
RareAbundance) as the input for some taxonomy abundance plots/heatmaps.
Implication: alpha/beta diversity are being computed on a taxa-filtered dataset, which can:
- artificially reduce richness (Observed/Chao1),
- shift Shannon/Simpson,
- and change distance structure (especially for presence/absence metrics, but also sometimes Bray).
What the updated MicrobiotaProcess workflow (recommended) does
It splits the workflow into two MPSE objects, each built from the correct upstream ps_*:
1) Diversity MPSE (mpse_div)
Input: ps_filt (QC-filtered samples, full taxa set; not filtered “for plotting”)
- Alpha diversity: do rarefaction inside MPSE (
mp_rrarefy()) and compute alpha onRareAbundance. - Beta diversity (your current Bray+Hellinger): compute Hellinger from non-rarefied
Abundanceand then Bray/PCoA/PERMANOVA.
2) Plotting MPSE (mpse_plot)
Input: ps_abund_rel (taxa filtered for readability; relative abundance)
- Use this MPSE only for composition plots (stacked bars, heatmaps).
Implication: you keep diversity analyses biologically faithful (no “plotting filter”) while still producing clean, readable composition plots.
Other (non-critical) differences
- The updated script uses
prune_samples()+prune_taxa()instead of overwritingotu_table()manually (safer / less error-prone). - Outputs are consistently written into a
figures/directory.
Bottom line
Same MicrobiotaProcess functions; the updated script mainly fixes the *recommended `ps_` input choice** for each analysis type (diversity vs. plotting).