PBMM2 INDEX

Indexes a reference using pbmm2, a minimap2 SMRT wrapper for PacBio data https://github.com/PacificBiosciences/pbmm2/

URL:

Example

This wrapper can be used in the following way:

rule pbmm2_index:
    input:
        reference="target/{reference}.fasta",
    output:
        "target/{reference}.mmi",
    log:
        "logs/pbmm2_index/{reference}.log",
    params:
        preset="CCS", # SUBREAD, CCS, HIFI, ISOSEQ, UNROLLED
        extra="", # optional additional args
    threads: 8
    wrapper:
        "0.77.0-2-gf3a6529/bio/pbmm2/index"

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.

Software dependencies

  • pbmm2==1.3.0

Authors

  • William Rowell

Code

__author__ = "William Rowell"
__copyright__ = "Copyright 2020, William Rowell"
__email__ = "wrowell@pacb.com"
__license__ = "MIT"

from snakemake.shell import shell

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

shell(
    """
    (pbmm2 index \
    --num-threads {snakemake.threads} \
    --preset {snakemake.params.preset} \
    --log-level DEBUG \
    {extra} \
    {snakemake.input.reference} {snakemake.output}) {log}
    """
)