# laurenmbell/pparg architecture

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

- Interactive diagram: https://gitdiagram.com/laurenmbell/pparg
- Repository: https://github.com/laurenmbell/pparg

## Overview

This repository builds two PPARG bioactivity classifiers—agonist and antagonist—and exposes them through a small SMILES-input CLI. The documented workflow runs from bioactivity data through feature engineering, class balancing, model training, and prediction. The sampled source shows the CLI’s descriptor and model calls, plus the data-preparation and training steps; artifacts and dataset files are represented separately. The README also mentions future UI, screening, and docking ideas, not implemented capabilities, so they are omitted.

Main entry points: [`prediction.py`](https://github.com/laurenmbell/pparg/blob/main/prediction.py) (SMILES prediction CLI), [`data_processing/eda.py`](https://github.com/laurenmbell/pparg/blob/main/data_processing/eda.py) (EDA and curation), [`data_processing/data`](https://github.com/laurenmbell/pparg/tree/main/data_processing/data) (Training and test splits), [`ml_prediction/agonist_rf_model.joblib`](https://github.com/laurenmbell/pparg/blob/main/ml_prediction/agonist_rf_model.joblib) (Agonist model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data preparation"]
  node_bioactivity["Bioactivity data<br/>[bioactivity.tsv]"]
  node_eda["EDA and curation<br/>[eda.py]"]
  node_features["Molecular features<br/>[featSelection.py]"]
  node_rawsets[("Curated datasets")]
  node_balancing["Class balancing<br/>[class_imbalance.py]"]
  node_splits[("Training and test splits")]
end

subgraph group_models["Model training"]
  node_agonist_train["Agonist RF training<br/>[agonist_rf.py]"]
  node_antagonist_train["Antagonist RF training<br/>[antagonist_rf.py]"]
  node_agonist_model[("Agonist model")]
  node_antagonist_model[("Antagonist model")]
  node_eval_loader["Model loader<br/>[eval.py]"]
end

subgraph group_inference["Prediction"]
  node_cli["SMILES prediction CLI<br/>[prediction.py]"]
  node_candidate_features["Candidate descriptors<br/>[featSelection.py]"]
  node_result["Activity report<br/>[prediction.py]"]
end

node_researcher(("Researcher"))

node_bioactivity -->|"reads"| node_eda
node_eda -->|"calculates"| node_features
node_eda -->|"writes"| node_rawsets
node_rawsets -->|"reads"| node_balancing
node_balancing -->|"writes"| node_splits
node_splits -->|"trains from"| node_agonist_train
node_splits -->|"trains from"| node_antagonist_train
node_agonist_train -->|"saves"| node_agonist_model
node_antagonist_train -->|"saves"| node_antagonist_model
node_researcher -->|"enters SMILES"| node_cli
node_cli -->|"calculates"| node_candidate_features
node_cli -->|"loads and predicts"| node_agonist_model
node_cli -->|"loads and predicts"| node_antagonist_model
node_cli -->|"reports"| node_result
node_eval_loader -->|"loads"| node_agonist_model
node_eval_loader -->|"loads"| node_antagonist_model

click node_bioactivity "https://github.com/laurenmbell/pparg/blob/main/data_processing/data/bioactivity.tsv"
click node_eda "https://github.com/laurenmbell/pparg/blob/main/data_processing/eda.py"
click node_features "https://github.com/laurenmbell/pparg/blob/main/data_processing/featSelection.py"
click node_rawsets "https://github.com/laurenmbell/pparg/tree/main/data_processing/data"
click node_balancing "https://github.com/laurenmbell/pparg/blob/main/data_processing/class_imbalance.py"
click node_splits "https://github.com/laurenmbell/pparg/tree/main/data_processing/data"
click node_agonist_train "https://github.com/laurenmbell/pparg/blob/main/ml_prediction/agonist_rf.py"
click node_antagonist_train "https://github.com/laurenmbell/pparg/blob/main/ml_prediction/antagonist_rf.py"
click node_agonist_model "https://github.com/laurenmbell/pparg/blob/main/ml_prediction/agonist_rf_model.joblib"
click node_antagonist_model "https://github.com/laurenmbell/pparg/blob/main/ml_prediction/antagonist_rf_model.joblib"
click node_eval_loader "https://github.com/laurenmbell/pparg/blob/main/ml_prediction/eval.py"
click node_cli "https://github.com/laurenmbell/pparg/blob/main/prediction.py"
click node_candidate_features "https://github.com/laurenmbell/pparg/blob/main/data_processing/featSelection.py"
click node_result "https://github.com/laurenmbell/pparg/blob/main/prediction.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_bioactivity,node_eda,node_features,node_rawsets,node_balancing,node_splits toneBlue
class node_agonist_train,node_antagonist_train,node_agonist_model,node_antagonist_model,node_eval_loader toneAmber
class node_cli,node_candidate_features,node_result toneMint
class node_researcher toneIndigo
```

## Components

### Data preparation

- [Bioactivity data](https://github.com/laurenmbell/pparg/blob/main/data_processing/data/bioactivity.tsv): `data_processing/data/bioactivity.tsv`
- [EDA and curation](https://github.com/laurenmbell/pparg/blob/main/data_processing/eda.py): `data_processing/eda.py`
- [Molecular features](https://github.com/laurenmbell/pparg/blob/main/data_processing/featSelection.py): `data_processing/featSelection.py`
- [Curated datasets](https://github.com/laurenmbell/pparg/tree/main/data_processing/data): `data_processing/data`
- [Class balancing](https://github.com/laurenmbell/pparg/blob/main/data_processing/class_imbalance.py): `data_processing/class_imbalance.py`
- [Training and test splits](https://github.com/laurenmbell/pparg/tree/main/data_processing/data): `data_processing/data`

### Model training

- [Agonist RF training](https://github.com/laurenmbell/pparg/blob/main/ml_prediction/agonist_rf.py): `ml_prediction/agonist_rf.py`
- [Antagonist RF training](https://github.com/laurenmbell/pparg/blob/main/ml_prediction/antagonist_rf.py): `ml_prediction/antagonist_rf.py`
- [Agonist model](https://github.com/laurenmbell/pparg/blob/main/ml_prediction/agonist_rf_model.joblib): `ml_prediction/agonist_rf_model.joblib`
- [Antagonist model](https://github.com/laurenmbell/pparg/blob/main/ml_prediction/antagonist_rf_model.joblib): `ml_prediction/antagonist_rf_model.joblib`
- [Model loader](https://github.com/laurenmbell/pparg/blob/main/ml_prediction/eval.py): `ml_prediction/eval.py`

### Prediction

- [SMILES prediction CLI](https://github.com/laurenmbell/pparg/blob/main/prediction.py): `prediction.py`
- [Candidate descriptors](https://github.com/laurenmbell/pparg/blob/main/data_processing/featSelection.py): `data_processing/featSelection.py`
- [Activity report](https://github.com/laurenmbell/pparg/blob/main/prediction.py): `prediction.py`

### Other components

- **Researcher**

## Connections

- Bioactivity data → EDA and curation: reads (evidence: `data_processing/eda.py`)
- EDA and curation → Molecular features: calculates (evidence: `data_processing/eda.py`)
- EDA and curation → Curated datasets: writes (evidence: `data_processing/eda.py`)
- Curated datasets → Class balancing: reads (evidence: `data_processing/class_imbalance.py`)
- Class balancing → Training and test splits: writes (evidence: `data_processing/class_imbalance.py`)
- Training and test splits → Agonist RF training: trains from (evidence: `ml_prediction/agonist_rf.py`)
- Training and test splits → Antagonist RF training: trains from (evidence: `ml_prediction/antagonist_rf.py`)
- Agonist RF training → Agonist model: saves (evidence: `ml_prediction/agonist_rf.py`)
- Antagonist RF training → Antagonist model: saves (evidence: `ml_prediction/antagonist_rf.py`)
- Researcher → SMILES prediction CLI: enters SMILES (evidence: `README.md`)
- SMILES prediction CLI → Candidate descriptors: calculates (evidence: `prediction.py`)
- SMILES prediction CLI → Agonist model: loads and predicts (evidence: `prediction.py`)
- SMILES prediction CLI → Antagonist model: loads and predicts (evidence: `prediction.py`)
- SMILES prediction CLI → Activity report: reports (evidence: `prediction.py`)
- Model loader → Agonist model: loads (evidence: `ml_prediction/eval.py`)
- Model loader → Antagonist model: loads (evidence: `ml_prediction/eval.py`)
