.. _`bio/sambamba/markdup`: SAMBAMBA MARKDUP ================ .. image:: https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/sambamba/markdup?label=version%20update%20pull%20requests :target: https://github.com/snakemake/snakemake-wrappers/pulls?q=is%3Apr+is%3Aopen+label%3Abio/sambamba/markdup Marks (default) or removes duplicate reads in BAM file. See details `here https://lomereiter.github.io/sambamba/docs/sambamba-markdup.html`_ Example ------- This wrapper can be used in the following way: .. code-block:: python rule sambamba_markdup: input: "mapped/{sample}.bam" output: "mapped/{sample}.rmdup.bam" params: extra="-r" # optional parameters log: "logs/sambamba-markdup/{sample}.log" threads: 8 wrapper: "v3.0.1/bio/sambamba/markdup" Note that input, output and log file paths can be chosen freely. When running with .. code-block:: bash 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:** * deduplicated bam file Authors ------- * Jan Forster Code ---- .. code-block:: python __author__ = "Jan Forster" __copyright__ = "Copyright 2021, Jan Forster" __email__ = "j.forster@dkfz.de" __license__ = "MIT" import os from snakemake.shell import shell from tempfile import TemporaryDirectory log = snakemake.log_fmt_shell(stdout=True, stderr=True) with TemporaryDirectory() as tempdir: shell( "sambamba markdup {snakemake.params.extra} --nthreads {snakemake.threads} " "--tmpdir {tempdir} {snakemake.input[0]} {snakemake.output[0]} " "{log}" ) .. |nl| raw:: html