# xutaoguo55/cade architecture

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

- Interactive diagram: https://gitdiagram.com/xutaoguo55/cade
- Repository: https://github.com/xutaoguo55/cade

## Overview

CADE is an R/Python research workflow for ranking how sensitive bulk differential-expression coefficients are to marker-derived cell-composition adjustment, without requiring matched single-cell references. The documented path is bulk expression, group labels and marker sets → relative composition weights → paired limma models → per-gene CCI and stability/calibration summaries. The repository also includes benchmark and validation analyses, result tables, and figure-generation scripts. Edges follow the README’s documented workflow and the sampled figure scripts’ visible table reads; most analysis-script internals were not sampled.

Main entry points: [`code/run_all.R`](https://github.com/xutaoguo55/cade/blob/main/code/run_all.R) (Workflow driver), [`code/cade_method.R`](https://github.com/xutaoguo55/cade/blob/main/code/cade_method.R) (CADE method), [`supplementary/raw_csv_components`](https://github.com/xutaoguo55/cade/tree/main/supplementary/raw_csv_components) (Supplementary tables), [`code/cade_external_validation_v4.R`](https://github.com/xutaoguo55/cade/blob/main/code/cade_external_validation_v4.R) (External validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["CADE workflow"]
  node_driver["Workflow driver<br/>[run_all.R]"]
  node_method["CADE method<br/>[cade_method.R]"]
  node_weights["Composition weights<br/>[cade_method.R]"]
  node_pairedmodels["Paired limma models<br/>[cade_method.R]"]
  node_cci["CCI outputs<br/>[cade_method.R]"]
end

subgraph group_robustness["Robustness and benchmarks"]
  node_ilr["ILR sensitivity"]
  node_multiseed["Multiseed stability"]
  node_benchmarks["Method benchmarks"]
  node_runtime["Runtime benchmarks"]
  node_diagnostics["Model diagnostics"]
end

subgraph group_validation["Validation and biology"]
  node_external["External validation"]
  node_scrna["scRNA benchmarks"]
  node_pbmc["PBMC benchmarks"]
  node_wgcna["WGCNA analysis<br/>[wgcna_standalone.R]"]
end

subgraph group_results["Results and figures"]
  node_tables["Result tables"]
  node_figworkflow["Workflow figure"]
  node_figbenchmark["Benchmark figure"]
  node_figpathway["Pathway figure"]
  node_figwgcna["WGCNA figure"]
  node_figsepsis["Sepsis figure"]
  node_suppdata["Supplementary tables"]
end

node_researcher(("Researcher"))
node_inputs["Expression and markers"]

node_researcher -->|"runs"| node_driver
node_inputs -->|"provides inputs"| node_method
node_driver -->|"runs workflow"| node_method
node_method -->|"estimates"| node_weights
node_method -->|"fits"| node_pairedmodels
node_method -->|"reports"| node_cci
node_driver -.->|"runs analysis"| node_ilr
node_driver -.->|"runs checks"| node_multiseed
node_driver -.->|"runs benchmarks"| node_benchmarks
node_driver -.->|"runs benchmarks"| node_runtime
node_driver -.->|"runs diagnostics"| node_diagnostics
node_driver -.->|"runs validation"| node_external
node_driver -.->|"runs benchmarks"| node_scrna
node_driver -.->|"runs benchmarks"| node_pbmc
node_driver -.->|"runs analysis"| node_wgcna
node_cci -.->|"summarized in"| node_tables
node_tables -->|"read by"| node_figbenchmark
node_suppdata -->|"read by"| node_figwgcna
node_suppdata -->|"read by"| node_figpathway
node_suppdata -->|"read by"| node_figsepsis
node_wgcna -.->|"summarized by"| node_figwgcna
node_external -.->|"summarized by"| node_figsepsis

click node_driver "https://github.com/xutaoguo55/cade/blob/main/code/run_all.R"
click node_method "https://github.com/xutaoguo55/cade/blob/main/code/cade_method.R"
click node_weights "https://github.com/xutaoguo55/cade/blob/main/code/cade_method.R"
click node_pairedmodels "https://github.com/xutaoguo55/cade/blob/main/code/cade_method.R"
click node_cci "https://github.com/xutaoguo55/cade/blob/main/code/cade_method.R"
click node_ilr "https://github.com/xutaoguo55/cade/blob/main/code/cade_ilr_uncertainty.R"
click node_multiseed "https://github.com/xutaoguo55/cade/blob/main/code/validate_cade_ilr_multiseed.R"
click node_benchmarks "https://github.com/xutaoguo55/cade/blob/main/code/benchmark_method_comparison.R"
click node_runtime "https://github.com/xutaoguo55/cade/blob/main/code/empirical_comparator_runtime_benchmark.R"
click node_diagnostics "https://github.com/xutaoguo55/cade/blob/main/code/generate_model_metadata_table.R"
click node_external "https://github.com/xutaoguo55/cade/blob/main/code/cade_external_validation_v4.R"
click node_scrna "https://github.com/xutaoguo55/cade/blob/main/code/cade_real_scRNA_benchmark_v2.R"
click node_pbmc "https://github.com/xutaoguo55/cade/blob/main/code/cade_pbmc_benchmark.R"
click node_wgcna "https://github.com/xutaoguo55/cade/blob/main/code/wgcna_standalone.R"
click node_tables "https://github.com/xutaoguo55/cade/tree/main/tables"
click node_figworkflow "https://github.com/xutaoguo55/cade/blob/main/code/generate_figure1_workflow_summary.py"
click node_figbenchmark "https://github.com/xutaoguo55/cade/blob/main/code/generate_figure2_benchmark_clean.py"
click node_figpathway "https://github.com/xutaoguo55/cade/blob/main/code/generate_figure5_pathway_clean.py"
click node_figwgcna "https://github.com/xutaoguo55/cade/blob/main/code/generate_figure6_wgcna_clean.py"
click node_figsepsis "https://github.com/xutaoguo55/cade/blob/main/code/generate_supp_figure_S2_sepsis.py"
click node_suppdata "https://github.com/xutaoguo55/cade/tree/main/supplementary/raw_csv_components"

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_driver,node_method,node_weights,node_pairedmodels,node_cci toneBlue
class node_ilr,node_multiseed,node_benchmarks,node_runtime,node_diagnostics toneAmber
class node_external,node_scrna,node_pbmc,node_wgcna toneMint
class node_tables,node_figworkflow,node_figbenchmark,node_figpathway,node_figwgcna,node_figsepsis,node_suppdata toneRose
class node_researcher,node_inputs toneIndigo
```

## Components

### CADE workflow

- [Workflow driver](https://github.com/xutaoguo55/cade/blob/main/code/run_all.R): `code/run_all.R`
- [CADE method](https://github.com/xutaoguo55/cade/blob/main/code/cade_method.R): `code/cade_method.R`
- [Composition weights](https://github.com/xutaoguo55/cade/blob/main/code/cade_method.R): `code/cade_method.R`
- [Paired limma models](https://github.com/xutaoguo55/cade/blob/main/code/cade_method.R): `code/cade_method.R`
- [CCI outputs](https://github.com/xutaoguo55/cade/blob/main/code/cade_method.R): `code/cade_method.R`

### Robustness and benchmarks

- [ILR sensitivity](https://github.com/xutaoguo55/cade/blob/main/code/cade_ilr_uncertainty.R): `code/cade_ilr_uncertainty.R`
- [Multiseed stability](https://github.com/xutaoguo55/cade/blob/main/code/validate_cade_ilr_multiseed.R): `code/validate_cade_ilr_multiseed.R`
- [Method benchmarks](https://github.com/xutaoguo55/cade/blob/main/code/benchmark_method_comparison.R): `code/benchmark_method_comparison.R`
- [Runtime benchmarks](https://github.com/xutaoguo55/cade/blob/main/code/empirical_comparator_runtime_benchmark.R): `code/empirical_comparator_runtime_benchmark.R`
- [Model diagnostics](https://github.com/xutaoguo55/cade/blob/main/code/generate_model_metadata_table.R): `code/generate_model_metadata_table.R`

### Validation and biology

- [External validation](https://github.com/xutaoguo55/cade/blob/main/code/cade_external_validation_v4.R): `code/cade_external_validation_v4.R`
- [scRNA benchmarks](https://github.com/xutaoguo55/cade/blob/main/code/cade_real_scRNA_benchmark_v2.R): `code/cade_real_scRNA_benchmark_v2.R`
- [PBMC benchmarks](https://github.com/xutaoguo55/cade/blob/main/code/cade_pbmc_benchmark.R): `code/cade_pbmc_benchmark.R`
- [WGCNA analysis](https://github.com/xutaoguo55/cade/blob/main/code/wgcna_standalone.R): `code/wgcna_standalone.R`

### Results and figures

- [Result tables](https://github.com/xutaoguo55/cade/tree/main/tables): `tables`
- [Workflow figure](https://github.com/xutaoguo55/cade/blob/main/code/generate_figure1_workflow_summary.py): `code/generate_figure1_workflow_summary.py`
- [Benchmark figure](https://github.com/xutaoguo55/cade/blob/main/code/generate_figure2_benchmark_clean.py): `code/generate_figure2_benchmark_clean.py`
- [Pathway figure](https://github.com/xutaoguo55/cade/blob/main/code/generate_figure5_pathway_clean.py): `code/generate_figure5_pathway_clean.py`
- [WGCNA figure](https://github.com/xutaoguo55/cade/blob/main/code/generate_figure6_wgcna_clean.py): `code/generate_figure6_wgcna_clean.py`
- [Sepsis figure](https://github.com/xutaoguo55/cade/blob/main/code/generate_supp_figure_S2_sepsis.py): `code/generate_supp_figure_S2_sepsis.py`
- [Supplementary tables](https://github.com/xutaoguo55/cade/tree/main/supplementary/raw_csv_components): `supplementary/raw_csv_components`

### Other components

- **Researcher**
- **Expression and markers**

## Connections

- Researcher → Workflow driver: runs (evidence: `README.md`)
- Expression and markers → CADE method: provides inputs (evidence: `README.md`)
- Workflow driver → CADE method: runs workflow (evidence: `README.md`)
- CADE method → Composition weights: estimates (evidence: `README.md`)
- CADE method → Paired limma models: fits (evidence: `README.md`)
- CADE method → CCI outputs: reports (evidence: `README.md`)
- Workflow driver → ILR sensitivity: runs analysis
- Workflow driver → Multiseed stability: runs checks
- Workflow driver → Method benchmarks: runs benchmarks
- Workflow driver → Runtime benchmarks: runs benchmarks
- Workflow driver → Model diagnostics: runs diagnostics
- Workflow driver → External validation: runs validation
- Workflow driver → scRNA benchmarks: runs benchmarks
- Workflow driver → PBMC benchmarks: runs benchmarks
- Workflow driver → WGCNA analysis: runs analysis
- CCI outputs → Result tables: summarized in
- Result tables → Benchmark figure: read by (evidence: `code/generate_figure2_benchmark_clean.py`)
- Supplementary tables → WGCNA figure: read by (evidence: `code/generate_figure6_wgcna_clean.py`)
- Supplementary tables → Pathway figure: read by (evidence: `code/generate_figure5_pathway_clean.py`)
- Supplementary tables → Sepsis figure: read by (evidence: `code/generate_supp_figure_S2_sepsis.py`)
- WGCNA analysis → WGCNA figure: summarized by
- External validation → Sepsis figure: summarized by
