A flexible ordination and PERMANOVA analysis pipeline for phyloseq objects, supporting custom grouping, interactions, and automatic sample filtering.
This function provides a flexible ordination and PERMANOVA analysis pipeline for phyloseq objects, supporting custom grouping, interactions, and automatic sample filtering. The pipeline is fully adaptable to any gene marker or community dataset.
- Download or Source the Function
 
You can source the R script directly from your local folder:
source("run_ordination_analysis.R")
OR from
source("https://raw.githubusercontent.com/mghotbi/run_ordination_analysis/Rhizosphere-nitrogen-fate/run_ordination_analysis.R")
# Load your normalized phyloseq object (ps_16s_norm) # normalization_set function in DspikeIn package
result <- run_ordination_analysis(
  ps_obj = ps_16s_norm,
  marker_label = "Prokaryotic Community",
  group_var = "Condition",
  interaction_var = "Wheat",
  replicate_var = "Replicate",
  treatment_levels = c("Optimum", "Drought", "Heat", "Drought+Heat"))
# View the plot and PERMANOVA
result$plot
result$permanova