# vahuynh/genie3 architecture

> Architecture diagram of the GitHub repository vahuynh/genie3, 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/vahuynh/genie3
- Repository: https://github.com/vahuynh/genie3

## Overview

GENIE3 infers gene-regulatory links from gene-expression measurements by fitting a regression model for each target gene, deriving regulator-importance scores, and ranking candidate links. The repository provides Python, MATLAB, R/randomForest, and R/C implementations; the README identifies their tree-learning backends. MATLAB’s C tree learner and its major core modules are shown as an internal layer. Several implementation details are unsampled, so only documented or indexed relationships are connected.

Main entry points: [`GENIE3_MATLAB/RT/rtree-c/rtenslearn_c.c`](https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/RT/rtree-c/rtenslearn_c.c) (Ensemble learning), [`GENIE3_python/GENIE3.py`](https://github.com/vahuynh/genie3/blob/master/GENIE3_python/GENIE3.py) (Target regression), [`GENIE3_MATLAB/GENIE3_single.m`](https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/GENIE3_single.m) (Single-target fit), [`GENIE3_MATLAB/GENIE3.m`](https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/GENIE3.m) (GENIE3 entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Inference workflow"]
  node_expression["Expression data"]
  node_ranked_links["Ranked links"]
end

subgraph group_python["Python implementation"]
  node_py_api["GENIE3 API<br/>[GENIE3.py]"]
  node_py_target["Target regression<br/>[GENIE3.py]"]
  node_py_importance["Feature importance<br/>[GENIE3.py]"]
  node_py_links["Link ranking<br/>[GENIE3.py]"]
end

subgraph group_matlab["MATLAB implementation"]
  node_mat_api["GENIE3 entry<br/>[GENIE3.m]"]
  node_mat_target["Single-target fit<br/>[GENIE3_single.m]"]
  node_mat_importance["Importance scores"]
  node_mat_links["Link list<br/>[get_link_list.m]"]
  node_mat_mex["MATLAB tree interface<br/>[rtenslearn_c.c]"]
end

subgraph group_r["R implementations"]
  node_r_rf["R randomForest<br/>[GENIE3.R]"]
  node_r_c["R/C wrapper<br/>[GENIE3.R]"]
  node_r_c_core["R/C learner<br/>[GENIE3.c]"]
end

subgraph group_treecore["C tree core"]
  node_core_learn["Ensemble learning<br/>[rtenslearn_c.c]"]
  node_core_model["Tree model<br/>[tree-model.c]"]
  node_core_header["Tree interfaces<br/>[tree-model.h]"]
  node_core_table["Split scoring<br/>[f-table.c]"]
  node_core_multi["Multiregression<br/>[tree-multiregr.c]"]
end

node_user(("Analyst"))
node_sklearn["scikit-learn trees"]

node_user -->|"provides"| node_expression
node_expression -->|"supplies data"| node_py_api
node_py_api -->|"fits targets"| node_py_target
node_py_target -->|"fits trees"| node_sklearn
node_py_target -->|"computes scores"| node_py_importance
node_py_importance -->|"ranks scores"| node_py_links
node_py_links -->|"outputs"| node_ranked_links
node_expression -.->|"supplies data"| node_mat_api
node_mat_api -.->|"fits targets"| node_mat_target
node_mat_target -.->|"learns trees"| node_mat_mex
node_mat_target -.->|"computes scores"| node_mat_importance
node_mat_importance -.->|"provides scores"| node_mat_links
node_mat_links -.->|"outputs"| node_ranked_links
node_expression -.->|"supplies data"| node_r_rf
node_r_rf -.->|"infers links"| node_ranked_links
node_expression -.->|"supplies data"| node_r_c
node_r_c -.->|"invokes learner"| node_r_c_core
node_r_c_core -.->|"infers links"| node_ranked_links
node_mat_mex -->|"uses learner"| node_core_learn
node_core_learn -->|"includes"| node_core_header
node_core_learn -->|"references"| node_core_model
node_core_learn -->|"references"| node_core_table
node_core_learn -->|"references"| node_core_multi

click node_py_api "https://github.com/vahuynh/genie3/blob/master/GENIE3_python/GENIE3.py"
click node_py_target "https://github.com/vahuynh/genie3/blob/master/GENIE3_python/GENIE3.py"
click node_py_importance "https://github.com/vahuynh/genie3/blob/master/GENIE3_python/GENIE3.py"
click node_py_links "https://github.com/vahuynh/genie3/blob/master/GENIE3_python/GENIE3.py"
click node_mat_api "https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/GENIE3.m"
click node_mat_target "https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/GENIE3_single.m"
click node_mat_importance "https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/RT/compute_rtens_variable_importance.m"
click node_mat_links "https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/get_link_list.m"
click node_mat_mex "https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/RT/rtree-c/rtenslearn_c.c"
click node_r_rf "https://github.com/vahuynh/genie3/blob/master/GENIE3_R/GENIE3.R"
click node_r_c "https://github.com/vahuynh/genie3/blob/master/GENIE3_R_C_wrapper/GENIE3.R"
click node_r_c_core "https://github.com/vahuynh/genie3/blob/master/GENIE3_R_C_wrapper/GENIE3.c"
click node_core_learn "https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/RT/rtree-c/rtenslearn_c.c"
click node_core_model "https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/RT/rtree-c/tree-model.c"
click node_core_header "https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/RT/rtree-c/tree-model.h"
click node_core_table "https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/RT/rtree-c/f-table.c"
click node_core_multi "https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/RT/rtree-c/tree-multiregr.c"

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_expression,node_ranked_links toneBlue
class node_py_api,node_py_target,node_py_importance,node_py_links toneAmber
class node_mat_api,node_mat_target,node_mat_importance,node_mat_links,node_mat_mex toneMint
class node_r_rf,node_r_c,node_r_c_core toneRose
class node_core_learn,node_core_model,node_core_header,node_core_table,node_core_multi,node_user,node_sklearn toneIndigo
```

## Components

### Inference workflow

- **Expression data**
- **Ranked links**

### Python implementation

- [GENIE3 API](https://github.com/vahuynh/genie3/blob/master/GENIE3_python/GENIE3.py): `GENIE3_python/GENIE3.py`
- [Target regression](https://github.com/vahuynh/genie3/blob/master/GENIE3_python/GENIE3.py): `GENIE3_python/GENIE3.py`
- [Feature importance](https://github.com/vahuynh/genie3/blob/master/GENIE3_python/GENIE3.py): `GENIE3_python/GENIE3.py`
- [Link ranking](https://github.com/vahuynh/genie3/blob/master/GENIE3_python/GENIE3.py): `GENIE3_python/GENIE3.py`

### MATLAB implementation

- [GENIE3 entry](https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/GENIE3.m): `GENIE3_MATLAB/GENIE3.m`
- [Single-target fit](https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/GENIE3_single.m): `GENIE3_MATLAB/GENIE3_single.m`
- [Importance scores](https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/RT/compute_rtens_variable_importance.m): `GENIE3_MATLAB/RT/compute_rtens_variable_importance.m`
- [Link list](https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/get_link_list.m): `GENIE3_MATLAB/get_link_list.m`
- [MATLAB tree interface](https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/RT/rtree-c/rtenslearn_c.c): `GENIE3_MATLAB/RT/rtree-c/rtenslearn_c.c`

### R implementations

- [R randomForest](https://github.com/vahuynh/genie3/blob/master/GENIE3_R/GENIE3.R): `GENIE3_R/GENIE3.R`
- [R/C wrapper](https://github.com/vahuynh/genie3/blob/master/GENIE3_R_C_wrapper/GENIE3.R): `GENIE3_R_C_wrapper/GENIE3.R`
- [R/C learner](https://github.com/vahuynh/genie3/blob/master/GENIE3_R_C_wrapper/GENIE3.c): `GENIE3_R_C_wrapper/GENIE3.c`

### C tree core

- [Ensemble learning](https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/RT/rtree-c/rtenslearn_c.c): `GENIE3_MATLAB/RT/rtree-c/rtenslearn_c.c`
- [Tree model](https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/RT/rtree-c/tree-model.c): `GENIE3_MATLAB/RT/rtree-c/tree-model.c`
- [Tree interfaces](https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/RT/rtree-c/tree-model.h): `GENIE3_MATLAB/RT/rtree-c/tree-model.h`
- [Split scoring](https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/RT/rtree-c/f-table.c): `GENIE3_MATLAB/RT/rtree-c/f-table.c`
- [Multiregression](https://github.com/vahuynh/genie3/blob/master/GENIE3_MATLAB/RT/rtree-c/tree-multiregr.c): `GENIE3_MATLAB/RT/rtree-c/tree-multiregr.c`

### Other components

- **Analyst**
- **scikit-learn trees**

## Connections

- Analyst → Expression data: provides (evidence: `README.md`)
- Expression data → GENIE3 API: supplies data (evidence: `GENIE3_python/GENIE3.py`)
- GENIE3 API → Target regression: fits targets (evidence: `GENIE3_python/GENIE3.py`)
- Target regression → scikit-learn trees: fits trees (evidence: `GENIE3_python/GENIE3.py`)
- Target regression → Feature importance: computes scores (evidence: `GENIE3_python/GENIE3.py`)
- Feature importance → Link ranking: ranks scores (evidence: `GENIE3_python/GENIE3.py`)
- Link ranking → Ranked links: outputs (evidence: `GENIE3_python/GENIE3.py`)
- Expression data → GENIE3 entry: supplies data (evidence: `README.md`)
- GENIE3 entry → Single-target fit: fits targets (evidence: `README.md`)
- Single-target fit → MATLAB tree interface: learns trees (evidence: `README.md`)
- Single-target fit → Importance scores: computes scores (evidence: `README.md`)
- Importance scores → Link list: provides scores (evidence: `README.md`)
- Link list → Ranked links: outputs (evidence: `README.md`)
- Expression data → R randomForest: supplies data (evidence: `README.md`)
- R randomForest → Ranked links: infers links (evidence: `README.md`)
- Expression data → R/C wrapper: supplies data (evidence: `README.md`)
- R/C wrapper → R/C learner: invokes learner (evidence: `README.md`)
- R/C learner → Ranked links: infers links (evidence: `README.md`)
- MATLAB tree interface → Ensemble learning: uses learner (evidence: `GENIE3_MATLAB/RT/rtree-c/rtenslearn_c.c`)
- Ensemble learning → Tree interfaces: includes (evidence: `GENIE3_MATLAB/RT/rtree-c/rtenslearn_c.c`)
- Ensemble learning → Tree model: references (evidence: `GENIE3_MATLAB/RT/rtree-c/rtenslearn_c.c`)
- Ensemble learning → Split scoring: references (evidence: `GENIE3_MATLAB/RT/rtree-c/rtenslearn_c.c`)
- Ensemble learning → Multiregression: references (evidence: `GENIE3_MATLAB/RT/rtree-c/rtenslearn_c.c`)
