# meta-camp/camp_virus-phage-detect architecture

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

- Interactive diagram: https://gitdiagram.com/meta-camp/camp_virus-phage-detect
- Repository: https://github.com/meta-camp/camp_virus-phage-detect

## Overview

Virus-Phage Detection is a Snakemake pipeline for turning paired sequencing reads into viral-contig quality summaries. The user supplies a sample CSV and configuration, then the CLI prepares and runs the workflow locally or through Slurm. The documented analysis assembles reads, calls viral candidates with multiple tools, dereplicates and merges calls, and assesses quality with CheckV. The Snakefile and configs are present in the tree but were not excerpted; stage relationships below are based on the README, while CLI and sample-ingestion links use the shown Python excerpts.

Main entry points: [`workflow/Snakefile`](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile) (Read assembly), [`workflow/virus-phage-detect.py`](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/virus-phage-detect.py) (CLI and dispatch), [`workflow/utils.py`](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/utils.py) (Sample and work setup), [`workflow/ext/scripts/VIBRANT_run.py`](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/ext/scripts/VIBRANT_run.py) (VIBRANT implementation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Inputs and execution"]
  node_sample_csv["Sample CSV"]
  node_cli["CLI and dispatch"]
  node_sample_setup["Sample and work setup<br/>[utils.py]"]
  node_snakefile["Workflow rules"]
end

subgraph group_assembly["Assembly and calls"]
  node_reads["Paired reads"]
  node_metaspades["Read assembly"]
  node_viralverify["ViralVerify calls"]
  node_vibrant["VIBRANT calls"]
  node_vibrant_script["VIBRANT implementation<br/>[VIBRANT_run.py]"]
  node_virsorter["VirSorter2 calls"]
  node_deepvirfinder["DeepVirFinder calls"]
  node_genomad["geNomad calls"]
end

subgraph group_integration["Candidate integration"]
  node_candidate_merge["Candidate merge"]
  node_virclust["VirClust dereplication"]
end

subgraph group_quality["Quality and reports"]
  node_checkv["CheckV assessment"]
  node_reports["Quality summary"]
  node_final_output["Final report files"]
end

node_user(("Pipeline user"))
node_slurm["Slurm scheduler"]

node_user -->|"provides samples"| node_sample_csv
node_user -->|"runs pipeline"| node_cli
node_sample_csv -->|"supplies input"| node_cli
node_cli -->|"invokes workflow"| node_snakefile
node_cli -->|"sets up dry run"| node_sample_setup
node_sample_setup -.->|"links read files"| node_reads
node_snakefile -.->|"runs rules"| node_metaspades
node_metaspades -->|"assembles"| node_reads
node_metaspades -->|"provides assembly graph"| node_viralverify
node_metaspades -->|"provides contigs"| node_vibrant
node_metaspades -->|"provides contigs"| node_virsorter
node_metaspades -->|"provides contigs"| node_deepvirfinder
node_metaspades -->|"provides contigs"| node_genomad
node_snakefile -.->|"runs script"| node_vibrant_script
node_viralverify -->|"merges calls"| node_candidate_merge
node_vibrant -->|"merges calls"| node_candidate_merge
node_virsorter -->|"merges calls"| node_candidate_merge
node_deepvirfinder -->|"merges calls"| node_candidate_merge
node_genomad -->|"merges calls"| node_candidate_merge
node_candidate_merge -->|"dereplicates candidates"| node_virclust
node_virclust -->|"assesses candidates"| node_checkv
node_checkv -.->|"summarizes quality"| node_reports
node_reports -->|"writes summary"| node_final_output
node_cli -->|"submits jobs"| node_slurm

click node_cli "https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/virus-phage-detect.py"
click node_sample_setup "https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/utils.py"
click node_snakefile "https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile"
click node_metaspades "https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile"
click node_viralverify "https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile"
click node_vibrant "https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile"
click node_vibrant_script "https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/ext/scripts/VIBRANT_run.py"
click node_virsorter "https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile"
click node_deepvirfinder "https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile"
click node_genomad "https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile"
click node_candidate_merge "https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile"
click node_virclust "https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile"
click node_checkv "https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile"
click node_reports "https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile"

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_sample_csv,node_cli,node_sample_setup,node_snakefile,node_user toneBlue
class node_reads,node_metaspades,node_viralverify,node_vibrant,node_vibrant_script,node_virsorter,node_deepvirfinder,node_genomad toneAmber
class node_candidate_merge,node_virclust toneMint
class node_checkv,node_reports,node_final_output,node_slurm toneRose
```

## Components

### Inputs and execution

- **Sample CSV**
- [CLI and dispatch](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/virus-phage-detect.py): `workflow/virus-phage-detect.py`
- [Sample and work setup](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/utils.py): `workflow/utils.py`
- [Workflow rules](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile): `workflow/Snakefile`

### Assembly and calls

- **Paired reads**
- [Read assembly](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile): `workflow/Snakefile`
- [ViralVerify calls](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile): `workflow/Snakefile`
- [VIBRANT calls](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile): `workflow/Snakefile`
- [VIBRANT implementation](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/ext/scripts/VIBRANT_run.py): `workflow/ext/scripts/VIBRANT_run.py`
- [VirSorter2 calls](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile): `workflow/Snakefile`
- [DeepVirFinder calls](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile): `workflow/Snakefile`
- [geNomad calls](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile): `workflow/Snakefile`

### Candidate integration

- [Candidate merge](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile): `workflow/Snakefile`
- [VirClust dereplication](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile): `workflow/Snakefile`

### Quality and reports

- [CheckV assessment](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile): `workflow/Snakefile`
- [Quality summary](https://github.com/meta-camp/camp_virus-phage-detect/blob/main/workflow/Snakefile): `workflow/Snakefile`
- **Final report files**

### Other components

- **Pipeline user**
- **Slurm scheduler**

## Connections

- Pipeline user → Sample CSV: provides samples (evidence: `README.md`)
- Pipeline user → CLI and dispatch: runs pipeline (evidence: `README.md`)
- Sample CSV → CLI and dispatch: supplies input (evidence: `README.md`)
- CLI and dispatch → Workflow rules: invokes workflow (evidence: `workflow/virus-phage-detect.py`)
- CLI and dispatch → Sample and work setup: sets up dry run (evidence: `workflow/virus-phage-detect.py`)
- Sample and work setup → Paired reads: links read files
- Workflow rules → Read assembly: runs rules
- Read assembly → Paired reads: assembles (evidence: `README.md`)
- Read assembly → ViralVerify calls: provides assembly graph (evidence: `README.md`)
- Read assembly → VIBRANT calls: provides contigs (evidence: `README.md`)
- Read assembly → VirSorter2 calls: provides contigs (evidence: `README.md`)
- Read assembly → DeepVirFinder calls: provides contigs (evidence: `README.md`)
- Read assembly → geNomad calls: provides contigs (evidence: `README.md`)
- Workflow rules → VIBRANT implementation: runs script
- ViralVerify calls → Candidate merge: merges calls (evidence: `README.md`)
- VIBRANT calls → Candidate merge: merges calls (evidence: `README.md`)
- VirSorter2 calls → Candidate merge: merges calls (evidence: `README.md`)
- DeepVirFinder calls → Candidate merge: merges calls (evidence: `README.md`)
- geNomad calls → Candidate merge: merges calls (evidence: `README.md`)
- Candidate merge → VirClust dereplication: dereplicates candidates (evidence: `README.md`)
- VirClust dereplication → CheckV assessment: assesses candidates (evidence: `README.md`)
- CheckV assessment → Quality summary: summarizes quality
- Quality summary → Final report files: writes summary (evidence: `README.md`)
- CLI and dispatch → Slurm scheduler: submits jobs (evidence: `workflow/virus-phage-detect.py`)
