# tobiaszehnder/ipp architecture

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

- Interactive diagram: https://gitdiagram.com/tobiaszehnder/ipp
- Repository: https://github.com/tobiaszehnder/ipp

## Overview

IPP projects genomic coordinates between species using direct alignments or a shortest path through bridging species, then classifies and reports conservation. The main runtime path is documented by the CLI and sampled Python/C++ interfaces. The README also documents a custom alignment-generation capability; its detailed Snakefile wiring was not sampled, so only documented stages and supported converter relationships are shown.

Main entry points: [`src/ipp/project.py`](https://github.com/tobiaszehnder/ipp/blob/main/src/ipp/project.py) (Projection CLI), [`compute_alignments/Snakefile`](https://github.com/tobiaszehnder/ipp/blob/main/compute_alignments/Snakefile) (Workflow rules), [`cpp/src/ipp.cpp`](https://github.com/tobiaszehnder/ipp/blob/main/cpp/src/ipp.cpp) (Projection core), [`cpp/src/ippmodule.cpp`](https://github.com/tobiaszehnder/ipp/blob/main/cpp/src/ippmodule.cpp) (Python binding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_alignment_data["Alignment preparation"]
  node_alignment_pipeline["Alignment workflow"]
  node_workflow_rules["Workflow rules"]
  node_chain_conversion["Chain conversion<br/>[chainToTbl.py]"]
  node_alignment_collection["Alignment collection<br/>[collect_pwalns.py]"]
end

subgraph group_projection["Projection engine"]
  node_projection_core["Projection core<br/>[ipp.cpp]"]
  node_alignment_store[("Loaded alignments<br/>[ipp.h]")]
  node_path_search["Bridged projection<br/>[ipp.cpp]"]
end

subgraph group_classification["Classification and results"]
  node_classification["Conservation classification<br/>[project.py]"]
  node_projection_results["Projection results<br/>[project.py]"]
  node_unmapped_results["Unmapped regions<br/>[project.py]"]
end

subgraph group_interface["Python interface"]
  node_project_cli["Projection CLI<br/>[project.py]"]
  node_python_binding["Python binding<br/>[ippmodule.cpp]"]
end

node_researcher(("Researcher"))
node_genome_inputs["Genome FASTA"]
node_alignment_tools["Alignment tools"]
node_regions_bed["Input regions"]
node_pwaln_data["Pairwise alignments"]
node_target_bed["Target functional regions"]

node_researcher -.->|"starts workflow"| node_alignment_pipeline
node_genome_inputs -.->|"provides genomes"| node_alignment_pipeline
node_alignment_pipeline -.->|"runs rules"| node_workflow_rules
node_workflow_rules -.->|"dispatches tools"| node_alignment_tools
node_workflow_rules -.->|"uses converter"| node_chain_conversion
node_chain_conversion -.->|"converts chains"| node_alignment_collection
node_alignment_collection -.->|"writes binary"| node_pwaln_data
node_researcher -->|"runs projection"| node_project_cli
node_regions_bed -->|"provides coordinates"| node_project_cli
node_pwaln_data -->|"provides alignments"| node_project_cli
node_target_bed -.->|"provides target regions"| node_classification
node_project_cli -->|"calls projection API"| node_python_binding
node_python_binding -->|"dispatches jobs"| node_projection_core
node_projection_core -->|"loads alignment data"| node_alignment_store
node_projection_core -->|"computes bridged paths"| node_path_search
node_python_binding -->|"returns projections"| node_project_cli
node_project_cli -->|"classifies projections"| node_classification
node_classification -->|"writes results"| node_projection_results
node_project_cli -->|"writes unmapped names"| node_unmapped_results

click node_alignment_pipeline "https://github.com/tobiaszehnder/ipp/blob/main/compute_alignments/compute_pairwise_alignments.sh"
click node_workflow_rules "https://github.com/tobiaszehnder/ipp/blob/main/compute_alignments/Snakefile"
click node_chain_conversion "https://github.com/tobiaszehnder/ipp/blob/main/compute_alignments/chainToTbl.py"
click node_alignment_collection "https://github.com/tobiaszehnder/ipp/blob/main/compute_alignments/collect_pwalns.py"
click node_project_cli "https://github.com/tobiaszehnder/ipp/blob/main/src/ipp/project.py"
click node_python_binding "https://github.com/tobiaszehnder/ipp/blob/main/cpp/src/ippmodule.cpp"
click node_projection_core "https://github.com/tobiaszehnder/ipp/blob/main/cpp/src/ipp.cpp"
click node_alignment_store "https://github.com/tobiaszehnder/ipp/blob/main/cpp/include/ipp.h"
click node_path_search "https://github.com/tobiaszehnder/ipp/blob/main/cpp/src/ipp.cpp"
click node_classification "https://github.com/tobiaszehnder/ipp/blob/main/src/ipp/project.py"
click node_projection_results "https://github.com/tobiaszehnder/ipp/blob/main/src/ipp/project.py"
click node_unmapped_results "https://github.com/tobiaszehnder/ipp/blob/main/src/ipp/project.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_alignment_pipeline,node_workflow_rules,node_chain_conversion,node_alignment_collection toneBlue
class node_projection_core,node_alignment_store,node_path_search toneAmber
class node_classification,node_projection_results,node_unmapped_results toneMint
class node_project_cli,node_python_binding toneRose
class node_researcher,node_genome_inputs,node_alignment_tools,node_regions_bed,node_pwaln_data,node_target_bed toneIndigo
```

## Components

### Alignment preparation

- [Alignment workflow](https://github.com/tobiaszehnder/ipp/blob/main/compute_alignments/compute_pairwise_alignments.sh): `compute_alignments/compute_pairwise_alignments.sh`
- [Workflow rules](https://github.com/tobiaszehnder/ipp/blob/main/compute_alignments/Snakefile): `compute_alignments/Snakefile`
- [Chain conversion](https://github.com/tobiaszehnder/ipp/blob/main/compute_alignments/chainToTbl.py): `compute_alignments/chainToTbl.py`
- [Alignment collection](https://github.com/tobiaszehnder/ipp/blob/main/compute_alignments/collect_pwalns.py): `compute_alignments/collect_pwalns.py`

### Projection engine

- [Projection core](https://github.com/tobiaszehnder/ipp/blob/main/cpp/src/ipp.cpp): `cpp/src/ipp.cpp`
- [Loaded alignments](https://github.com/tobiaszehnder/ipp/blob/main/cpp/include/ipp.h): `cpp/include/ipp.h`
- [Bridged projection](https://github.com/tobiaszehnder/ipp/blob/main/cpp/src/ipp.cpp): `cpp/src/ipp.cpp`

### Classification and results

- [Conservation classification](https://github.com/tobiaszehnder/ipp/blob/main/src/ipp/project.py): `src/ipp/project.py`
- [Projection results](https://github.com/tobiaszehnder/ipp/blob/main/src/ipp/project.py): `src/ipp/project.py`
- [Unmapped regions](https://github.com/tobiaszehnder/ipp/blob/main/src/ipp/project.py): `src/ipp/project.py`

### Python interface

- [Projection CLI](https://github.com/tobiaszehnder/ipp/blob/main/src/ipp/project.py): `src/ipp/project.py`
- [Python binding](https://github.com/tobiaszehnder/ipp/blob/main/cpp/src/ippmodule.cpp): `cpp/src/ippmodule.cpp`

### Other components

- **Researcher**
- **Genome FASTA**
- **Alignment tools**
- **Input regions**
- **Pairwise alignments**
- **Target functional regions**

## Connections

- Researcher → Alignment workflow: starts workflow
- Genome FASTA → Alignment workflow: provides genomes
- Alignment workflow → Workflow rules: runs rules
- Workflow rules → Alignment tools: dispatches tools
- Workflow rules → Chain conversion: uses converter
- Chain conversion → Alignment collection: converts chains
- Alignment collection → Pairwise alignments: writes binary
- Researcher → Projection CLI: runs projection
- Input regions → Projection CLI: provides coordinates
- Pairwise alignments → Projection CLI: provides alignments
- Target functional regions → Conservation classification: provides target regions
- Projection CLI → Python binding: calls projection API
- Python binding → Projection core: dispatches jobs
- Projection core → Loaded alignments: loads alignment data
- Projection core → Bridged projection: computes bridged paths
- Python binding → Projection CLI: returns projections
- Projection CLI → Conservation classification: classifies projections
- Conservation classification → Projection results: writes results
- Projection CLI → Unmapped regions: writes unmapped names
