How phcviro/viro-metagenomics works
Main components
• Workflow Orchestrator
– Nextflow (main.nf + DSL2 modules + subworkflows)
• Module Library
– QC modules (fastqc, fastp)
– Alignment modules (minimap2, samtools)
– Variant Calling modules (lofreq, medaka)
– Annotation modules (snpEff, SnpSift)
– Reporting modules (MultiQC, custom Python/R scripts in bin/)
• Reference Data
– nextflow-references folder (genomes, mutation tables, SnpEff data, BLAST DB)
• Input Interfaces
– Sample sheet CSV (defines sample IDs, input FASTQ paths, genome type)
– Raw FASTQ (gzipped)
• Compute Environment
– Local / HPC / Cloud executor (Docker/Conda optional)
• Outputs
– Per‐sample output tree: combinedFastq, QC, align, variants, annotations, coverage, report
Relationships & data flow
1) Inputs → Nextflow launcher
2) Nextflow parses sample sheet → routes samples into subworkflows (HBV or CMV)
3) Within each subworkflow:
a) Channel raw FASTQs → QC modules (fastqc → fastp) → cleaned FASTQs
b) Cleaned FASTQs + reference genomes → alignment module → BAM files
c) BAM → variant modules (lofreq SNVs → medaka indels) → raw VCFs
d) Raw VCFs + reference mutation tables → annotation modules → annotated VCFs/TSVs
e) All intermediate results → MultiQC module → final report
4) Results collected into structured output directories
Architectural patterns & principles
• DSL2 modular design – each step encapsulated in its own .nf file under modules/
• Subworkflow abstraction – cmv.nf and hbv.nf in subworkflows/ for virus‐specific branching
• Data‐flow (DAG) execution – channels connect processes, enabling parallelism
• Reusability – common modules (e.g., fastqc) used by both HBV and CMV branches
• Configuration separation – nextflow.config controls parameters, executors, containers
Notable technologies & tools
– Nextflow 24.04.4 (DSL2)
– fastqc, fastp, minimap2, samtools, lofreq, medaka, snpEff/SnpSift, mosdepth, bcftools, vcflib
– MultiQC for reporting
– Python/R scripts in bin/ for custom tables and plots
– Reference genome files, SnpEff databases, BLAST DB
– Clear, human‐readable labels on every component (e.g., “Quality Control (fastqc, fastp)”)
• Orchestrator vs. module vs. data store vs. compute
• Common vs. virus‐specific steps
Final advice
• Reference data as a separate repository that all alignment/annotation steps pull from.
• DAG nature—processes run in parallel where possible.
• Don’t overcomplicate—focus on separating the pipeline into logical processing stages and highlighting Nextflow’s role as orchestrator.
• This level of detail ensures maintainability, clarity for new engineers, and easy extension for other viral pipelines.