# innessim/rad-phy2vcf architecture

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

## Overview

rad-phy2vcf is a command-line converter that produces a synthetic, continuous-coordinate, single-chromosome VCF from a PHYLIP alignment, retaining invariant sites. The README identifies the main user workflow; the sampled VCF implementation shows VCF writing, while the PHYLIP and population-map parsers and command-line options are separate modules. The main script was not excerpted, so its wiring to those modules is not shown; the population map is imported by the VCF module but its use is not evident in the excerpt.

Main entry points: [`rad-phy2vcf`](https://github.com/innessim/rad-phy2vcf/blob/main/rad-phy2vcf) (Converter entry point), [`vcf.py`](https://github.com/innessim/rad-phy2vcf/blob/main/vcf.py) (VCF writer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["User workflow"]
  node_main["Converter entry point"]
end

subgraph group_inputs["Input handling"]
  node_options["CLI options<br/>[comline.py]"]
  node_phylip["PHYLIP parser<br/>[phylip.py]"]
  node_popmap["Population map parser<br/>[popmap.py]"]
end

subgraph group_conversion["VCF conversion"]
  node_vcf["VCF writer<br/>[vcf.py]"]
  node_output["VCF file"]
end

node_user(("User"))
node_pixy["Downstream tools"]

node_user -->|"runs"| node_main
node_main -.->|"converts alignment"| node_vcf
node_vcf -->|"writes"| node_output
node_output -->|"feeds downstream"| node_pixy

click node_main "https://github.com/innessim/rad-phy2vcf/blob/main/rad-phy2vcf"
click node_options "https://github.com/innessim/rad-phy2vcf/blob/main/comline.py"
click node_phylip "https://github.com/innessim/rad-phy2vcf/blob/main/phylip.py"
click node_popmap "https://github.com/innessim/rad-phy2vcf/blob/main/popmap.py"
click node_vcf "https://github.com/innessim/rad-phy2vcf/blob/main/vcf.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_main,node_user toneBlue
class node_options,node_phylip,node_popmap toneAmber
class node_vcf,node_output toneMint
class node_pixy toneIndigo
```

## Components

### User workflow

- [Converter entry point](https://github.com/innessim/rad-phy2vcf/blob/main/rad-phy2vcf): `rad-phy2vcf`

### Input handling

- [CLI options](https://github.com/innessim/rad-phy2vcf/blob/main/comline.py): `comline.py`
- [PHYLIP parser](https://github.com/innessim/rad-phy2vcf/blob/main/phylip.py): `phylip.py`
- [Population map parser](https://github.com/innessim/rad-phy2vcf/blob/main/popmap.py): `popmap.py`

### VCF conversion

- [VCF writer](https://github.com/innessim/rad-phy2vcf/blob/main/vcf.py): `vcf.py`
- **VCF file**

### Other components

- **User**
- **Downstream tools**

## Connections

- User → Converter entry point: runs (evidence: `README.md`)
- Converter entry point → VCF writer: converts alignment
- VCF writer → VCF file: writes (evidence: `vcf.py`)
- VCF file → Downstream tools: feeds downstream (evidence: `README.md`)
