# sarhnagniafariba-maker/tnbc-immunotherapy-prediction architecture

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

- Interactive diagram: https://gitdiagram.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction
- Repository: https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction

## Overview

This is a research prototype for predicting TNBC immunotherapy response from multi-omics and clinical inputs. Its intended workflow is cohort data preparation, graph construction, GCN training, held-out evaluation, and SHAP/attention-based interpretation. The graph preserves those documented stages and the sampled training/model/analysis modules. Several documented capabilities (including GEO integration and preprocessing) are not represented by dedicated visible files, so edges to them are limited to what the README or excerpts establish; the README also describes a future rather than implemented multimodal scope.

Main entry points: [`script/train.py`](https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/script/train.py) (Fold preprocessing and training), [`script/evaluate.py`](https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/script/evaluate.py) (Predictive evaluation), [`script/explain.py`](https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/script/explain.py) (SHAP and ablation analysis), [`models/gcn-models.py`](https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/models/gcn-models.py) (GCN predictor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Cohort data"]
  node_dummy["Synthetic cohort generator<br/>[make-dummy-data.py]"]
  node_cohort[("GEO and cohort inputs")]
  node_graph["Feature graph builder<br/>[graph-utils.py]"]
end

subgraph group_learning["Graph learning"]
  node_training["Fold preprocessing and training<br/>[train.py]"]
  node_gcn["GCN predictor<br/>[gcn-models.py]"]
end

subgraph group_analysis["Model analysis"]
  node_evaluation["Predictive evaluation<br/>[evaluate.py]"]
  node_metrics["Metric utilities<br/>[metrics.py]"]
  node_explanation["SHAP and ablation analysis<br/>[explain.py]"]
  node_predictions["Response predictions"]
  node_interpretations["Biomarker interpretations"]
end

node_researcher(("Researcher"))

node_researcher -->|"generates test data"| node_dummy
node_dummy -->|"writes synthetic inputs"| node_cohort
node_cohort -->|"loads inputs"| node_training
node_researcher -->|"builds feature graph"| node_graph
node_graph -.->|"provides adjacency"| node_training
node_training -->|"instantiates and trains"| node_gcn
node_gcn -->|"returns predictions"| node_training
node_training -->|"produces scores"| node_predictions
node_cohort -->|"loads inputs"| node_evaluation
node_evaluation -->|"loads trained model"| node_gcn
node_evaluation -->|"calls DeLong test"| node_metrics
node_evaluation -->|"reports metrics"| node_predictions
node_cohort -->|"loads inputs"| node_explanation
node_explanation -->|"loads and queries"| node_gcn
node_explanation -->|"imports metric symbol"| node_metrics
node_explanation -->|"saves explanations"| node_interpretations

click node_dummy "https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/data/make-dummy-data.py"
click node_graph "https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/utils/graph-utils.py"
click node_training "https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/script/train.py"
click node_gcn "https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/models/gcn-models.py"
click node_evaluation "https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/script/evaluate.py"
click node_metrics "https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/utils/metrics.py"
click node_explanation "https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/script/explain.py"

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_dummy,node_cohort,node_graph toneBlue
class node_training,node_gcn toneAmber
class node_evaluation,node_metrics,node_explanation,node_predictions,node_interpretations toneMint
class node_researcher toneIndigo
```

## Components

### Cohort data

- [Synthetic cohort generator](https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/data/make-dummy-data.py): `data/make-dummy-data.py`
- **GEO and cohort inputs**
- [Feature graph builder](https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/utils/graph-utils.py): `utils/graph-utils.py`

### Graph learning

- [Fold preprocessing and training](https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/script/train.py): `script/train.py`
- [GCN predictor](https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/models/gcn-models.py): `models/gcn-models.py`

### Model analysis

- [Predictive evaluation](https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/script/evaluate.py): `script/evaluate.py`
- [Metric utilities](https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/utils/metrics.py): `utils/metrics.py`
- [SHAP and ablation analysis](https://github.com/sarhnagniafariba-maker/tnbc-immunotherapy-prediction/blob/main/script/explain.py): `script/explain.py`
- **Response predictions**
- **Biomarker interpretations**

### Other components

- **Researcher**

## Connections

- Researcher → Synthetic cohort generator: generates test data (evidence: `data/make-dummy-data.py`)
- Synthetic cohort generator → GEO and cohort inputs: writes synthetic inputs (evidence: `data/make-dummy-data.py`)
- GEO and cohort inputs → Fold preprocessing and training: loads inputs (evidence: `script/train.py`)
- Researcher → Feature graph builder: builds feature graph (evidence: `utils/graph-utils.py`)
- Feature graph builder → Fold preprocessing and training: provides adjacency
- Fold preprocessing and training → GCN predictor: instantiates and trains (evidence: `script/train.py`)
- GCN predictor → Fold preprocessing and training: returns predictions (evidence: `models/gcn-models.py`)
- Fold preprocessing and training → Response predictions: produces scores (evidence: `script/train.py`)
- GEO and cohort inputs → Predictive evaluation: loads inputs (evidence: `script/evaluate.py`)
- Predictive evaluation → GCN predictor: loads trained model (evidence: `script/evaluate.py`)
- Predictive evaluation → Metric utilities: calls DeLong test (evidence: `script/evaluate.py`)
- Predictive evaluation → Response predictions: reports metrics (evidence: `script/evaluate.py`)
- GEO and cohort inputs → SHAP and ablation analysis: loads inputs (evidence: `script/explain.py`)
- SHAP and ablation analysis → GCN predictor: loads and queries (evidence: `script/explain.py`)
- SHAP and ablation analysis → Metric utilities: imports metric symbol (evidence: `script/explain.py`)
- SHAP and ablation analysis → Biomarker interpretations: saves explanations (evidence: `script/explain.py`)
