# schistodan/skim2mito architecture

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

- Interactive diagram: https://gitdiagram.com/schistodan/skim2mito
- Repository: https://github.com/schistodan/skim2mito

## Overview

skim2mito is a Snakemake pipeline for assembling, annotating, and analyzing mitochondrial genomes from low-coverage genome skims, with enhancements for museum samples. Users provide sample reads and configuration, then run the workflow to obtain assembly, QC, annotation, and phylogenetic outputs; a separate script can filter annotated genes. The README documents the main capabilities and outputs, but the workflow rules themselves were not excerpted, so detailed rule-to-rule calls are not asserted. The optional GetOrganelle reference-fetching capability is represented separately.

Main entry points: [`workflow/Snakefile`](https://github.com/schistodan/skim2mito/blob/main/workflow/Snakefile) (Snakemake workflow), [`config/config.yaml`](https://github.com/schistodan/skim2mito/blob/main/config/config.yaml) (Run configuration), [`config/samples.csv`](https://github.com/schistodan/skim2mito/blob/main/config/samples.csv) (Sample read manifest), [`workflow/scripts/go_fetch.py`](https://github.com/schistodan/skim2mito/blob/main/workflow/scripts/go_fetch.py) (Reference fetch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and orchestration"]
  node_config["Run configuration<br/>[config.yaml]"]
  node_samples["Sample read manifest<br/>[samples.csv]"]
  node_workflow["Snakemake workflow"]
  node_go_fetch["Reference fetch<br/>[go_fetch.py]"]
end

subgraph group_assembly["Assembly and QC"]
  node_read_qc["Raw read QC<br/>[fastqc_qc_fwd.smk]"]
  node_read_trim["Read trimming<br/>[fastp.smk]"]
  node_assembly_run["Mitochondrial assembly<br/>[getorganelle.smk]"]
  node_rename["Assembly selection and naming"]
  node_assembly_assess["Assembly assessment<br/>[assess_assembly.py]"]
  node_blast["Assembly similarity search<br/>[blastn.smk]"]
  node_mapping["Read mapping<br/>[minimap.smk]"]
  node_blobtools["Assembly summaries"]
end

subgraph group_annotation["Annotation and validation"]
  node_mitos["Genome annotation<br/>[annotations.smk]"]
  node_gene_extract["Gene extraction"]
  node_gene_filter["Gene validation filter"]
end

subgraph group_phylogeny["Phylogenetic analysis"]
  node_alignment["Gene alignments<br/>[mafft.smk]"]
  node_tree["Tree inference and rooting<br/>[iqtree.smk]"]
  node_tree_plot["Tree visualization<br/>[plot_tree.py]"]
  node_reports["Pipeline reports<br/>[multiqc.smk]"]
end

node_user(("Pipeline user"))
node_ncbi{{"NCBI sequence services"}}

node_user -->|"sets parameters"| node_config
node_user -->|"provides samples"| node_samples
node_user -->|"runs pipeline"| node_workflow
node_config -->|"configures run"| node_workflow
node_samples -->|"declares reads"| node_workflow
node_workflow -->|"generates QC"| node_read_qc
node_workflow -->|"generates trimmed reads"| node_read_trim
node_workflow -->|"runs assembly"| node_assembly_run
node_workflow -->|"selects assemblies"| node_rename
node_workflow -->|"assesses assemblies"| node_assembly_assess
node_workflow -->|"searches assemblies"| node_blast
node_workflow -->|"maps reads"| node_mapping
node_workflow -->|"summarizes assemblies"| node_blobtools
node_workflow -->|"annotates genomes"| node_mitos
node_workflow -->|"extracts genes"| node_gene_extract
node_gene_extract -.->|"validates annotations"| node_gene_filter
node_workflow -->|"supports phylogenetics"| node_alignment
node_workflow -->|"infers trees"| node_tree
node_workflow -->|"plots trees"| node_tree_plot
node_workflow -->|"produces reports"| node_reports
node_workflow -.->|"optionally fetches references"| node_go_fetch
node_go_fetch -->|"downloads sequences"| node_ncbi

click node_config "https://github.com/schistodan/skim2mito/blob/main/config/config.yaml"
click node_samples "https://github.com/schistodan/skim2mito/blob/main/config/samples.csv"
click node_workflow "https://github.com/schistodan/skim2mito/blob/main/workflow/Snakefile"
click node_go_fetch "https://github.com/schistodan/skim2mito/blob/main/workflow/scripts/go_fetch.py"
click node_read_qc "https://github.com/schistodan/skim2mito/blob/main/workflow/rules/fastqc_qc_fwd.smk"
click node_read_trim "https://github.com/schistodan/skim2mito/blob/main/workflow/rules/fastp.smk"
click node_assembly_run "https://github.com/schistodan/skim2mito/blob/main/workflow/rules/getorganelle.smk"
click node_rename "https://github.com/schistodan/skim2mito/blob/main/workflow/scripts/rename_assembled.py"
click node_assembly_assess "https://github.com/schistodan/skim2mito/blob/main/workflow/scripts/assess_assembly.py"
click node_blast "https://github.com/schistodan/skim2mito/blob/main/workflow/rules/blastn.smk"
click node_mapping "https://github.com/schistodan/skim2mito/blob/main/workflow/rules/minimap.smk"
click node_blobtools "https://github.com/schistodan/skim2mito/blob/main/workflow/rules/blobtools_create.smk"
click node_mitos "https://github.com/schistodan/skim2mito/blob/main/workflow/rules/annotations.smk"
click node_gene_extract "https://github.com/schistodan/skim2mito/blob/main/workflow/rules/extract_annotated_genes.smk"
click node_gene_filter "https://github.com/schistodan/skim2mito/blob/main/filter_mitogenes.py"
click node_alignment "https://github.com/schistodan/skim2mito/blob/main/workflow/rules/mafft.smk"
click node_tree "https://github.com/schistodan/skim2mito/blob/main/workflow/rules/iqtree.smk"
click node_tree_plot "https://github.com/schistodan/skim2mito/blob/main/workflow/scripts/plot_tree.py"
click node_reports "https://github.com/schistodan/skim2mito/blob/main/workflow/rules/multiqc.smk"

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_samples,node_workflow,node_go_fetch,node_user toneBlue
class node_read_qc,node_read_trim,node_assembly_run,node_rename,node_assembly_assess,node_blast,node_mapping,node_blobtools toneAmber
class node_mitos,node_gene_extract,node_gene_filter toneMint
class node_alignment,node_tree,node_tree_plot,node_reports toneRose
class node_ncbi toneIndigo
```

## Components

### Inputs and orchestration

- [Run configuration](https://github.com/schistodan/skim2mito/blob/main/config/config.yaml): `config/config.yaml`
- [Sample read manifest](https://github.com/schistodan/skim2mito/blob/main/config/samples.csv): `config/samples.csv`
- [Snakemake workflow](https://github.com/schistodan/skim2mito/blob/main/workflow/Snakefile): `workflow/Snakefile`
- [Reference fetch](https://github.com/schistodan/skim2mito/blob/main/workflow/scripts/go_fetch.py): `workflow/scripts/go_fetch.py`

### Assembly and QC

- [Raw read QC](https://github.com/schistodan/skim2mito/blob/main/workflow/rules/fastqc_qc_fwd.smk): `workflow/rules/fastqc_qc_fwd.smk`
- [Read trimming](https://github.com/schistodan/skim2mito/blob/main/workflow/rules/fastp.smk): `workflow/rules/fastp.smk`
- [Mitochondrial assembly](https://github.com/schistodan/skim2mito/blob/main/workflow/rules/getorganelle.smk): `workflow/rules/getorganelle.smk`
- [Assembly selection and naming](https://github.com/schistodan/skim2mito/blob/main/workflow/scripts/rename_assembled.py): `workflow/scripts/rename_assembled.py`
- [Assembly assessment](https://github.com/schistodan/skim2mito/blob/main/workflow/scripts/assess_assembly.py): `workflow/scripts/assess_assembly.py`
- [Assembly similarity search](https://github.com/schistodan/skim2mito/blob/main/workflow/rules/blastn.smk): `workflow/rules/blastn.smk`
- [Read mapping](https://github.com/schistodan/skim2mito/blob/main/workflow/rules/minimap.smk): `workflow/rules/minimap.smk`
- [Assembly summaries](https://github.com/schistodan/skim2mito/blob/main/workflow/rules/blobtools_create.smk): `workflow/rules/blobtools_create.smk`

### Annotation and validation

- [Genome annotation](https://github.com/schistodan/skim2mito/blob/main/workflow/rules/annotations.smk): `workflow/rules/annotations.smk`
- [Gene extraction](https://github.com/schistodan/skim2mito/blob/main/workflow/rules/extract_annotated_genes.smk): `workflow/rules/extract_annotated_genes.smk`
- [Gene validation filter](https://github.com/schistodan/skim2mito/blob/main/filter_mitogenes.py): `filter_mitogenes.py`

### Phylogenetic analysis

- [Gene alignments](https://github.com/schistodan/skim2mito/blob/main/workflow/rules/mafft.smk): `workflow/rules/mafft.smk`
- [Tree inference and rooting](https://github.com/schistodan/skim2mito/blob/main/workflow/rules/iqtree.smk): `workflow/rules/iqtree.smk`
- [Tree visualization](https://github.com/schistodan/skim2mito/blob/main/workflow/scripts/plot_tree.py): `workflow/scripts/plot_tree.py`
- [Pipeline reports](https://github.com/schistodan/skim2mito/blob/main/workflow/rules/multiqc.smk): `workflow/rules/multiqc.smk`

### Other components

- **Pipeline user**
- **NCBI sequence services**

## Connections

- Pipeline user → Run configuration: sets parameters (evidence: `README.md`)
- Pipeline user → Sample read manifest: provides samples (evidence: `README.md`)
- Pipeline user → Snakemake workflow: runs pipeline (evidence: `README.md`)
- Run configuration → Snakemake workflow: configures run (evidence: `README.md`)
- Sample read manifest → Snakemake workflow: declares reads (evidence: `README.md`)
- Snakemake workflow → Raw read QC: generates QC (evidence: `README.md`)
- Snakemake workflow → Read trimming: generates trimmed reads (evidence: `README.md`)
- Snakemake workflow → Mitochondrial assembly: runs assembly (evidence: `README.md`)
- Snakemake workflow → Assembly selection and naming: selects assemblies (evidence: `README.md`)
- Snakemake workflow → Assembly assessment: assesses assemblies (evidence: `README.md`)
- Snakemake workflow → Assembly similarity search: searches assemblies (evidence: `README.md`)
- Snakemake workflow → Read mapping: maps reads (evidence: `README.md`)
- Snakemake workflow → Assembly summaries: summarizes assemblies (evidence: `README.md`)
- Snakemake workflow → Genome annotation: annotates genomes (evidence: `README.md`)
- Snakemake workflow → Gene extraction: extracts genes (evidence: `README.md`)
- Gene extraction → Gene validation filter: validates annotations (evidence: `README.md`)
- Snakemake workflow → Gene alignments: supports phylogenetics (evidence: `README.md`)
- Snakemake workflow → Tree inference and rooting: infers trees (evidence: `README.md`)
- Snakemake workflow → Tree visualization: plots trees (evidence: `README.md`)
- Snakemake workflow → Pipeline reports: produces reports (evidence: `README.md`)
- Snakemake workflow → Reference fetch: optionally fetches references (evidence: `README.md`)
- Reference fetch → NCBI sequence services: downloads sequences (evidence: `workflow/scripts/go_fetch.py`)
