# comprna/suppa architecture

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

- Interactive diagram: https://gitdiagram.com/comprna/suppa
- Repository: https://github.com/comprna/suppa

## Overview

SUPPA is a command-line toolkit for alternative-splicing analysis. Its main workflow generates transcript or local-splicing event definitions from GTF annotations, computes PSI from transcript abundances, tests differential splicing or transcript usage across conditions, and can cluster significant events by PSI patterns. The repository also provides transcript-level PSI and expression-file merging. The graph follows the documented modular commands and sampled call/import evidence; some internal wiring and unsampled implementations are represented only where the README or SOURCE INDEX supports them.

Main entry points: [`suppa.py`](https://github.com/comprna/suppa/blob/master/suppa.py) (SUPPA CLI), [`eventGenerator.py`](https://github.com/comprna/suppa/blob/master/eventGenerator.py) (Event generator), [`psiCalculator.py`](https://github.com/comprna/suppa/blob/master/psiCalculator.py) (Event PSI calculator), [`psiPerGene.py`](https://github.com/comprna/suppa/blob/master/psiPerGene.py) (Transcript PSI calculator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Command entry"]
  node_cli["SUPPA CLI<br/>[suppa.py]"]
  node_merge["Expression merger<br/>[fileMerger.py]"]
end

subgraph group_events["Event generation"]
  node_generator["Event generator<br/>[eventGenerator.py]"]
  node_gtf["GTF genome store<br/>[gtf_store.py]"]
  node_eventmodel["Splicing event models<br/>[event.py]"]
  node_variable["Variable-boundary events<br/>[var_event.py]"]
end

subgraph group_quant["PSI quantification"]
  node_parsers["Input parsers<br/>[tools.py]"]
  node_eventpsi["Event PSI calculator<br/>[psiCalculator.py]"]
  node_genepsi["Transcript PSI calculator<br/>[psiPerGene.py]"]
end

subgraph group_diff["Differential analysis"]
  node_significance["Significance calculator"]
  node_differential["Differential statistics<br/>[diff_tools.py]"]
end

subgraph group_cluster["Clustering and utilities"]
  node_clusterer["Event clusterer<br/>[eventClusterer.py]"]
  node_cluster_tools["Cluster analysis<br/>[cluster_tools.py]"]
  node_optics["OPTICS implementation<br/>[optics.py]"]
  node_fieldselect["Field selection"]
end

node_user(("Analyst"))

node_user -->|"runs commands"| node_cli
node_cli -->|"dispatches generation"| node_generator
node_cli -->|"dispatches event PSI"| node_eventpsi
node_cli -->|"dispatches transcript PSI"| node_genepsi
node_cli -->|"dispatches testing"| node_significance
node_cli -->|"dispatches clustering"| node_clusterer
node_cli -->|"dispatches merging"| node_merge
node_generator -->|"loads annotation"| node_gtf
node_generator -->|"constructs events"| node_eventmodel
node_generator -.->|"uses variable models"| node_variable
node_generator -->|"uses utilities"| node_parsers
node_eventpsi -->|"reads input formats"| node_parsers
node_genepsi -->|"loads annotation"| node_gtf
node_genepsi -->|"reads expression"| node_parsers
node_eventpsi -.->|"provides PSI inputs"| node_significance
node_significance -->|"calculates statistics"| node_differential
node_clusterer -->|"runs clustering"| node_cluster_tools
node_cluster_tools -->|"uses OPTICS"| node_optics
node_fieldselect -.->|"selects fields"| node_merge

click node_cli "https://github.com/comprna/suppa/blob/master/suppa.py"
click node_merge "https://github.com/comprna/suppa/blob/master/fileMerger.py"
click node_generator "https://github.com/comprna/suppa/blob/master/eventGenerator.py"
click node_gtf "https://github.com/comprna/suppa/blob/master/lib/gtf_store.py"
click node_eventmodel "https://github.com/comprna/suppa/blob/master/lib/event.py"
click node_variable "https://github.com/comprna/suppa/blob/master/lib/var_event.py"
click node_parsers "https://github.com/comprna/suppa/blob/master/lib/tools.py"
click node_eventpsi "https://github.com/comprna/suppa/blob/master/psiCalculator.py"
click node_genepsi "https://github.com/comprna/suppa/blob/master/psiPerGene.py"
click node_significance "https://github.com/comprna/suppa/blob/master/significanceCalculator.py"
click node_differential "https://github.com/comprna/suppa/blob/master/lib/diff_tools.py"
click node_clusterer "https://github.com/comprna/suppa/blob/master/eventClusterer.py"
click node_cluster_tools "https://github.com/comprna/suppa/blob/master/lib/cluster_tools.py"
click node_optics "https://github.com/comprna/suppa/blob/master/lib/optics.py"
click node_fieldselect "https://github.com/comprna/suppa/blob/master/multipleFieldSelection.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_cli,node_merge toneBlue
class node_generator,node_gtf,node_eventmodel,node_variable toneAmber
class node_parsers,node_eventpsi,node_genepsi toneMint
class node_significance,node_differential toneRose
class node_clusterer,node_cluster_tools,node_optics,node_fieldselect,node_user toneIndigo
```

## Components

### Command entry

- [SUPPA CLI](https://github.com/comprna/suppa/blob/master/suppa.py): `suppa.py`
- [Expression merger](https://github.com/comprna/suppa/blob/master/fileMerger.py): `fileMerger.py`

### Event generation

- [Event generator](https://github.com/comprna/suppa/blob/master/eventGenerator.py): `eventGenerator.py`
- [GTF genome store](https://github.com/comprna/suppa/blob/master/lib/gtf_store.py): `lib/gtf_store.py`
- [Splicing event models](https://github.com/comprna/suppa/blob/master/lib/event.py): `lib/event.py`
- [Variable-boundary events](https://github.com/comprna/suppa/blob/master/lib/var_event.py): `lib/var_event.py`

### PSI quantification

- [Input parsers](https://github.com/comprna/suppa/blob/master/lib/tools.py): `lib/tools.py`
- [Event PSI calculator](https://github.com/comprna/suppa/blob/master/psiCalculator.py): `psiCalculator.py`
- [Transcript PSI calculator](https://github.com/comprna/suppa/blob/master/psiPerGene.py): `psiPerGene.py`

### Differential analysis

- [Significance calculator](https://github.com/comprna/suppa/blob/master/significanceCalculator.py): `significanceCalculator.py`
- [Differential statistics](https://github.com/comprna/suppa/blob/master/lib/diff_tools.py): `lib/diff_tools.py`

### Clustering and utilities

- [Event clusterer](https://github.com/comprna/suppa/blob/master/eventClusterer.py): `eventClusterer.py`
- [Cluster analysis](https://github.com/comprna/suppa/blob/master/lib/cluster_tools.py): `lib/cluster_tools.py`
- [OPTICS implementation](https://github.com/comprna/suppa/blob/master/lib/optics.py): `lib/optics.py`
- [Field selection](https://github.com/comprna/suppa/blob/master/multipleFieldSelection.py): `multipleFieldSelection.py`

### Other components

- **Analyst**

## Connections

- Analyst → SUPPA CLI: runs commands (evidence: `README.md`)
- SUPPA CLI → Event generator: dispatches generation (evidence: `suppa.py`)
- SUPPA CLI → Event PSI calculator: dispatches event PSI (evidence: `suppa.py`)
- SUPPA CLI → Transcript PSI calculator: dispatches transcript PSI (evidence: `suppa.py`)
- SUPPA CLI → Significance calculator: dispatches testing (evidence: `suppa.py`)
- SUPPA CLI → Event clusterer: dispatches clustering (evidence: `suppa.py`)
- SUPPA CLI → Expression merger: dispatches merging (evidence: `suppa.py`)
- Event generator → GTF genome store: loads annotation (evidence: `eventGenerator.py`)
- Event generator → Splicing event models: constructs events (evidence: `eventGenerator.py`)
- Event generator → Variable-boundary events: uses variable models
- Event generator → Input parsers: uses utilities (evidence: `eventGenerator.py`)
- Event PSI calculator → Input parsers: reads input formats (evidence: `psiCalculator.py`)
- Transcript PSI calculator → GTF genome store: loads annotation (evidence: `psiPerGene.py`)
- Transcript PSI calculator → Input parsers: reads expression (evidence: `psiPerGene.py`)
- Event PSI calculator → Significance calculator: provides PSI inputs (evidence: `README.md`)
- Significance calculator → Differential statistics: calculates statistics (evidence: `significanceCalculator.py`)
- Event clusterer → Cluster analysis: runs clustering (evidence: `eventClusterer.py`)
- Cluster analysis → OPTICS implementation: uses OPTICS (evidence: `lib/cluster_tools.py`)
- Field selection → Expression merger: selects fields
