# lucvzon/virubench architecture

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

- Interactive diagram: https://gitdiagram.com/lucvzon/virubench
- Repository: https://github.com/lucvzon/virubench

## Overview

ViruBench is a Snakemake pipeline for comparing long-read viral metagenome assemblers. Its documented workflow takes sample FASTQs through cleanup, viral-read enrichment and chimeric-read filtering, then creates primary, reassembled and hybrid assemblies for evaluation. The graph preserves annotation, quality/accuracy assessment and reporting as product capabilities, while distinguishing Inspector’s read-mapping and assembly-error analysis. The README documents the main pipeline stages; sampled Inspector source confirms its internal analysis calls. Some workflow rules and later README details were not provided, so their implementation-level links are omitted.

Main entry points: [`workflow/rules/assemblers.smk`](https://github.com/lucvzon/virubench/blob/main/workflow/rules/assemblers.smk) (Primary assemblies), [`scripts/inspector.py`](https://github.com/lucvzon/virubench/blob/main/scripts/inspector.py) (Assembly inspection), [`workflow/snakefile.smk`](https://github.com/lucvzon/virubench/blob/main/workflow/snakefile.smk) (Snakemake workflow), [`workflow/rules/overview_tables.smk`](https://github.com/lucvzon/virubench/blob/main/workflow/rules/overview_tables.smk) (CheckV evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Read workflow"]
  node_config["Run configuration<br/>[virubench.yaml]"]
  node_orchestrator["Snakemake workflow<br/>[snakefile.smk]"]
  node_readprep["Read preparation"]
  node_targetfilter["Target read filtering"]
  node_chimera["Chimera filtering"]
end

subgraph group_assembly["Assembly tiers"]
  node_primary["Primary assemblies<br/>[assemblers.smk]"]
  node_reassembly["Reassembly<br/>[reassembly.smk]"]
  node_hybrid["Hybrid assembly<br/>[reassembly.smk]"]
end

subgraph group_analysis["Annotation and analysis"]
  node_annotation["Contig annotation"]
  node_diamondpost["DIAMOND post-processing"]
  node_taxondict["Taxonomy dictionary"]
  node_besthits["Best-hit aggregation"]
  node_inspector["Assembly inspection<br/>[inspector.py]"]
  node_contigstats["Contig statistics<br/>[denovo_static.py]"]
  node_svdetect["Structural variant detection<br/>[debreak_detect.py]"]
  node_svmerge["Structural variant merging<br/>[debreak_merge.py]"]
  node_svcluster["Error clustering"]
  node_baseerror["Base-error analysis"]
end

subgraph group_evaluation["Evaluation and reporting"]
  node_checkv["CheckV evaluation"]
  node_quast["QUAST evaluation"]
  node_summaries["Benchmark summaries"]
  node_checkvsummary["CheckV summaries"]
  node_report["Benchmark report"]
end

node_researcher(("Researcher"))
node_inputs["Sample FASTQs"]
node_externaldb[("Protein database")]
node_checkvdb[("CheckV database")]
node_ncbi["NCBI taxonomy"]

node_researcher -->|"configures"| node_config
node_researcher -->|"runs"| node_orchestrator
node_inputs -->|"provides reads"| node_readprep
node_config -->|"configures"| node_orchestrator
node_orchestrator -->|"runs"| node_readprep
node_readprep -->|"clean reads"| node_targetfilter
node_targetfilter -->|"classifies against"| node_externaldb
node_targetfilter -->|"target reads"| node_chimera
node_chimera -->|"filtered reads"| node_primary
node_orchestrator -->|"runs"| node_primary
node_primary -->|"primary contigs"| node_reassembly
node_primary -->|"unique contigs"| node_hybrid
node_reassembly -->|"reassembled contigs"| node_hybrid
node_primary -->|"contigs"| node_annotation
node_annotation -->|"searches"| node_externaldb
node_annotation -->|"DIAMOND results"| node_diamondpost
node_diamondpost -.->|"uses taxonomy"| node_taxondict
node_ncbi -->|"taxonomy data"| node_taxondict
node_diamondpost -.->|"annotated hits"| node_besthits
node_primary -.->|"assemblies"| node_inspector
node_inspector -->|"calls statistics"| node_contigstats
node_inspector -->|"calls detection"| node_svdetect
node_inspector -->|"calls merging"| node_svmerge
node_inspector -->|"calls clustering"| node_svcluster
node_inspector -->|"calls analysis"| node_baseerror
node_primary -->|"assembly tiers"| node_checkv
node_reassembly -->|"assembly tiers"| node_checkv
node_hybrid -->|"assembly tiers"| node_checkv
node_checkv -->|"evaluates with"| node_checkvdb
node_primary -->|"assembly tiers"| node_quast
node_reassembly -->|"assembly tiers"| node_quast
node_hybrid -->|"assembly tiers"| node_quast
node_checkv -.->|"quality results"| node_checkvsummary
node_quast -.->|"evaluation results"| node_summaries
node_summaries -.->|"summary data"| node_report
node_checkvsummary -.->|"quality tables"| node_report
node_orchestrator -->|"generates"| node_report

click node_config "https://github.com/lucvzon/virubench/blob/main/config/virubench.yaml"
click node_orchestrator "https://github.com/lucvzon/virubench/blob/main/workflow/snakefile.smk"
click node_readprep "https://github.com/lucvzon/virubench/tree/main/workflow/rules"
click node_targetfilter "https://github.com/lucvzon/virubench/tree/main/workflow/rules"
click node_chimera "https://github.com/lucvzon/virubench/tree/main/workflow/rules"
click node_primary "https://github.com/lucvzon/virubench/blob/main/workflow/rules/assemblers.smk"
click node_reassembly "https://github.com/lucvzon/virubench/blob/main/workflow/rules/reassembly.smk"
click node_hybrid "https://github.com/lucvzon/virubench/blob/main/workflow/rules/reassembly.smk"
click node_annotation "https://github.com/lucvzon/virubench/tree/main/workflow/rules"
click node_diamondpost "https://github.com/lucvzon/virubench/blob/main/scripts/post_process_diamond_v1.0.py"
click node_taxondict "https://github.com/lucvzon/virubench/blob/main/scripts/build_taxon_dict.py"
click node_besthits "https://github.com/lucvzon/virubench/blob/main/scripts/aggregate_best_hits.py"
click node_inspector "https://github.com/lucvzon/virubench/blob/main/scripts/inspector.py"
click node_contigstats "https://github.com/lucvzon/virubench/blob/main/scripts/denovo_static.py"
click node_svdetect "https://github.com/lucvzon/virubench/blob/main/scripts/debreak_detect.py"
click node_svmerge "https://github.com/lucvzon/virubench/blob/main/scripts/debreak_merge.py"
click node_svcluster "https://github.com/lucvzon/virubench/blob/main/scripts/debreak_merge_clustering.py"
click node_baseerror "https://github.com/lucvzon/virubench/blob/main/scripts/denovo_baseerror.py"
click node_checkv "https://github.com/lucvzon/virubench/blob/main/workflow/rules/overview_tables.smk"
click node_quast "https://github.com/lucvzon/virubench/blob/main/workflow/rules/overview_tables.smk"
click node_summaries "https://github.com/lucvzon/virubench/blob/main/scripts/summarize_benchmarks.py"
click node_checkvsummary "https://github.com/lucvzon/virubench/blob/main/scripts/summarize_checkv.py"
click node_report "https://github.com/lucvzon/virubench/blob/main/workflow/rules/generate_report.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_orchestrator,node_readprep,node_targetfilter,node_chimera toneBlue
class node_primary,node_reassembly,node_hybrid,node_externaldb,node_checkvdb toneAmber
class node_annotation,node_diamondpost,node_taxondict,node_besthits,node_inspector,node_contigstats,node_svdetect,node_svmerge,node_svcluster,node_baseerror toneMint
class node_checkv,node_quast,node_summaries,node_checkvsummary,node_report toneRose
class node_researcher,node_inputs,node_ncbi toneIndigo
```

## Components

### Read workflow

- [Run configuration](https://github.com/lucvzon/virubench/blob/main/config/virubench.yaml): `config/virubench.yaml`
- [Snakemake workflow](https://github.com/lucvzon/virubench/blob/main/workflow/snakefile.smk): `workflow/snakefile.smk`
- [Read preparation](https://github.com/lucvzon/virubench/tree/main/workflow/rules): `workflow/rules`
- [Target read filtering](https://github.com/lucvzon/virubench/tree/main/workflow/rules): `workflow/rules`
- [Chimera filtering](https://github.com/lucvzon/virubench/tree/main/workflow/rules): `workflow/rules`

### Assembly tiers

- [Primary assemblies](https://github.com/lucvzon/virubench/blob/main/workflow/rules/assemblers.smk): `workflow/rules/assemblers.smk`
- [Reassembly](https://github.com/lucvzon/virubench/blob/main/workflow/rules/reassembly.smk): `workflow/rules/reassembly.smk`
- [Hybrid assembly](https://github.com/lucvzon/virubench/blob/main/workflow/rules/reassembly.smk): `workflow/rules/reassembly.smk`

### Annotation and analysis

- [Contig annotation](https://github.com/lucvzon/virubench/tree/main/workflow/rules): `workflow/rules`
- [DIAMOND post-processing](https://github.com/lucvzon/virubench/blob/main/scripts/post_process_diamond_v1.0.py): `scripts/post_process_diamond_v1.0.py`
- [Taxonomy dictionary](https://github.com/lucvzon/virubench/blob/main/scripts/build_taxon_dict.py): `scripts/build_taxon_dict.py`
- [Best-hit aggregation](https://github.com/lucvzon/virubench/blob/main/scripts/aggregate_best_hits.py): `scripts/aggregate_best_hits.py`
- [Assembly inspection](https://github.com/lucvzon/virubench/blob/main/scripts/inspector.py): `scripts/inspector.py`
- [Contig statistics](https://github.com/lucvzon/virubench/blob/main/scripts/denovo_static.py): `scripts/denovo_static.py`
- [Structural variant detection](https://github.com/lucvzon/virubench/blob/main/scripts/debreak_detect.py): `scripts/debreak_detect.py`
- [Structural variant merging](https://github.com/lucvzon/virubench/blob/main/scripts/debreak_merge.py): `scripts/debreak_merge.py`
- [Error clustering](https://github.com/lucvzon/virubench/blob/main/scripts/debreak_merge_clustering.py): `scripts/debreak_merge_clustering.py`
- [Base-error analysis](https://github.com/lucvzon/virubench/blob/main/scripts/denovo_baseerror.py): `scripts/denovo_baseerror.py`

### Evaluation and reporting

- [CheckV evaluation](https://github.com/lucvzon/virubench/blob/main/workflow/rules/overview_tables.smk): `workflow/rules/overview_tables.smk`
- [QUAST evaluation](https://github.com/lucvzon/virubench/blob/main/workflow/rules/overview_tables.smk): `workflow/rules/overview_tables.smk`
- [Benchmark summaries](https://github.com/lucvzon/virubench/blob/main/scripts/summarize_benchmarks.py): `scripts/summarize_benchmarks.py`
- [CheckV summaries](https://github.com/lucvzon/virubench/blob/main/scripts/summarize_checkv.py): `scripts/summarize_checkv.py`
- [Benchmark report](https://github.com/lucvzon/virubench/blob/main/workflow/rules/generate_report.smk): `workflow/rules/generate_report.smk`

### Other components

- **Researcher**
- **Sample FASTQs**
- **Protein database**
- **CheckV database**
- **NCBI taxonomy**

## Connections

- Researcher → Run configuration: configures (evidence: `README.md`)
- Researcher → Snakemake workflow: runs (evidence: `README.md`)
- Sample FASTQs → Read preparation: provides reads (evidence: `README.md`)
- Run configuration → Snakemake workflow: configures (evidence: `README.md`)
- Snakemake workflow → Read preparation: runs (evidence: `README.md`)
- Read preparation → Target read filtering: clean reads (evidence: `README.md`)
- Target read filtering → Protein database: classifies against (evidence: `README.md`)
- Target read filtering → Chimera filtering: target reads (evidence: `README.md`)
- Chimera filtering → Primary assemblies: filtered reads (evidence: `README.md`)
- Snakemake workflow → Primary assemblies: runs (evidence: `README.md`)
- Primary assemblies → Reassembly: primary contigs (evidence: `README.md`)
- Primary assemblies → Hybrid assembly: unique contigs (evidence: `README.md`)
- Reassembly → Hybrid assembly: reassembled contigs (evidence: `README.md`)
- Primary assemblies → Contig annotation: contigs (evidence: `README.md`)
- Contig annotation → Protein database: searches (evidence: `README.md`)
- Contig annotation → DIAMOND post-processing: DIAMOND results (evidence: `README.md`)
- DIAMOND post-processing → Taxonomy dictionary: uses taxonomy
- NCBI taxonomy → Taxonomy dictionary: taxonomy data (evidence: `scripts/build_taxon_dict.py`)
- DIAMOND post-processing → Best-hit aggregation: annotated hits
- Primary assemblies → Assembly inspection: assemblies
- Assembly inspection → Contig statistics: calls statistics (evidence: `scripts/inspector.py`)
- Assembly inspection → Structural variant detection: calls detection (evidence: `scripts/inspector.py`)
- Assembly inspection → Structural variant merging: calls merging (evidence: `scripts/inspector.py`)
- Assembly inspection → Error clustering: calls clustering (evidence: `scripts/inspector.py`)
- Assembly inspection → Base-error analysis: calls analysis (evidence: `scripts/inspector.py`)
- Primary assemblies → CheckV evaluation: assembly tiers (evidence: `README.md`)
- Reassembly → CheckV evaluation: assembly tiers (evidence: `README.md`)
- Hybrid assembly → CheckV evaluation: assembly tiers (evidence: `README.md`)
- CheckV evaluation → CheckV database: evaluates with (evidence: `README.md`)
- Primary assemblies → QUAST evaluation: assembly tiers (evidence: `README.md`)
- Reassembly → QUAST evaluation: assembly tiers (evidence: `README.md`)
- Hybrid assembly → QUAST evaluation: assembly tiers (evidence: `README.md`)
- CheckV evaluation → CheckV summaries: quality results
- QUAST evaluation → Benchmark summaries: evaluation results
- Benchmark summaries → Benchmark report: summary data
- CheckV summaries → Benchmark report: quality tables
- Snakemake workflow → Benchmark report: generates (evidence: `README.md`)
