.. _`bio/samtools/fixmate`: SAMTOOLS FIXMATE ================ .. image:: https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/samtools/fixmate?label=version%20update%20pull%20requests :target: https://github.com/snakemake/snakemake-wrappers/pulls?q=is%3Apr+is%3Aopen+label%3Abio/samtools/fixmate Use samtools to correct mate information after BWA mapping. Example ------- This wrapper can be used in the following way: .. code-block:: python rule samtools_fixmate: input: "mapped/{input}", output: "fixed/{input}", log: "{input}.log", message: "Fixing mate information in {wildcards.input}" threads: 1 params: extra="", wrapper: "v3.0.1/bio/samtools/fixmate/" 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. Notes ----- * The `extra` param allows for additional program arguments (not `-@/--threads` or `-O/--output-fmt`). * For more information see, http://www.htslib.org/doc/samtools-fixmate.html Software dependencies --------------------- * ``samtools=1.18`` * ``snakemake-wrapper-utils=0.6.2`` Input/Output ------------ **Input:** * bam or sam file (.bam,.sam) **Output:** * bam or sam file (.bam,.sam) Authors ------- * Thibault Dayris * Filipe G. Vieira Code ---- .. code-block:: python """Snakemake wrapper for samtools fixmate""" __author__ = "Thibault Dayris" __copyright__ = "Copyright 2019, Dayris Thibault" __email__ = "thibault.dayris@gustaveroussy.fr" __license__ = "MIT" from snakemake.shell import shell from snakemake.utils import makedirs from snakemake_wrapper_utils.samtools import get_samtools_opts samtools_opts = get_samtools_opts( snakemake, parse_write_index=False, parse_output=False ) extra = snakemake.params.get("extra", "") log = snakemake.log_fmt_shell(stdout=True, stderr=True) shell( "samtools fixmate {samtools_opts} {extra} {snakemake.input[0]} {snakemake.output[0]} {log}" ) .. |nl| raw:: html