This repository contains the NGS 16S rRNA amplicon data analysis pipeline for investigating the effects of bio-based gasification char addition on anaerobic digestion reactor microbiomes.
NGS_Reactors/
├── data/
│ ├── V1/ # Trial 1 data
│ └── V2/ # Trial 2 data (exemplary workflow)
│ ├── raw/ # Raw NGS output from Mothur
│ └── processed/ # Processed R data objects
├── scripts/ # Analysis R Markdown files
│ ├── data.Rmd # Data preparation
│ ├── adapt-phase.Rmd # Adaptation phase analysis
│ ├── char-phase.Rmd # Char addition phase analysis
│ ├── heat-tree.Rmd # Taxonomic visualizations
│ └── lefse.Rmd # LEfSe analysis
├── src/ # Helper functions
│ ├── data.R # Data import and processing
│ ├── tax.R # Taxonomy preparation
│ └── lefse_prep.R # LEfSe data preparation
├── results/ # Output wertables
├── renv.lock # Package versions
└── FAPROTAX.txt # Functional annotation database
Two trials (V1, V2) with anaerobic digestion reactors:
- Char reactors (R1, R2, R6): With bio-based gasification char
- Control reactors (R3, R4, R5): Without char
All analyses are exemplified using Trial 2 (V2) data.
- Imports sample metadata and raw Mothur NGS output
- Validates and reorders data (Mothur changes sample order)
- Splits into adaptation and char phases
- Output:
data/V2/processed/trial.RData
Adaptation Phase (adapt-phase.Rmd):
- Core biome identification
- PERMANOVA and ANOSIM to verify reactor similarity
Char Phase (char-phase.Rmd):
- Core biome analysis
- Community composition tests (PERMANOVA, ANOSIM)
- PCA ordinations with environmental variable fitting
- Archaea and Bacteria specific analyses (boxplots, heatmaps)
Additional Analyses:
heat-tree.Rmd: Taxonomic tree visualizationslefse.Rmd: Differential abundance analysis
- R ≥ 4.5.1
- RStudio
# Install renv
install.packages("renv")
# Restore all project packages
renv::restore()All required packages (including Bioconductor packages like vegan, lefser, ggplot2, etc.) are automatically installed from renv.lock.
Execute scripts in order for Trial 2:
rmarkdown::render("scripts/data.Rmd")
rmarkdown::render("scripts/adapt-phase.Rmd")
rmarkdown::render("scripts/char-phase.Rmd")
rmarkdown::render("scripts/heat-tree.Rmd")
rmarkdown::render("scripts/lefse.Rmd")For Trial 1 (V1): Modify file paths in data.Rmd to point to data/V1/ directory.
src/data.R: Core functions for data import, validation, and core biome filtering
src/lefse_prep.R: Data preparation for LEfSe analysis
src/tax.R: Taxonomy formatting and string preparation
Christian Margreiter & Jakob Klotz