PBMM2 INDEX
Indexes a reference using pbmm2, a minimap2 SMRT wrapper for PacBio data https://github.com/PacificBiosciences/pbmm2/
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:
"v5.3.0-16-g710597c/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.16.0
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}
"""
)