SEQUALI

https://img.shields.io/badge/wrapper_version-v9.6.0-10785b https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/sequali?label=version%20update%20pull%20requests&color=1cb481

Generate quality-control reports from sequencing reads with Sequali.

URL: https://github.com/rhpvorderman/sequali

Example

This wrapper can be used in the following way:

rule sequali_se:
    input:
        sample="reads/se/{sample}.fastq",
    output:
        json="report/se/{sample}.json",
        html="report/se/{sample}.html",
    log:
        "logs/sequali/{sample}.log",
    threads: 2
    resources:
        mem_mb=1024,
    params:
        extra="",
    wrapper:
        "v9.6.0/bio/sequali"


rule sequali_se_adapter_file:
    input:
        sample="reads/se/{sample}.fastq",
        adapter_file="adapters/custom_adapters.tsv",
    output:
        json="report/se/{sample}.adapter.json",
        html="report/se/{sample}.adapter.html",
    log:
        "logs/sequali/{sample}.adapter.log",
    threads: 2
    resources:
        mem_mb=1024,
    params:
        extra="",
    wrapper:
        "v9.6.0/bio/sequali"


rule sequali_pe_images_zip:
    input:
        sample=["reads/pe/{sample}.f.fastq", "reads/pe/{sample}.r.fastq"],
    output:
        json="report/pe/{sample}.images.json",
        html="report/pe/{sample}.images.html",
        images_zip="report/pe/{sample}.zip",
    log:
        "logs/sequali/{sample}.log",
    threads: 2
    resources:
        mem_mb=1024,
    params:
        extra="",
    wrapper:
        "v9.6.0/bio/sequali"

Note that input, output and log file paths can be chosen freely.

When running with

snakemake --use-conda

the software dependencies will be automatically deployed into an isolated environment before execution.

Notes

[‘When output.images_zip is declared in the rule, it is passed to Sequali via –images-zip.’, ‘When input.adapter_file is provided in the rule, it is passed to Sequali via –adapter-file.’]

Software dependencies

  • sequali=1.0.2

Input/Output

Input:

  • sample: one FASTQ/uBAM file (format auto-detected) or two FASTQ files (paired-end)

  • adapter_file (optional): tab-separated TSV file with custom adapter sequences for Sequali’s –adapter-file option

Output:

  • html: QC report in HTML format

  • json: QC metrics in JSON format

  • images_zip (optional): zip archive containing the generated images

Params

  • extra: additional program arguments

Authors

  • Artur Gomes

Code

"""Snakemake wrapper for Sequali."""

__author__ = "Artur Gomes"
__copyright__ = "Copyright 2026, Artur Gomes"
__email__ = "arafaelogomes@gmail.com"
__license__ = "MIT"

from snakemake.shell import shell

extra = snakemake.params.get("extra", "")
log = snakemake.log_fmt_shell(stdout=True, stderr=True)

reads = snakemake.input.sample
if isinstance(reads, str):
    reads = [reads]

assert len(reads) in {
    1,
    2,
}, "input->sample must have 1 (single-end) or 2 (paired-end) elements."

images_zip = snakemake.output.get("images_zip", "")
if images_zip:
    images_zip = f"--images-zip {images_zip}"

adapter_file = snakemake.input.get("adapter_file", "")
if adapter_file:
    adapter_file = f"--adapter-file {adapter_file}"

shell(
    "sequali"
    " --threads {snakemake.threads}"
    " --json {snakemake.output.json:q}"
    " --html {snakemake.output.html:q}"
    " {images_zip}"
    " {adapter_file}"
    " {extra}"
    " {reads:q}"
    " {log}"
)