SAMBAMBA INDEX

https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/sambamba/index?label=version%20update%20pull%20requests

Indexing a bam file with `sambamba https://lomereiter.github.io/sambamba/docs/sambamba-index.html`_

Example

This wrapper can be used in the following way:

rule sambamba_index:
    input:
        "mapped/{sample}.bam"
    output:
        "mapped/{sample}.bam.bai"
    params:
        extra=""  # optional parameters
    log:
        "logs/sambamba-index/{sample}.log"
    threads: 8
    wrapper:
        "v3.7.0/bio/sambamba/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

  • sambamba=1.0

Input/Output

Input:

  • bam file

Output:

  • bam index

Authors

  • Jan Forster

Code

__author__ = "Jan Forster"
__copyright__ = "Copyright 2021, Jan Forster"
__email__ = "j.forster@dkfz.de"
__license__ = "MIT"


import os
from snakemake.shell import shell

log = snakemake.log_fmt_shell(stdout=True, stderr=True)

shell(
    "sambamba index {snakemake.params.extra} -t {snakemake.threads} "
    "{snakemake.input[0]} {snakemake.output[0]} "
    "{log}"
)