How nf-core/funcscan works
Based on our analysis of the file tree and README, this project is a Nextflow-based bioinformatics pipeline (nf-core/funcscan) designed to process nucleotide sequence data (assembled contigs) and screen them for functional genes – including antimicrobial peptides, antibiotic resistance genes, and biosynthetic gene clusters. The project leverages a modular design (with numerous nf-core modules) to encapsulate various stages such as quality control, taxonomic classification, annotation, screening, and report aggregation. It also follows best practices in reproducibility through containerization (Docker/Singularity) and is managed using Nextflow DSL2.
Main Components
• Pipeline Controller (Nextflow engine): Represent the main.nf and nextflow.config as the entry point that orchestrates the workflow.
• Input Handling and Configuration: Include components such as sample input (samplesheet.csv) and configuration files from the “conf” directory that set runtime parameters.
• Modular Processing Units (Modules):
• Quality Control Module (using SeqKit)
• Taxonomic Classification Module (using MMseqs2)
• Functional Screening Modules:
– AMP screening (using ampir, Macrel, HMMER, AMPlify)
– ARG screening (using ABRicate, AMRFinderPlus, fARGene, RGI, DeepARG, argNorm)
– BGC screening (using antiSMASH, DeepBGC, GECCO, HMMER)
• Report Aggregation and Summarization: Represent the generation of aggregated summaries and final reports with external tools like AMPcombi, hAMRonization, comBGC, and MultiQC.
• External Dependencies and Containers: Show the support for containerized processes (Docker/Singularity) and note that each module typically runs in its own container.
• Subworkflows: Illustrate that there are additional subworkflows (found under subworkflows) to encapsulate certain tasks (e.g., local execution pipelines, utility workflows, and nf-core shared tooling).
Relationships and Flow
• The controller then directs data through sequential Quality Control → Taxonomic Classification.
• Next, further downstream screens for AMPs, ARGs, and BGCs should be depicted as parallel processes that take the annotated data as input.
• After these screening modules, present a consolidation phase where aggregated reports are created, eventually ending at MultiQC for final output.
Highlighted Architectural Patterns & Design Principles
• Modularity: The project is organized as Nextflow modules (both local and nf-core) allowing individual pieces to be maintained and updated independently.
• Containerization: Each process runs within its own container ensuring reproducibility and ease of deployment across diverse compute environments.
• Pipeline Orchestration: The orchestrator (Nextflow) is central—it logs, manages dependencies, and sequences tasks based on configuration files.
• CI/CD Integration: Automated testing and continuous integration workflows ensure that the pipeline’s functionality is constantly verified.
Technologies, Frameworks and Libraries
• Nextflow (DSL2): As the workflow engine.
• Docker, Singularity: For containerization.
• GitHub Actions (CI/CD), AWS for full-size tests.
• Clearly separate the orchestration/control layer (Nextflow orchestration and configuration) from the core processing modules (quality control, taxonomic classification, annotation, screening, and reporting).
Elements
• Each component should have a clear label (e.g., “Quality Control (SeqKit)”, “Taxonomic Classification (MMseqs2)”, “Gene Annotation (Prodigal/Pyrodigal/Prokka/Bakta)”, “AMP Screening”, “ARG Screening”, “BGC Screening”, “Aggregated Reporting (MultiQC)”).
• A section or note indicating that containers are used per module for reproducibility.
• Then, drill down to illustrate key modules and their interconnections clearly.
• Don’t overcomplicate: focus on clear separation of components with a detailed flow from ingest to output, while also noting CI/CD and containerization aspects.