How ku-cbd/nphantom works
Project type and purpose
• This is a bioinformatics workflow implemented as a Nextflow pipeline (NPhAnToM) for discovering and annotating bacteriophages from metagenomic Illumina reads.
• The purpose is to take raw or SRA-downloaded reads, preprocess them (trim, filter, QC), assemble contigs, predict viruses, assess completeness, annotate phages, predict hosts, and compile results into HTML and GenBank outputs.
File structure
• Top-level Nextflow scripts:
• NPhAnToM.nf (main pipeline)
• Assembly.nf, Trimming.nf, VirPredictions.nf, HostPredictor.nf, Pharokka.nf, TaxRemover.nf (modular pipeline stages)
• Python helper scripts for splitting, parsing, combination logic (e.g., fastasplitter.py, PharokkaSplitter.py, offsetdetector.py, virextractor.py, TaxRemover.py, DeepVirExtractor.py).
• Shell scripts to launch on HPC: nphantom_2.sh, nphantom_copy.sh.
• Configuration: nextflow.config, custom.config.
• No “frontend/backend,” but a sequence of processes, external databases, and runtimes managed by Nextflow.
README for insights
• Describes each pipeline step and the tools used: fasterqdump/fastq dump, AdapterRemoval/FastP, Kraken, FastQC, metaSPAdes, DeepVirFinder/Seeker/Phager, CheckV, Pharokka, IPHOP, plus result compilation.
• Indicates profiles: local vs. cluster (SLURM scheduler), use of Singularity or Conda/Mamba environments, and external database paths.
Main components & their interactions
a. Input sources
• SRA (via fasterqdump) or local FastQ files.
b. Workflow engine
• Nextflow DSL orchestrates processes, channels, parallelism, and handles profiles (local/cluster).
c. Preprocessing
• Trimming (AdapterRemoval, FastP) → Eukaryotic read removal (Kraken) → FastQC.
d. Assembly & QC
• metagenomic SPAdes → assembly stats (stats.sh).
e. Virus prediction
• DeepVirFinder (dvf.py), Seeker, Phager → combined by virextractor.py using union/intersection logic.
f. Completeness & annotation
• CheckV → Pharokka annotation.
g. Host prediction
• IPHOP.
h. Results compilation
• Python scripts merge outputs → HTML + GenBank in CompiledResults.
i. External resources & services
• Database files (Kraken2, CheckV, Pharokka DB, IPHOP DB), container registry (Singularity cache), HPC scheduler (SLURM).
Architectural patterns & principles
• Modular pipeline: each logical stage is a separate Nextflow process (.nf file).
• Reproducibility: containerized or Conda/Mamba environments per process, versioned databases.
• Parallelism: Nextflow channels decouple producers (e.g., read trimmers) from consumers (assemblers).
• Config-driven: nextflow.config and custom.config specify profiles, paths, resources.
Detail level & clarity
• Use consistent iconography for “script,” “tool,” “database,” and “workflow engine.”