# sujithreddy-47/oncograph architecture

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

- Interactive diagram: https://gitdiagram.com/sujithreddy-47/oncograph
- Repository: https://github.com/sujithreddy-47/oncograph

## Overview

OncoGraph is a TCGA pan-cancer analysis framework: it preprocesses gene-expression and clinical data, builds a patient-similarity graph, trains and evaluates a graph neural network, then supports subtype, biomarker, survival, and anomaly analyses. The README documents these capabilities and the overall methodology; sampled entry points and the source index clarify several dispatch relationships. Some downstream implementations and data-loading details were not sampled, so the graph omits uncertain internal links.

Main entry points: [`backend/utils/data_processor.py`](https://github.com/sujithreddy-47/oncograph/blob/main/backend/utils/data_processor.py) (Preprocessing), [`backend/train_model.py`](https://github.com/sujithreddy-47/oncograph/blob/main/backend/train_model.py) (Train Command), [`backend/evaluate_model.py`](https://github.com/sujithreddy-47/oncograph/blob/main/backend/evaluate_model.py) (Evaluate Command), [`backend/utils/graph_builder.py`](https://github.com/sujithreddy-47/oncograph/blob/main/backend/utils/graph_builder.py) (Similarity Graph)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data and Graph"]
  node_gene_data["TCGA Inputs"]
  node_clinical_data["Clinical Inputs"]
  node_processor["Preprocessing<br/>[data_processor.py]"]
  node_graph_builder["Similarity Graph<br/>[graph_builder.py]"]
  node_processed[("Processed Data<br/>[processed_data.pt]")]
  node_graph_store[("Patient Graph<br/>[graph_data.pt]")]
end

subgraph group_model["Model Lifecycle"]
  node_factory["Model Factory<br/>[model_factory.py]"]
  node_gcn["GCN Architectures<br/>[gcn_models.py]"]
  node_trainer["Training Loop<br/>[trainer.py]"]
  node_train_entry["Train Command<br/>[train_model.py]"]
  node_evaluator["Model Evaluation<br/>[evaluator.py]"]
  node_eval_entry["Evaluate Command<br/>[evaluate_model.py]"]
end

subgraph group_analysis["Clinical Analysis"]
  node_subtypes["Subtype Discovery<br/>[subtypes.py]"]
  node_biomarkers["Biomarker Discovery<br/>[biomarkers.py]"]
  node_survival["Survival Analysis<br/>[survival.py]"]
  node_anomaly["Anomaly Detection"]
  node_subtype_entry["Subtype Command<br/>[run_subtypes.py]"]
  node_biomarker_entry["Biomarker Command<br/>[run_biomarkers.py]"]
  node_survival_entry["Survival Command<br/>[run_survival.py]"]
  node_anomaly_entry["Anomaly Command<br/>[run_anomaly.py]"]
end

subgraph group_config["Configuration"]
  node_config["Runtime Config<br/>[config.py]"]
end

node_analyst(("Researcher"))

node_analyst -->|"starts training"| node_train_entry
node_gene_data -->|"expression input"| node_processor
node_clinical_data -->|"clinical input"| node_processor
node_processor -->|"saves processed"| node_processed
node_processed -->|"builds from"| node_graph_builder
node_graph_builder -->|"saves graph"| node_graph_store
node_train_entry -->|"loads config"| node_config
node_train_entry -->|"loads graph"| node_graph_builder
node_train_entry -->|"creates model"| node_factory
node_train_entry -->|"starts training"| node_trainer
node_factory -->|"instantiates"| node_gcn
node_analyst -->|"starts evaluation"| node_eval_entry
node_eval_entry -->|"runs evaluation"| node_evaluator
node_eval_entry -->|"creates model"| node_factory
node_analyst -->|"runs analysis"| node_subtype_entry
node_subtype_entry -->|"dispatches to"| node_subtypes
node_analyst -->|"runs analysis"| node_biomarker_entry
node_biomarker_entry -->|"dispatches to"| node_biomarkers
node_analyst -->|"runs analysis"| node_survival_entry
node_survival_entry -->|"dispatches to"| node_survival
node_analyst -->|"runs analysis"| node_anomaly_entry
node_anomaly_entry -->|"dispatches to"| node_anomaly
node_subtypes -->|"uses data"| node_processor
node_biomarkers -->|"uses data"| node_processor
node_survival -->|"uses data"| node_processor
node_anomaly -->|"uses data"| node_processor

click node_gene_data "https://github.com/sujithreddy-47/oncograph/blob/main/EB%2B%2BAdjustPANCAN_IlluminaHiSeq_RNASeqV2.geneExp.xena"
click node_clinical_data "https://github.com/sujithreddy-47/oncograph/blob/main/Survival_SupplementalTable_S1_20171025_xena_sp"
click node_processor "https://github.com/sujithreddy-47/oncograph/blob/main/backend/utils/data_processor.py"
click node_graph_builder "https://github.com/sujithreddy-47/oncograph/blob/main/backend/utils/graph_builder.py"
click node_processed "https://github.com/sujithreddy-47/oncograph/blob/main/backend/data/processed_data.pt"
click node_graph_store "https://github.com/sujithreddy-47/oncograph/blob/main/backend/data/graph_data.pt"
click node_config "https://github.com/sujithreddy-47/oncograph/blob/main/backend/configs/config.py"
click node_factory "https://github.com/sujithreddy-47/oncograph/blob/main/backend/models/model_factory.py"
click node_gcn "https://github.com/sujithreddy-47/oncograph/blob/main/backend/models/gcn_models.py"
click node_trainer "https://github.com/sujithreddy-47/oncograph/blob/main/backend/training/trainer.py"
click node_train_entry "https://github.com/sujithreddy-47/oncograph/blob/main/backend/train_model.py"
click node_evaluator "https://github.com/sujithreddy-47/oncograph/blob/main/backend/evaluation/evaluator.py"
click node_eval_entry "https://github.com/sujithreddy-47/oncograph/blob/main/backend/evaluate_model.py"
click node_subtypes "https://github.com/sujithreddy-47/oncograph/blob/main/backend/analysis/subtypes.py"
click node_biomarkers "https://github.com/sujithreddy-47/oncograph/blob/main/backend/analysis/biomarkers.py"
click node_survival "https://github.com/sujithreddy-47/oncograph/blob/main/backend/analysis/survival.py"
click node_anomaly "https://github.com/sujithreddy-47/oncograph/blob/main/backend/analysis/anomaly_detection.py"
click node_subtype_entry "https://github.com/sujithreddy-47/oncograph/blob/main/backend/run_subtypes.py"
click node_biomarker_entry "https://github.com/sujithreddy-47/oncograph/blob/main/backend/run_biomarkers.py"
click node_survival_entry "https://github.com/sujithreddy-47/oncograph/blob/main/backend/run_survival.py"
click node_anomaly_entry "https://github.com/sujithreddy-47/oncograph/blob/main/backend/run_anomaly.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_gene_data,node_clinical_data,node_processor,node_graph_builder,node_processed,node_graph_store toneBlue
class node_factory,node_gcn,node_trainer,node_train_entry,node_evaluator,node_eval_entry toneAmber
class node_subtypes,node_biomarkers,node_survival,node_anomaly,node_subtype_entry,node_biomarker_entry,node_survival_entry,node_anomaly_entry toneMint
class node_config toneRose
class node_analyst toneIndigo
```

## Components

### Data and Graph

- [TCGA Inputs](https://github.com/sujithreddy-47/oncograph/blob/main/EB%2B%2BAdjustPANCAN_IlluminaHiSeq_RNASeqV2.geneExp.xena): `EB++AdjustPANCAN_IlluminaHiSeq_RNASeqV2.geneExp.xena`
- [Clinical Inputs](https://github.com/sujithreddy-47/oncograph/blob/main/Survival_SupplementalTable_S1_20171025_xena_sp): `Survival_SupplementalTable_S1_20171025_xena_sp`
- [Preprocessing](https://github.com/sujithreddy-47/oncograph/blob/main/backend/utils/data_processor.py): `backend/utils/data_processor.py`
- [Similarity Graph](https://github.com/sujithreddy-47/oncograph/blob/main/backend/utils/graph_builder.py): `backend/utils/graph_builder.py`
- [Processed Data](https://github.com/sujithreddy-47/oncograph/blob/main/backend/data/processed_data.pt): `backend/data/processed_data.pt`
- [Patient Graph](https://github.com/sujithreddy-47/oncograph/blob/main/backend/data/graph_data.pt): `backend/data/graph_data.pt`

### Model Lifecycle

- [Model Factory](https://github.com/sujithreddy-47/oncograph/blob/main/backend/models/model_factory.py): `backend/models/model_factory.py`
- [GCN Architectures](https://github.com/sujithreddy-47/oncograph/blob/main/backend/models/gcn_models.py): `backend/models/gcn_models.py`
- [Training Loop](https://github.com/sujithreddy-47/oncograph/blob/main/backend/training/trainer.py): `backend/training/trainer.py`
- [Train Command](https://github.com/sujithreddy-47/oncograph/blob/main/backend/train_model.py): `backend/train_model.py`
- [Model Evaluation](https://github.com/sujithreddy-47/oncograph/blob/main/backend/evaluation/evaluator.py): `backend/evaluation/evaluator.py`
- [Evaluate Command](https://github.com/sujithreddy-47/oncograph/blob/main/backend/evaluate_model.py): `backend/evaluate_model.py`

### Clinical Analysis

- [Subtype Discovery](https://github.com/sujithreddy-47/oncograph/blob/main/backend/analysis/subtypes.py): `backend/analysis/subtypes.py`
- [Biomarker Discovery](https://github.com/sujithreddy-47/oncograph/blob/main/backend/analysis/biomarkers.py): `backend/analysis/biomarkers.py`
- [Survival Analysis](https://github.com/sujithreddy-47/oncograph/blob/main/backend/analysis/survival.py): `backend/analysis/survival.py`
- [Anomaly Detection](https://github.com/sujithreddy-47/oncograph/blob/main/backend/analysis/anomaly_detection.py): `backend/analysis/anomaly_detection.py`
- [Subtype Command](https://github.com/sujithreddy-47/oncograph/blob/main/backend/run_subtypes.py): `backend/run_subtypes.py`
- [Biomarker Command](https://github.com/sujithreddy-47/oncograph/blob/main/backend/run_biomarkers.py): `backend/run_biomarkers.py`
- [Survival Command](https://github.com/sujithreddy-47/oncograph/blob/main/backend/run_survival.py): `backend/run_survival.py`
- [Anomaly Command](https://github.com/sujithreddy-47/oncograph/blob/main/backend/run_anomaly.py): `backend/run_anomaly.py`

### Configuration

- [Runtime Config](https://github.com/sujithreddy-47/oncograph/blob/main/backend/configs/config.py): `backend/configs/config.py`

### Other components

- **Researcher**

## Connections

- Researcher → Train Command: starts training (evidence: `README.md`)
- TCGA Inputs → Preprocessing: expression input (evidence: `README.md`)
- Clinical Inputs → Preprocessing: clinical input (evidence: `README.md`)
- Preprocessing → Processed Data: saves processed (evidence: `backend/utils/data_processor.py`)
- Processed Data → Similarity Graph: builds from (evidence: `backend/utils/graph_builder.py`)
- Similarity Graph → Patient Graph: saves graph (evidence: `README.md`)
- Train Command → Runtime Config: loads config (evidence: `backend/train_model.py`)
- Train Command → Similarity Graph: loads graph (evidence: `backend/train_model.py`)
- Train Command → Model Factory: creates model (evidence: `backend/train_model.py`)
- Train Command → Training Loop: starts training (evidence: `backend/train_model.py`)
- Model Factory → GCN Architectures: instantiates (evidence: `backend/models/model_factory.py`)
- Researcher → Evaluate Command: starts evaluation (evidence: `README.md`)
- Evaluate Command → Model Evaluation: runs evaluation (evidence: `backend/evaluate_model.py`)
- Evaluate Command → Model Factory: creates model (evidence: `backend/evaluate_model.py`)
- Researcher → Subtype Command: runs analysis (evidence: `README.md`)
- Subtype Command → Subtype Discovery: dispatches to (evidence: `backend/run_subtypes.py`)
- Researcher → Biomarker Command: runs analysis (evidence: `README.md`)
- Biomarker Command → Biomarker Discovery: dispatches to (evidence: `backend/run_biomarkers.py`)
- Researcher → Survival Command: runs analysis (evidence: `README.md`)
- Survival Command → Survival Analysis: dispatches to (evidence: `backend/run_survival.py`)
- Researcher → Anomaly Command: runs analysis (evidence: `README.md`)
- Anomaly Command → Anomaly Detection: dispatches to (evidence: `backend/run_anomaly.py`)
- Subtype Discovery → Preprocessing: uses data (evidence: `backend/analysis/subtypes.py`)
- Biomarker Discovery → Preprocessing: uses data (evidence: `backend/analysis/biomarkers.py`)
- Survival Analysis → Preprocessing: uses data (evidence: `backend/analysis/survival.py`)
- Anomaly Detection → Preprocessing: uses data (evidence: `backend/analysis/anomaly_detection.py`)
