# enormandeau/snplift architecture

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

## Overview

SNPLift is a command-line workflow for transferring marker coordinates from an old reference genome to a new one, retaining other input columns and optionally correcting IDs or alleles. The principal path extracts source positions and flanking sequences, maps them to the new genome, derives and scores alignment features, uses neighboring markers to resolve marginal mappings, then rewrites the input file. The README documents these stages, but the main shell orchestrator and several scripts were not excerpted, so stage links cite the README; optional visualization branches are shown separately.

Main entry points: [`snplift`](https://github.com/enormandeau/snplift/blob/main/snplift) (Workflow runner), [`01_scripts/07_correspondence.py`](https://github.com/enormandeau/snplift/blob/main/01_scripts/07_correspondence.py) (Resolve correspondence), [`01_scripts/02_fasta_extract_flanking_regions.py`](https://github.com/enormandeau/snplift/blob/main/01_scripts/02_fasta_extract_flanking_regions.py) (Extract flanks), [`01_scripts/03_map_reads.sh`](https://github.com/enormandeau/snplift/blob/main/01_scripts/03_map_reads.sh) (Map sequences)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and setup"]
  node_config["Run configuration<br/>[snplift_config.sh]"]
  node_input["Marker input"]
  node_oldgenome["Old genome"]
  node_newgenome["New genome"]
  node_runner["Workflow runner"]
end

subgraph group_mapping["Mapping and scoring"]
  node_positions["Extract positions"]
  node_flanks["Extract flanks"]
  node_mapper["Map sequences<br/>[03_map_reads.sh]"]
  node_features["Alignment features"]
  node_score["Score markers"]
  node_correspond["Resolve correspondence"]
end

subgraph group_transfer["Coordinate transfer"]
  node_output["Transferred input"]
end

subgraph group_visualization["Visualization"]
  node_figuredata["Prepare plot data"]
  node_featureplot["Feature visualization"]
  node_collinearity["Collinearity plot"]
end

node_user(("Analyst"))

node_user -->|"launches"| node_runner
node_config -->|"configures"| node_runner
node_input -->|"supplies data"| node_runner
node_oldgenome -->|"supplies reference"| node_runner
node_newgenome -->|"supplies target"| node_runner
node_runner -->|"extracts coordinates"| node_positions
node_positions -->|"selects loci"| node_flanks
node_oldgenome -->|"provides sequence"| node_flanks
node_flanks -->|"supplies flanks"| node_mapper
node_newgenome -->|"mapping target"| node_mapper
node_mapper -->|"produces alignments"| node_features
node_features -->|"supplies features"| node_score
node_score -->|"supplies scores"| node_correspond
node_correspond -->|"supplies mappings"| node_output
node_input -->|"coordinates updated"| node_output
node_runner -.->|"optionally plots"| node_collinearity
node_correspond -.->|"prepares positions"| node_figuredata
node_runner -.->|"optionally visualizes"| node_featureplot

click node_config "https://github.com/enormandeau/snplift/blob/main/02_infos/snplift_config.sh"
click node_runner "https://github.com/enormandeau/snplift/blob/main/snplift"
click node_positions "https://github.com/enormandeau/snplift/blob/main/01_scripts/01_extract_positions.sh"
click node_flanks "https://github.com/enormandeau/snplift/blob/main/01_scripts/02_fasta_extract_flanking_regions.py"
click node_mapper "https://github.com/enormandeau/snplift/blob/main/01_scripts/03_map_reads.sh"
click node_features "https://github.com/enormandeau/snplift/blob/main/01_scripts/04_extract_features_from_alignments.py"
click node_score "https://github.com/enormandeau/snplift/blob/main/01_scripts/06_score_markers.py"
click node_correspond "https://github.com/enormandeau/snplift/blob/main/01_scripts/07_correspondence.py"
click node_output "https://github.com/enormandeau/snplift/blob/main/01_scripts/08_replace_coordinates_in_vcf.py"
click node_figuredata "https://github.com/enormandeau/snplift/blob/main/01_scripts/09_prepare_data_for_figure.py"
click node_featureplot "https://github.com/enormandeau/snplift/blob/main/01_scripts/05_explore_features.R"
click node_collinearity "https://github.com/enormandeau/snplift/blob/main/01_scripts/10_plot_transfered_positions.R"

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_config,node_input,node_oldgenome,node_newgenome,node_runner toneBlue
class node_positions,node_flanks,node_mapper,node_features,node_score,node_correspond toneAmber
class node_output toneMint
class node_figuredata,node_featureplot,node_collinearity toneRose
class node_user toneIndigo
```

## Components

### Inputs and setup

- [Run configuration](https://github.com/enormandeau/snplift/blob/main/02_infos/snplift_config.sh): `02_infos/snplift_config.sh`
- **Marker input**
- **Old genome**
- **New genome**
- [Workflow runner](https://github.com/enormandeau/snplift/blob/main/snplift): `snplift`

### Mapping and scoring

- [Extract positions](https://github.com/enormandeau/snplift/blob/main/01_scripts/01_extract_positions.sh): `01_scripts/01_extract_positions.sh`
- [Extract flanks](https://github.com/enormandeau/snplift/blob/main/01_scripts/02_fasta_extract_flanking_regions.py): `01_scripts/02_fasta_extract_flanking_regions.py`
- [Map sequences](https://github.com/enormandeau/snplift/blob/main/01_scripts/03_map_reads.sh): `01_scripts/03_map_reads.sh`
- [Alignment features](https://github.com/enormandeau/snplift/blob/main/01_scripts/04_extract_features_from_alignments.py): `01_scripts/04_extract_features_from_alignments.py`
- [Score markers](https://github.com/enormandeau/snplift/blob/main/01_scripts/06_score_markers.py): `01_scripts/06_score_markers.py`
- [Resolve correspondence](https://github.com/enormandeau/snplift/blob/main/01_scripts/07_correspondence.py): `01_scripts/07_correspondence.py`

### Coordinate transfer

- [Transferred input](https://github.com/enormandeau/snplift/blob/main/01_scripts/08_replace_coordinates_in_vcf.py): `01_scripts/08_replace_coordinates_in_vcf.py`

### Visualization

- [Prepare plot data](https://github.com/enormandeau/snplift/blob/main/01_scripts/09_prepare_data_for_figure.py): `01_scripts/09_prepare_data_for_figure.py`
- [Feature visualization](https://github.com/enormandeau/snplift/blob/main/01_scripts/05_explore_features.R): `01_scripts/05_explore_features.R`
- [Collinearity plot](https://github.com/enormandeau/snplift/blob/main/01_scripts/10_plot_transfered_positions.R): `01_scripts/10_plot_transfered_positions.R`

### Other components

- **Analyst**

## Connections

- Analyst → Workflow runner: launches (evidence: `README.md`)
- Run configuration → Workflow runner: configures (evidence: `README.md`)
- Marker input → Workflow runner: supplies data (evidence: `README.md`)
- Old genome → Workflow runner: supplies reference (evidence: `README.md`)
- New genome → Workflow runner: supplies target (evidence: `README.md`)
- Workflow runner → Extract positions: extracts coordinates (evidence: `README.md`)
- Extract positions → Extract flanks: selects loci (evidence: `README.md`)
- Old genome → Extract flanks: provides sequence (evidence: `README.md`)
- Extract flanks → Map sequences: supplies flanks (evidence: `README.md`)
- New genome → Map sequences: mapping target (evidence: `README.md`)
- Map sequences → Alignment features: produces alignments (evidence: `README.md`)
- Alignment features → Score markers: supplies features (evidence: `README.md`)
- Score markers → Resolve correspondence: supplies scores (evidence: `README.md`)
- Resolve correspondence → Transferred input: supplies mappings (evidence: `README.md`)
- Marker input → Transferred input: coordinates updated (evidence: `README.md`)
- Workflow runner → Collinearity plot: optionally plots (evidence: `README.md`)
- Resolve correspondence → Prepare plot data: prepares positions (evidence: `README.md`)
- Workflow runner → Feature visualization: optionally visualizes (evidence: `README.md`)
