NAME

NBI::Launcher::Kraken2

VERSION

version 0.19.1

SYNOPSIS

# Dry-run (default): print generated script
nbilaunch kraken2 --r1 sample_R1.fq.gz --r2 sample_R2.fq.gz \
    --outdir results/kraken2

# Submit to Slurm
nbilaunch kraken2 --r1 sample_R1.fq.gz --outdir results/kraken2 --run

DESCRIPTION

Reference implementation of the NBI::Launcher subclass pattern. Wraps Kraken2 for paired-end or single-end taxonomic classification. Paired-end mode is selected automatically when --r2 is provided.

The database path defaults to $KRAKEN2_DB (environment variable) then /qib/databases/kraken2/standard. Thread count is synced from --cpus.

NAME

NBI::Launcher::Kraken2 - Taxonomic classification launcher using Kraken2

METHODS

new()

Construct the Kraken2 launcher spec. No arguments - all configuration is embedded in the constructor body. Returns a blessed NBI::Launcher::Kraken2 object ready for build().

make_command(%args)

Returns the Kraken2 shell invocation string for embedding in the job script.

Key %args consumed here:

  • r1, r2 - input FASTQ paths (r2 omitted for single-end)

  • db - database directory

  • confidence - confidence score threshold

  • threads - injected from --cpus via slurm_sync

  • sample - derived sample name (used for output filenames)

Output files reference $SCRATCH (a shell variable set by the generated script) rather than an absolute path.

build(%args)

Override of "build" in NBI::Launcher that auto-calculates the Slurm memory request from the Kraken2 database folder size before delegating to the base class. The calculation is ceil(db_size_gb * 1.4) + 100 GB (40% headroom plus a 100 GB fixed overhead). The auto-calculated value is used only when --mem is not explicitly supplied on the command line.

AUTHOR

Andrea Telatin <proch@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2023-2025 by Andrea Telatin.

This is free software, licensed under:

The MIT (X11) License