Result Integration and Clinical Reporting - egenomics/agb2025 GitHub Wiki
Result Integration and Clinical Reporting
This section of the AGB pipeline focuses on transforming microbiome analysis results into clinically interpretable outputs. It integrates processed data, visual analytics, and metadata correlations into a final report suitable for both researchers and clinicians.
Data Upload & Overview Module
This module allows users to upload sample metadata and sequencing data files. It ensures consistency in formatting and validates metadata fields (e.g., sample IDs, collection dates, storage conditions).
-
Upload raw or processed metadata.
-
Standardize clinical and experimental fields.
-
Visual summary of data completeness.
-
Compatibility checks with downstream modules.
Taxonomic Composition Analysis
This module visualizes taxonomic profiles from microbiome samples at user-selected taxonomic levels (e.g., species, genus). It allows stratified comparisons between groups such as patients and controls, and supports metadata-based grouping and statistical testing.
Interactive Controls:
-
Taxonomic Level selector (Species, Genus)
-
Sample Group filters (All, Patients Only, Controls Only)
-
Group by Metadata for subgroup analysis (e.g., gender, BMI category)
-
Compare Patients vs Controls checkbox for stratified barplots
-
Minimum Abundance (%) slider to filter low-abundance taxa
-
Color Scheme selector to adjust plot aesthetics
Summary Panels:
-
Total Species Identified
-
Dominant Species (e.g., Lactobacillus acidophilus)
-
Number of Samples Analyzed
Visual Outputs:
-
Relative Abundance Barplots: Grouped by clinical condition (Control vs Patient), showing taxon-level compositions per sample. Sorted by abundance, colored by species with a downloadable legend and plot export button.
-
Heatmap View (if activated): A tabbed alternative visualization for denser comparison across many taxa and samples.
Statistical Testing
-
PERMANOVA – Tests global differences in microbial communities.
-
Wilcoxon Test – Non-parametric test for comparing two groups.
-
T-test – Parametric test for log-transformed abundance data.
An integrated info box helps users understand which test to apply depending on the data and analysis goals
Diversity Analysis
This module quantifies and visualizes microbial diversity across samples, enabling interpretation of within-sample (alpha) and between-sample (beta) variation. Users can customize metrics, plot styles, and metadata-based groupings for exploratory or hypothesis-driven analysis.
Alpha Diversity
Measures richness and evenness of microbial communities within each sample.
Available Metrics:
-
Observed OTUs – Raw count of unique taxa (richness only).
-
Shannon Index – Combines richness and evenness.
-
Simpson Index – Reflects dominance/evenness.
Beta Diversity
Evaluates between-sample differences in microbial composition using dissimilarity/distance metrics.
Distance Metrics:
-
Bray-Curtis – Abundance-based, sensitive to common taxa.
-
Jaccard – Presence/absence-based.
-
Others: Euclidean, Manhattan, Canberra, etc.
Ordination Methods:
-
PCoA – Preserves distance dissimilarity.
-
NMDS – Non-linear rank-based visualization.
-
UMAP, t-SNE, dbRDA (for advanced cases)
Clinical & Lifestyle Correlations
This module explores the relationship between microbial community features and clinical or lifestyle metadata through a Parallel Coordinates Plot. It is designed to help detect trends and patterns that link clinical phenotypes or patient characteristics to microbial profiles.
Metadata Selection Select any combination of clinical or lifestyle variables such as:
-
Gender
-
Age
-
Ongoing conditions (e.g., IBD, diabetes, IBS)
Lines connect metadata variables to the total microbial abundance or other quantitative traits (e.g., diversity index, taxonomic count), highlighting correlations and patterns across metadata dimensions.
Phylogenetic Tree
This module provides interactive visualization of microbial phylogenetic trees, allowing users to explore evolutionary relationships between taxa detected in their samples.
Upload & Initialization:
-
Upload tree: Load a tree in the .nwk format
-
Upload taxonomy.tsv: Load a tree-compatible taxonomy file in .tsv format that includes hierarchical classification.
-
Load Tree: After selecting the file, click to render the tree. A status message will indicate success or file issues (e.g., permissions or format problems).
Visualization Options:
-
Tree Layout: Choose among different tree topologies:Rectangular (default), Circular, Unrooted
-
Tree Display Options: Show Tip Labels, Show Node Support (if bootstraps available), Show Branch Lengths
-
Text Size Slider: Dynamically adjust font size for readability (0.4 to 5 range).
Summary & Reports
This module allows users to generate a comprehensive microbiome analysis report that consolidates results from all major modules into a customizable, publication-ready document.
Report Configuration
-
Report Title:Customize the title that will appear at the top of your report (e.g., Microbiome Analysis Report).
-
Output Format: Choose the format of the report: HTML Document (interactive), PDF Document, Word Document
-
Analysis Comments: Add notes regarding analysis decisions, methodology, interpretation of results, or limitations.
Requeriments
Before running the AGB Microbiome Shiny App, please make sure you have R installed with the following packages. You can install all packages at once with:
cran_packages <- c(
"shiny", "shinydashboard", "shinyBS", "ggplot2", "plotly", "DT", "readr",
"tidyverse", "dplyr", "tidyr", "stringr", "broom", "reshape2",
"RColorBrewer", "ggbeeswarm", "bslib", "viridis", "FSA"
)
install.packages(cran_packages)
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
bioc_packages <- c("phyloseq", "vegan", "ComplexHeatmap", "circlize", "ggtree", "treeio")
BiocManager::install(bioc_packages)
# Install devtools if missing
if (!requireNamespace("devtools", quietly = TRUE))
install.packages("devtools")
# GitHub-only packages
devtools::install_github("dill/beyonce")
devtools::install_github("mtennekes/tayloRswift")