ezstat {mbX}R Documentation

Statistical Analysis and Visualization of Microbiome Data

Description

Performs Kruskal_Wallis tests, post_hoc Dunn comparisons, Compact Letter Display (CLD) summaries, and generates boxplots annotated with CLD letters for taxa abundances grouped by a chosen metadata variable.

Usage

ezstat(microbiome_data, metadata, level, selected_metadata)

Arguments

microbiome_data

Character; path to the microbiome abundance table (CSV, TSV, XLS, or XLSX).

metadata

Character; path to the sample metadata file (CSV, TXT, XLS, or XLSX).

level

Character; taxonomic rank to aggregate at (e.g. "genus", "g").

selected_metadata

Character; name of the categorical metadata column to group by.

Details

This function first calls ezclean to produce a cleaned, merged table of sample IDs, metadata, and taxa abundances at the requested taxonomic level. It then:

  1. Runs Kruskal_Wallis tests on each taxon and writes results with FDR_correction.

  2. Performs Dunns pairwise post_hoc tests (BH_adjusted) for taxa with KW p less than or equal to 0.05.

  3. Computes CLD letters for significantly different groups and writes a summary Excel.

  4. Generates high-resolution (900 dpi) boxplots annotated with CLD letters.

Value

Invisibly returns the data.frame of cleaned sample_taxa abundances used for all analyses.

Examples

## Not run: 
  mb  <- system.file("extdata", "microbiome.csv", package = "mbX")
  md  <- system.file("extdata", "metadata.csv",   package = "mbX")
  if (nzchar(mb) && nzchar(md)) {
    ezstat(mb, md, "genus", "Group")
  }

## End(Not run)


[Package mbX version 0.2.0 Index]