# wqz2469/gigcn architecture

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

- Interactive diagram: https://gitdiagram.com/wqz2469/gigcn
- Repository: https://github.com/wqz2469/gigcn

## Overview

GiGCN is a signed-graph link-sign prediction project. Its implemented workflow loads and splits labeled edges, derives gene features, learns factor-disentangled node embeddings, predicts edge classes, and evaluates predictions. The README also describes cold-start evaluation and factor/enrichment analyses, but their implementation is not present in the supplied tree; those documented capabilities are shown as unverified. The source excerpts establish the main DINES training path; evaluation details beyond the entry point and decoder are less fully evidenced.

Main entry points: [`GiGCN/src/run_evaluate.py`](https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/run_evaluate.py) (Evaluation entry point), [`GiGCN/src/train.py`](https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/train.py) (Training entry point), [`GiGCN/src/data.py`](https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/data.py) (Load and split edges), [`GiGCN/src/models/dines.py`](https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/models/dines.py) (DINES encoder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_edges_gene["GENE interactions<br/>[edges.csv]"]
  node_edges_epinions["EPINIONS edges<br/>[edges.csv]"]
  node_prepare["Load and split edges<br/>[data.py]"]
  node_features["PCA features<br/>[data.py]"]
  node_feature_matrix["GO similarity matrix"]
end

subgraph group_model["DINES model"]
  node_encoder["DINES encoder<br/>[dines.py]"]
  node_conv["Signed graph convolution<br/>[dsgconv.py]"]
  node_decoder["Factor correlation decoder<br/>[decoder.py]"]
end

subgraph group_runtime["Training and evaluation"]
  node_entry_train["Training entry point<br/>[train.py]"]
  node_entry_eval["Evaluation entry point<br/>[run_evaluate.py]"]
  node_trainer["Trainer<br/>[train.py]"]
  node_metrics["Evaluation metrics<br/>[run_evaluate.py]"]
  node_checkpoints["Model checkpoints<br/>[train.py]"]
end

subgraph group_analysis["Analysis"]
  node_coldstart["Cold-start evaluation"]
  node_factor_analysis["Factor and enrichment analysis"]
  node_enrichr["Enrichr service"]
end

node_user(("Researcher"))

node_user -->|"starts training"| node_entry_train
node_user -->|"starts evaluation"| node_entry_eval
node_edges_gene -->|"loads edges"| node_prepare
node_edges_epinions -->|"loads edges"| node_prepare
node_prepare -->|"extracts features"| node_features
node_feature_matrix -.->|"provides similarities"| node_features
node_entry_train -->|"loads data"| node_prepare
node_entry_train -->|"constructs"| node_encoder
node_entry_train -->|"constructs"| node_decoder
node_entry_train -->|"runs training"| node_trainer
node_trainer -->|"computes embeddings"| node_encoder
node_trainer -->|"computes loss"| node_decoder
node_trainer -->|"saves weights"| node_checkpoints
node_encoder -->|"applies layers"| node_conv
node_entry_eval -->|"loads data"| node_prepare
node_entry_eval -->|"constructs and loads"| node_encoder
node_entry_eval -->|"constructs and loads"| node_decoder
node_entry_eval -->|"evaluates predictions"| node_metrics
node_entry_eval -->|"computes embeddings"| node_encoder
node_entry_eval -->|"predicts edge classes"| node_decoder
node_user -.->|"runs cold-start folds"| node_coldstart
node_user -.->|"analyzes factors"| node_factor_analysis
node_factor_analysis -.->|"queries enrichment"| node_enrichr

click node_edges_gene "https://github.com/wqz2469/gigcn/blob/main/GiGCN/data/GENE/edges.csv"
click node_edges_epinions "https://github.com/wqz2469/gigcn/blob/main/GiGCN/data/EPINIONS/edges.csv"
click node_prepare "https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/data.py"
click node_features "https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/data.py"
click node_entry_train "https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/train.py"
click node_entry_eval "https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/run_evaluate.py"
click node_encoder "https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/models/dines.py"
click node_conv "https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/models/dsgconv.py"
click node_decoder "https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/models/decoder.py"
click node_trainer "https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/models/train.py"
click node_metrics "https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/run_evaluate.py"
click node_checkpoints "https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/models/train.py"
click node_coldstart "https://github.com/wqz2469/gigcn/tree/main/GiGCN/src"
click node_factor_analysis "https://github.com/wqz2469/gigcn/tree/main/GiGCN/src"

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_edges_gene,node_edges_epinions,node_prepare,node_features,node_feature_matrix toneBlue
class node_encoder,node_conv,node_decoder toneAmber
class node_entry_train,node_entry_eval,node_trainer,node_metrics,node_checkpoints toneMint
class node_coldstart,node_factor_analysis,node_enrichr toneRose
class node_user toneIndigo
```

## Components

### Data preparation

- [GENE interactions](https://github.com/wqz2469/gigcn/blob/main/GiGCN/data/GENE/edges.csv): `GiGCN/data/GENE/edges.csv`
- [EPINIONS edges](https://github.com/wqz2469/gigcn/blob/main/GiGCN/data/EPINIONS/edges.csv): `GiGCN/data/EPINIONS/edges.csv`
- [Load and split edges](https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/data.py): `GiGCN/src/data.py`
- [PCA features](https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/data.py): `GiGCN/src/data.py`
- **GO similarity matrix**

### DINES model

- [DINES encoder](https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/models/dines.py): `GiGCN/src/models/dines.py`
- [Signed graph convolution](https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/models/dsgconv.py): `GiGCN/src/models/dsgconv.py`
- [Factor correlation decoder](https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/models/decoder.py): `GiGCN/src/models/decoder.py`

### Training and evaluation

- [Training entry point](https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/train.py): `GiGCN/src/train.py`
- [Evaluation entry point](https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/run_evaluate.py): `GiGCN/src/run_evaluate.py`
- [Trainer](https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/models/train.py): `GiGCN/src/models/train.py`
- [Evaluation metrics](https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/run_evaluate.py): `GiGCN/src/run_evaluate.py`
- [Model checkpoints](https://github.com/wqz2469/gigcn/blob/main/GiGCN/src/models/train.py): `GiGCN/src/models/train.py`

### Analysis

- [Cold-start evaluation](https://github.com/wqz2469/gigcn/tree/main/GiGCN/src): `GiGCN/src`
- [Factor and enrichment analysis](https://github.com/wqz2469/gigcn/tree/main/GiGCN/src): `GiGCN/src`
- **Enrichr service**

### Other components

- **Researcher**

## Connections

- Researcher → Training entry point: starts training (evidence: `GiGCN/src/train.py`)
- Researcher → Evaluation entry point: starts evaluation (evidence: `GiGCN/src/run_evaluate.py`)
- GENE interactions → Load and split edges: loads edges (evidence: `GiGCN/src/data.py`)
- EPINIONS edges → Load and split edges: loads edges (evidence: `GiGCN/src/data.py`)
- Load and split edges → PCA features: extracts features (evidence: `GiGCN/src/data.py`)
- GO similarity matrix → PCA features: provides similarities (evidence: `README.md`)
- Training entry point → Load and split edges: loads data (evidence: `GiGCN/src/train.py`)
- Training entry point → DINES encoder: constructs (evidence: `GiGCN/src/train.py`)
- Training entry point → Factor correlation decoder: constructs (evidence: `GiGCN/src/train.py`)
- Training entry point → Trainer: runs training (evidence: `GiGCN/src/train.py`)
- Trainer → DINES encoder: computes embeddings (evidence: `GiGCN/src/models/train.py`)
- Trainer → Factor correlation decoder: computes loss (evidence: `GiGCN/src/models/train.py`)
- Trainer → Model checkpoints: saves weights (evidence: `GiGCN/src/models/train.py`)
- DINES encoder → Signed graph convolution: applies layers (evidence: `GiGCN/src/models/dines.py`)
- Evaluation entry point → Load and split edges: loads data (evidence: `GiGCN/src/run_evaluate.py`)
- Evaluation entry point → DINES encoder: constructs and loads (evidence: `GiGCN/src/run_evaluate.py`)
- Evaluation entry point → Factor correlation decoder: constructs and loads (evidence: `GiGCN/src/run_evaluate.py`)
- Evaluation entry point → Evaluation metrics: evaluates predictions (evidence: `GiGCN/src/run_evaluate.py`)
- Evaluation entry point → DINES encoder: computes embeddings (evidence: `GiGCN/src/run_evaluate.py`)
- Evaluation entry point → Factor correlation decoder: predicts edge classes (evidence: `GiGCN/src/run_evaluate.py`)
- Researcher → Cold-start evaluation: runs cold-start folds (evidence: `README.md`)
- Researcher → Factor and enrichment analysis: analyzes factors (evidence: `README.md`)
- Factor and enrichment analysis → Enrichr service: queries enrichment (evidence: `README.md`)
