# kirankumar88/brca-multiomics-ai architecture

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

- Interactive diagram: https://gitdiagram.com/kirankumar88/brca-multiomics-ai
- Repository: https://github.com/kirankumar88/brca-multiomics-ai

## Overview

This repository is a breast-cancer multi-omics classification product with a Streamlit analysis interface and a separate FastAPI inference endpoint. The main workflow accepts a CSV in the app, fills missing model features, predicts ductal versus lobular subtype, and offers biomarker, omics-layer, heatmap, and pathway analyses. The README documents a frontend-to-backend architecture, but the sampled code does not show the frontend calling the API; the app performs inference directly. The API's model paths also differ from the app's paths, so those dependencies are shown separately.

Main entry points: [`app/app.py`](https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py) (App Model), [`api/api.py`](https://github.com/kirankumar88/brca-multiomics-ai/blob/main/api/api.py) (FastAPI Endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Analysis Interface"]
  node_streamlit["Streamlit App<br/>[app.py]"]
  node_upload["CSV Upload<br/>[app.py]"]
  node_dashboard["Model Dashboard<br/>[app.py]"]
  node_results["Prediction Results<br/>[app.py]"]
end

subgraph group_inference["Inference"]
  node_api["FastAPI Endpoint<br/>[api.py]"]
  node_api_model["API Model<br/>[api.py]"]
  node_app_model["App Model<br/>[app.py]"]
  node_features["Model Features<br/>[app.py]"]
  node_prediction["Subtype Prediction<br/>[app.py]"]
end

subgraph group_interpretation["Biological Interpretation"]
  node_shap["SHAP Biomarkers<br/>[app.py]"]
  node_omics["Omics Contribution<br/>[app.py]"]
  node_top_biomarkers["Top Biomarkers<br/>[app.py]"]
  node_heatmap["Feature Heatmap<br/>[app.py]"]
  node_pathways["KEGG Enrichment<br/>[app.py]"]
end

node_researcher(("Researcher"))
node_enrichr["Enrichr Service"]

node_researcher -->|"uses"| node_streamlit
node_streamlit -->|"offers"| node_upload
node_researcher -->|"uploads CSV"| node_upload
node_streamlit -->|"shows metrics"| node_dashboard
node_streamlit -.->|"may call"| node_api
node_api -->|"loads model"| node_api_model
node_api -->|"loads features"| node_features
node_api -->|"predicts"| node_api_model
node_upload -->|"stores data"| node_prediction
node_prediction -->|"aligns columns"| node_features
node_prediction -->|"predicts"| node_app_model
node_app_model -->|"returns probabilities"| node_results
node_prediction -->|"displays"| node_results
node_app_model -->|"explains"| node_shap
node_app_model -->|"provides importance"| node_omics
node_app_model -->|"ranks features"| node_top_biomarkers
node_app_model -->|"selects features"| node_heatmap
node_app_model -->|"ranks genes"| node_pathways
node_pathways -->|"requests enrichment"| node_enrichr

click node_streamlit "https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py"
click node_upload "https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py"
click node_dashboard "https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py"
click node_api "https://github.com/kirankumar88/brca-multiomics-ai/blob/main/api/api.py"
click node_api_model "https://github.com/kirankumar88/brca-multiomics-ai/blob/main/api/api.py"
click node_app_model "https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py"
click node_features "https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py"
click node_prediction "https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py"
click node_results "https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py"
click node_shap "https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py"
click node_omics "https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py"
click node_top_biomarkers "https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py"
click node_heatmap "https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py"
click node_pathways "https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.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_streamlit,node_upload,node_dashboard,node_results toneBlue
class node_api,node_api_model,node_app_model,node_features,node_prediction toneAmber
class node_shap,node_omics,node_top_biomarkers,node_heatmap,node_pathways toneMint
class node_researcher,node_enrichr toneIndigo
```

## Components

### Analysis Interface

- [Streamlit App](https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py): `app/app.py`
- [CSV Upload](https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py): `app/app.py`
- [Model Dashboard](https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py): `app/app.py`
- [Prediction Results](https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py): `app/app.py`

### Inference

- [FastAPI Endpoint](https://github.com/kirankumar88/brca-multiomics-ai/blob/main/api/api.py): `api/api.py`
- [API Model](https://github.com/kirankumar88/brca-multiomics-ai/blob/main/api/api.py): `api/api.py`
- [App Model](https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py): `app/app.py`
- [Model Features](https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py): `app/app.py`
- [Subtype Prediction](https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py): `app/app.py`

### Biological Interpretation

- [SHAP Biomarkers](https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py): `app/app.py`
- [Omics Contribution](https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py): `app/app.py`
- [Top Biomarkers](https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py): `app/app.py`
- [Feature Heatmap](https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py): `app/app.py`
- [KEGG Enrichment](https://github.com/kirankumar88/brca-multiomics-ai/blob/main/app/app.py): `app/app.py`

### Other components

- **Researcher**
- **Enrichr Service**

## Connections

- Researcher → Streamlit App: uses (evidence: `README.md`)
- Streamlit App → CSV Upload: offers (evidence: `app/app.py`)
- Researcher → CSV Upload: uploads CSV (evidence: `app/app.py`)
- Streamlit App → Model Dashboard: shows metrics (evidence: `app/app.py`)
- Streamlit App → FastAPI Endpoint: may call
- FastAPI Endpoint → API Model: loads model (evidence: `api/api.py`)
- FastAPI Endpoint → Model Features: loads features (evidence: `api/api.py`)
- FastAPI Endpoint → API Model: predicts (evidence: `api/api.py`)
- CSV Upload → Subtype Prediction: stores data (evidence: `app/app.py`)
- Subtype Prediction → Model Features: aligns columns (evidence: `app/app.py`)
- Subtype Prediction → App Model: predicts (evidence: `app/app.py`)
- App Model → Prediction Results: returns probabilities (evidence: `app/app.py`)
- Subtype Prediction → Prediction Results: displays (evidence: `app/app.py`)
- App Model → SHAP Biomarkers: explains (evidence: `app/app.py`)
- App Model → Omics Contribution: provides importance (evidence: `app/app.py`)
- App Model → Top Biomarkers: ranks features (evidence: `app/app.py`)
- App Model → Feature Heatmap: selects features (evidence: `app/app.py`)
- App Model → KEGG Enrichment: ranks genes (evidence: `app/app.py`)
- KEGG Enrichment → Enrichr Service: requests enrichment (evidence: `app/app.py`)
