# zellerlab/crc-meta-ii architecture

> Architecture diagram of the GitHub repository zellerlab/crc-meta-ii, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zellerlab/crc-meta-ii
- Repository: https://github.com/zellerlab/crc-meta-ii

## Overview

This repository is a research workflow for a colorectal-cancer gut-microbiome meta-analysis. Its principal path trains random-forest classifiers, evaluates cross-study and leave-one-study-out performance, and writes results; separate analysis and SHAP workflows support statistical comparison and model interpretation, while plotting scripts generate manuscript figures. The README documents these broad relationships but no source excerpts were provided, so edges are limited to those stated there; the contents and finer call structure of scripts and data files are not verified.

Main entry points: [`data/results/scv.loso`](https://github.com/zellerlab/crc-meta-ii/tree/main/data/results/scv.loso) (Model results), [`models/01.Train.16s.wgs.rf.models.R`](https://github.com/zellerlab/crc-meta-ii/blob/main/models/01.Train.16s.wgs.rf.models.R) (16S/WGS models), [`models/02.Train.eo.lo.crc.rf.models.R`](https://github.com/zellerlab/crc-meta-ii/blob/main/models/02.Train.eo.lo.crc.rf.models.R) (EO/LO models), [`models/03.Train.unified.crc.model.R`](https://github.com/zellerlab/crc-meta-ii/blob/main/models/03.Train.unified.crc.model.R) (Unified CRC model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_modeling["Model training"]
  node_rf16["16S/WGS models"]
  node_eolo["EO/LO models"]
  node_unified["Unified CRC model"]
  node_admodel["AD control model"]
end

subgraph group_evaluation["Model evaluation"]
  node_loso["LOSO models"]
  node_losorun["LOSO runner"]
  node_sst["SST evaluation"]
  node_holdout["EO holdout test"]
  node_adtest["AD classifier test"]
end

subgraph group_analysis["Statistical analysis"]
  node_analysis["Statistical analyses"]
  node_lmm16["16S/WGS LMM<br/>[02.lmm.16S.WGS.R]"]
  node_lmmeolo["EO/LO LMM<br/>[03.lmm.EO.LO.R]"]
end

subgraph group_interpretation["SHAP interpretation"]
  node_shapprep["SHAP preparation"]
  node_shaprun["SHAP calculation<br/>[run_SHAP_test.R]"]
  node_shapsummary["Median SHAP values"]
end

subgraph group_outputs["Research outputs"]
  node_modelresults[("Model results<br/>[scv.loso]")]
  node_shapresults[("SHAP results<br/>[shap.analysis]")]
  node_plots["Figure generation"]
  node_figures["Manuscript figures"]
end

node_researcher(("Researcher"))

node_researcher -->|"runs training"| node_rf16
node_researcher -->|"runs training"| node_eolo
node_researcher -->|"runs training"| node_unified
node_researcher -->|"runs training"| node_admodel
node_rf16 -->|"saves outputs"| node_modelresults
node_eolo -->|"saves outputs"| node_modelresults
node_unified -->|"saves outputs"| node_modelresults
node_researcher -->|"submits via SLURM"| node_losorun
node_losorun -->|"runs models"| node_loso
node_loso -->|"stores evaluation"| node_modelresults
node_researcher -->|"runs evaluation"| node_sst
node_sst -->|"stores evaluation"| node_modelresults
node_researcher -->|"runs test"| node_holdout
node_researcher -->|"runs test"| node_adtest
node_researcher -->|"runs analyses"| node_analysis
node_researcher -->|"runs analysis"| node_lmm16
node_researcher -->|"runs analysis"| node_lmmeolo
node_researcher -->|"runs SHAP workflow"| node_shapprep
node_researcher -->|"runs SHAP workflow"| node_shaprun
node_researcher -->|"computes medians"| node_shapsummary
node_shapsummary -->|"saves values"| node_shapresults
node_researcher -->|"runs plotting"| node_plots
node_plots -->|"generates figures"| node_figures

click node_rf16 "https://github.com/zellerlab/crc-meta-ii/blob/main/models/01.Train.16s.wgs.rf.models.R"
click node_eolo "https://github.com/zellerlab/crc-meta-ii/blob/main/models/02.Train.eo.lo.crc.rf.models.R"
click node_unified "https://github.com/zellerlab/crc-meta-ii/blob/main/models/03.Train.unified.crc.model.R"
click node_admodel "https://github.com/zellerlab/crc-meta-ii/blob/main/models/06.Train.ad.ctr.model.R"
click node_loso "https://github.com/zellerlab/crc-meta-ii/blob/main/models/Train.LOSO.rf.models.R"
click node_losorun "https://github.com/zellerlab/crc-meta-ii/blob/main/models/04.run.Train.LOSO.rf.models.sh"
click node_sst "https://github.com/zellerlab/crc-meta-ii/blob/main/models/05.Train.SCV.SST.rf.models.R"
click node_holdout "https://github.com/zellerlab/crc-meta-ii/blob/main/models/02a.Test.eo.as.holdout.using.diff.cutoffs.R"
click node_adtest "https://github.com/zellerlab/crc-meta-ii/blob/main/models/07.Test.ad.with.unified.crc.classifier.R"
click node_analysis "https://github.com/zellerlab/crc-meta-ii/tree/main/src/analysis"
click node_lmm16 "https://github.com/zellerlab/crc-meta-ii/blob/main/src/analysis/02.lmm.16S.WGS.R"
click node_lmmeolo "https://github.com/zellerlab/crc-meta-ii/blob/main/src/analysis/03.lmm.EO.LO.R"
click node_shapprep "https://github.com/zellerlab/crc-meta-ii/blob/main/src/analysis/04a.prepare.data.and.models.for.shap.analysis.R"
click node_shaprun "https://github.com/zellerlab/crc-meta-ii/blob/main/src/analysis/run_SHAP_test.R"
click node_shapsummary "https://github.com/zellerlab/crc-meta-ii/blob/main/src/analysis/04d.get.shap.median.values.R"
click node_modelresults "https://github.com/zellerlab/crc-meta-ii/tree/main/data/results/scv.loso"
click node_shapresults "https://github.com/zellerlab/crc-meta-ii/tree/main/data/results/shap.analysis"
click node_plots "https://github.com/zellerlab/crc-meta-ii/tree/main/src/plotting"
click node_figures "https://github.com/zellerlab/crc-meta-ii/tree/main/figures"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_rf16,node_eolo,node_unified,node_admodel toneBlue
class node_loso,node_losorun,node_sst,node_holdout,node_adtest toneAmber
class node_analysis,node_lmm16,node_lmmeolo toneMint
class node_shapprep,node_shaprun,node_shapsummary toneRose
class node_modelresults,node_shapresults,node_plots,node_figures,node_researcher toneIndigo
```

## Components

### Model training

- [16S/WGS models](https://github.com/zellerlab/crc-meta-ii/blob/main/models/01.Train.16s.wgs.rf.models.R): `models/01.Train.16s.wgs.rf.models.R`
- [EO/LO models](https://github.com/zellerlab/crc-meta-ii/blob/main/models/02.Train.eo.lo.crc.rf.models.R): `models/02.Train.eo.lo.crc.rf.models.R`
- [Unified CRC model](https://github.com/zellerlab/crc-meta-ii/blob/main/models/03.Train.unified.crc.model.R): `models/03.Train.unified.crc.model.R`
- [AD control model](https://github.com/zellerlab/crc-meta-ii/blob/main/models/06.Train.ad.ctr.model.R): `models/06.Train.ad.ctr.model.R`

### Model evaluation

- [LOSO models](https://github.com/zellerlab/crc-meta-ii/blob/main/models/Train.LOSO.rf.models.R): `models/Train.LOSO.rf.models.R`
- [LOSO runner](https://github.com/zellerlab/crc-meta-ii/blob/main/models/04.run.Train.LOSO.rf.models.sh): `models/04.run.Train.LOSO.rf.models.sh`
- [SST evaluation](https://github.com/zellerlab/crc-meta-ii/blob/main/models/05.Train.SCV.SST.rf.models.R): `models/05.Train.SCV.SST.rf.models.R`
- [EO holdout test](https://github.com/zellerlab/crc-meta-ii/blob/main/models/02a.Test.eo.as.holdout.using.diff.cutoffs.R): `models/02a.Test.eo.as.holdout.using.diff.cutoffs.R`
- [AD classifier test](https://github.com/zellerlab/crc-meta-ii/blob/main/models/07.Test.ad.with.unified.crc.classifier.R): `models/07.Test.ad.with.unified.crc.classifier.R`

### Statistical analysis

- [Statistical analyses](https://github.com/zellerlab/crc-meta-ii/tree/main/src/analysis): `src/analysis`
- [16S/WGS LMM](https://github.com/zellerlab/crc-meta-ii/blob/main/src/analysis/02.lmm.16S.WGS.R): `src/analysis/02.lmm.16S.WGS.R`
- [EO/LO LMM](https://github.com/zellerlab/crc-meta-ii/blob/main/src/analysis/03.lmm.EO.LO.R): `src/analysis/03.lmm.EO.LO.R`

### SHAP interpretation

- [SHAP preparation](https://github.com/zellerlab/crc-meta-ii/blob/main/src/analysis/04a.prepare.data.and.models.for.shap.analysis.R): `src/analysis/04a.prepare.data.and.models.for.shap.analysis.R`
- [SHAP calculation](https://github.com/zellerlab/crc-meta-ii/blob/main/src/analysis/run_SHAP_test.R): `src/analysis/run_SHAP_test.R`
- [Median SHAP values](https://github.com/zellerlab/crc-meta-ii/blob/main/src/analysis/04d.get.shap.median.values.R): `src/analysis/04d.get.shap.median.values.R`

### Research outputs

- [Model results](https://github.com/zellerlab/crc-meta-ii/tree/main/data/results/scv.loso): `data/results/scv.loso`
- [SHAP results](https://github.com/zellerlab/crc-meta-ii/tree/main/data/results/shap.analysis): `data/results/shap.analysis`
- [Figure generation](https://github.com/zellerlab/crc-meta-ii/tree/main/src/plotting): `src/plotting`
- [Manuscript figures](https://github.com/zellerlab/crc-meta-ii/tree/main/figures): `figures`

### Other components

- **Researcher**

## Connections

- Researcher → 16S/WGS models: runs training (evidence: `README.md`)
- Researcher → EO/LO models: runs training (evidence: `README.md`)
- Researcher → Unified CRC model: runs training (evidence: `README.md`)
- Researcher → AD control model: runs training (evidence: `README.md`)
- 16S/WGS models → Model results: saves outputs (evidence: `README.md`)
- EO/LO models → Model results: saves outputs (evidence: `README.md`)
- Unified CRC model → Model results: saves outputs (evidence: `README.md`)
- Researcher → LOSO runner: submits via SLURM (evidence: `README.md`)
- LOSO runner → LOSO models: runs models (evidence: `README.md`)
- LOSO models → Model results: stores evaluation (evidence: `README.md`)
- Researcher → SST evaluation: runs evaluation (evidence: `README.md`)
- SST evaluation → Model results: stores evaluation (evidence: `README.md`)
- Researcher → EO holdout test: runs test (evidence: `README.md`)
- Researcher → AD classifier test: runs test (evidence: `README.md`)
- Researcher → Statistical analyses: runs analyses (evidence: `README.md`)
- Researcher → 16S/WGS LMM: runs analysis (evidence: `README.md`)
- Researcher → EO/LO LMM: runs analysis (evidence: `README.md`)
- Researcher → SHAP preparation: runs SHAP workflow (evidence: `README.md`)
- Researcher → SHAP calculation: runs SHAP workflow (evidence: `README.md`)
- Researcher → Median SHAP values: computes medians (evidence: `README.md`)
- Median SHAP values → SHAP results: saves values (evidence: `README.md`)
- Researcher → Figure generation: runs plotting (evidence: `README.md`)
- Figure generation → Manuscript figures: generates figures (evidence: `README.md`)
