Skip to content

Nextflow Prokaryotic Genome Analysis Workflow

rlopez edited this page Jul 31, 2026 · 2 revisions

Engine: Nextflow  ·  Workflow ID: prokaryotic_genome_analysis  ·  Path in repo: nextflow/workflows/prokaryotic_genome_analysis/

This workflow reconstructs a prokaryotic genome from raw short-read DNA-Seq data and characterises the genes encoded on it: starting from sequencing reads alone, with no reference assembly to align against, it produces a draft genome, the protein-coding genes predicted on it, and the homology evidence from which their function can be inferred. It assumes Illumina-style short reads of a bacterial or archaeal organism, single-end or paired-end, and optionally accepts mate-pair libraries as extra scaffolding evidence and Sanger, PacBio, Nanopore or pre-assembled contig data for a hybrid assembly. The run covers the whole chain in one pass — read quality control and preprocessing, de novo assembly, assembly evaluation against a reference, completeness assessment, prokaryotic gene finding, and a homology search of the predicted genes. The pipeline orchestrates the OmicsBox genome analysis and BLAST2GO suites, from FastQC and Trimmomatic through SPAdes, QUAST, BUSCO and Glimmer, to the final DIAMOND BLAST search.


Workflow Architecture

flowchart TD
    %% ---- Inputs ----
    IN1[/"Short reads FASTQ"/]:::input
    IN2[/"Adapter and<br/>contaminant FASTA"/]:::input
    IN3[/"Mate-pair libraries"/]:::input
    IN4[/"Hybrid assembly<br/>data"/]:::input
    IN5[/"Reference genome"/]:::input
    IN6[/"Glimmer ICM model"/]:::input

    %% ---- Processes, declared in execution order ----
    P01["FASTQC_RAW"]:::chart
    P02["TRIMMOMATIC"]:::omicsbox
    P03["FASTQC_POST"]:::chart
    P04["SPADES"]:::omicsbox
    P05["QUAST"]:::chart
    P06["BUSCO"]:::chart
    P07["GLIMMER"]:::omicsbox
    P08["DIAMOND_BLAST"]:::omicsbox

    %% ---- Data flow ----
    IN1 --> P01
    IN1 --> P02
    IN2 -.-> P01
    IN2 -.-> P02
    IN2 -.-> P03
    IN3 -.-> P04
    IN4 -.-> P04
    IN5 --> P05
    IN6 -.-> P07

    P02 --> P03
    P02 --> P04

    P04 --> P05
    P04 --> P06
    P04 --> P07

    P07 --> P08

    classDef input fill:#e8f4fd,stroke:#1f77b4,stroke-width:1px;
    classDef omicsbox fill:#fff3e0,stroke:#e67e22,stroke-width:1px;
    classDef chart fill:#f4ecf7,stroke:#8e44ad,stroke-width:1px;
Loading

Pipeline Steps

  • FASTQC_RAW — Assesses the quality of the untrimmed reads with omicsbox fastqc, screening them against the user-supplied adapter and contaminant lists when those files are provided. Its report is terminal — no later step consumes it — and serves as the baseline the post-trimming run is compared against.
  • TRIMMOMATIC — Preprocesses the reads with omicsbox trimmomatic, applying the adapter removal, edge trimming, quality trimming and quality/length filtering stages enabled in the configuration. For paired-end input it pairs mates by the configured upstream and downstream filename patterns. Emits the trimmed reads consumed by FASTQC_POST and SPADES, along with a trimming report and, for paired-end runs, the reads whose mate did not survive filtering.
    • FASTQC_POST — Re-runs omicsbox fastqc on the trimmed reads, so the effect of the preprocessing can be read against the raw baseline before the assembly is attempted.
  • SPADES — Assembles the trimmed reads de novo with omicsbox spades, under the configured data type, k-mer selection, error-correction and coverage-cutoff settings. For paired-end input the configured library type decides which orientation-specific OmicsBox input the reads are handed to. Supplying any mate-pair library switches the assembler's optional mate-pair mode on, and supplying any Sanger, long-read or contig data switches its hybrid-assembly mode on, so those inputs are folded in as additional scaffolding and gap-closing evidence without further configuration. Emits the scaffolded assembly consumed by QUAST, BUSCO and GLIMMER, together with the intermediate contig sequences, an assembly report and chart, and the assembly graphs when the configuration asks for them.
    • QUAST — Evaluates the draft assembly against the supplied reference genome with omicsbox quast, reporting contiguity, alignment and misassembly metrics under the configured genome type and the configured length, identity and misassembly thresholds. Its results are terminal.
    • BUSCO — Scores the draft assembly for gene-content completeness with omicsbox busco, against the lineage profile and assessment mode set in the configuration. Its results are terminal.
  • GLIMMER — Predicts protein-coding genes on the draft assembly with omicsbox glimmerv2, according to the configured genetic code, minimum ORF length, maximum gene overlap, minimum gene score, genome topology and run mode. It reuses the interpolated context model supplied as input when there is one, and otherwise trains a new model on the assembly itself, which it can save for reuse in later runs when the configuration asks for it. Emits the gene project consumed by DIAMOND_BLAST, together with the predicted gene structures and a run report.
  • DIAMOND_BLAST — Searches the predicted genes for homologues with omicsbox diamond, against the sequence database, query mode, sensitivity level, taxonomy filter and hit thresholds set in the configuration. Emits the project carrying the hit tables, which is the workflow's final result — the homology evidence a functional annotation is built from.

Inputs

A run needs the sequencing reads to assemble and a reference genome for the assembly evaluation; every other file input is optional and is read only by the step that consumes it.

Parameter Format Required Description
input_single_end / input_paired_end FASTQ (.fastq / .fq / .fastq.gz / .fq.gz) ✅ Glob matching the read files to assemble — set exactly one of the two, whichever matches the library layout. Every matching file is gathered into a single OmicsBox task, which parallelises over the samples internally. Paired-end mates are paired by filename, so those files must follow one consistent convention, declared through the upstream_pattern and downstream_pattern settings.
quast.reference_genome FASTA (.fasta / .fsa / .fa / .fna / .fas, plain or .gz) ✅ Reference genome the draft assembly is compared against by QUAST. Required even though a single step reads it — the run aborts at start-up when it is missing.
fastqc.adapters FASTA (.fasta / .fsa / .fa / .fna / .fas) ⬜ Named adapter sequences screened for by FASTQC_RAW and FASTQC_POST, replacing the built-in adapter list. Supplying the file enables adapter screening in those steps.
fastqc.contaminants FASTA (.fasta / .fsa / .fa / .fna / .fas) ⬜ Named contaminant sequences the overrepresented-sequence check is screened against, consumed by both FASTQC_RAW and FASTQC_POST, replacing the built-in contaminant list.
trimmomatic.adapters FASTA (.fasta / .fa / .faa / .fsa / .ffn / .fnn / .fna / .txt) ⬜ Custom adapter and contaminant sequences to clip in TRIMMOMATIC, used instead of one of the built-in adapter lists and read only when that step is configured to remove adapters.
spades.opt_mp_fr FASTQ / FASTA (.fastq / .fq / .fasta / .fsa / .fa / .fna / .fas, plain or .gz) or BAM (.bam) ⬜ Mate-pair library in forward-reverse orientation, added to the SPADES assembly as optional mate-pair data.
spades.opt_mp_rf FASTQ / FASTA (.fastq / .fq / .fasta / .fsa / .fa / .fna / .fas, plain or .gz) or BAM (.bam) ⬜ Mate-pair library in reverse-forward orientation, added to the SPADES assembly as optional mate-pair data.
spades.opt_mp_ff FASTQ / FASTA (.fastq / .fq / .fasta / .fsa / .fa / .fna / .fas, plain or .gz) or BAM (.bam) ⬜ Mate-pair library in forward-forward orientation, added to the SPADES assembly as optional mate-pair data.
spades.sanger FASTQ / FASTA (.fastq / .fq / .fasta / .fsa / .fa / .fna / .fas, plain or .gz) or BAM (.bam) ⬜ Sanger reads contributed to the SPADES hybrid assembly.
spades.pacbio FASTQ / FASTA (.fastq / .fq / .fasta / .fsa / .fa / .fna / .fas, plain or .gz) or BAM (.bam) ⬜ PacBio long reads contributed to the SPADES hybrid assembly.
spades.nanopore FASTQ / FASTA (.fastq / .fq / .fasta / .fsa / .fa / .fna / .fas, plain or .gz) or BAM (.bam) ⬜ Oxford Nanopore long reads contributed to the SPADES hybrid assembly.
spades.trusted_contigs FASTA (.fasta / .fsa / .fa / .fna / .fas, plain or .gz) ⬜ Pre-assembled contigs of reliable quality, contributed to the SPADES hybrid assembly.
spades.untrusted_contigs FASTA (.fasta / .fsa / .fa / .fna / .fas, plain or .gz) ⬜ Pre-assembled contigs of uncertain quality, contributed to the SPADES hybrid assembly.
glimmer.icm_model ICM (.icm) ⬜ Pre-built interpolated context model reused by GLIMMER instead of training a new one. Supplying it switches that step to the existing-model mode; leaving it empty makes Glimmer build its model from the draft assembly, which it can then save for later runs.

Note

Three input conditions are validated before any OmicsBox job is launched, and each one stops the run immediately with an explanatory message:

  • Exactly one of input_paired_end and input_single_end must be set — neither both nor neither.
  • spades.paired_end_library_type must be set for a paired-end run, to one of the paired-end, high-quality mate-pair or NxMate classes the configuration lists inline — it selects the orientation-specific assembler input and has no default. A single-end run ignores it.
  • quast.reference_genome must be set, because QUAST passes the reference to omicsbox quast unconditionally.

The read layout also constrains the step flags: several TRIMMOMATIC options apply to paired-end input only and make OmicsBox fail if they are enabled for a single-end run. The configuration file marks every one of them inline.


Configuration

This workflow follows the repository's self-documenting configuration strategy: you do not need to memorise parameter names, consult a reference table, or learn the OmicsBox CLI syntax. Every customisable option is already declared, grouped, and documented with inline comments inside the workflow's own configuration file.

To configure a run:

  1. Generate your own copy of the configuration file — Step 1 of Execution below.
  2. Open it in any text editor and read the inline comments; each option lists its accepted values and its default.
  3. Fill in the values you need and comment / uncomment the flags you want to enable or disable.
  4. Leave everything else untouched — the entries you do not change fall back to the tested defaults.

Tip

Keep your customised configuration file next to your project data and under version control. It is a complete, human-readable record of how a run was parameterised, which is all you need to reproduce it later.


Execution

Before running this workflow for the first time, complete the environment setup described on the central Nextflow Execution & Configuration page.

Two ways to run this workflow are supported. Option A is recommended when you want to inspect or modify the pipeline code; Option B runs the published version straight from GitHub with no manual clone.

Option A — Local Clone

Assuming you have already cloned the repository and navigated to its root directory:

Step 1 — Dump the configuration file

nextflow run nextflow/workflows/prokaryotic_genome_analysis/prokaryotic_genome_analysis.nf --dump_config

This copies the self-documenting template to ./prokaryotic_genome_analysis.config in your current directory and exits. No OmicsBox job is launched.

Step 2 — Customise it

Open the generated prokaryotic_genome_analysis.config and edit it as described in Configuration: set your input paths and output folder, then fill in or comment/uncomment the step-specific flags you want to change. Save the file.

Step 3 — Run the workflow

nextflow run nextflow/workflows/prokaryotic_genome_analysis/prokaryotic_genome_analysis.nf \
    -c prokaryotic_genome_analysis.config \
    -resume

Option B — Directly from GitHub

No clone required — the engine fetches the workflow for you.

Step 1 — Dump the configuration file

nextflow run BioBam/omicsbox-engine-workflows \
    -r main \
    -main-script nextflow/workflows/prokaryotic_genome_analysis/prokaryotic_genome_analysis.nf \
    --dump_config

The template is written to your current directory exactly as in Option A.

Step 2 — Customise it

Edit the generated prokaryotic_genome_analysis.config exactly as in Option A — see Configuration. Since the pipeline code lives remotely, this file is the only thing you own and edit.

Step 3 — Run the workflow

nextflow run BioBam/omicsbox-engine-workflows \
    -r main \
    -main-script nextflow/workflows/prokaryotic_genome_analysis/prokaryotic_genome_analysis.nf \
    -c prokaryotic_genome_analysis.config \
    -resume

Outputs

All results are written under the output directory set in your configuration file (local_folder), inside a subfolder named after the Nextflow session ID of the run. Each step publishes to its own numbered directory, so every file can be traced back to the process that produced it:

results/
└── <session-id>/
    ├── 01_fastqc_raw/    # Quality control report and charts of the raw reads
    ├── 02_trimmomatic/   # Trimmed reads and the trimming report
    ├── 03_fastqc_post/   # Quality control report and charts of the trimmed reads
    ├── 04_spades/        # Draft assembly sequences with the assembly report, chart and graphs
    ├── 05_quast/         # Assembly quality assessment results, report and charts
    ├── 06_busco/         # Assembly completeness assessment project, report and charts
    ├── 07_glimmer/       # Predicted genes with the gene project, model and report
    └── 08_diamond/       # Project with the DIAMOND BLAST hits

Clone this wiki locally