.. _`bio/bedtools/bamtobed`: BAMTOBED ======== .. image:: https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/bedtools/bamtobed?label=version%20update%20pull%20requests :target: https://github.com/snakemake/snakemake-wrappers/pulls?q=is%3Apr+is%3Aopen+label%3Abio/bedtools/bamtobed Conversion utility that converts sequence alignments in BAM format into BED, BED12, and/or BEDPE records. **URL**: https://bedtools.readthedocs.io/en/latest/content/tools/bamtobed.html Example ------- This wrapper can be used in the following way: .. code-block:: python rule bamtobed: input: "{sample}.bam", output: "{sample}.bed", log: "logs/bamtobed/{sample}.log", params: extra="-bedpe", # optional parameters wrapper: "v3.0.1/bio/bedtools/bamtobed" 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 ----- * This program/wrapper does not handle multi-threading. Software dependencies --------------------- * ``bedtools=2.31.1`` Input/Output ------------ **Input:** * BAM file, this must be the first file in the input file list **Output:** * BED file, this must be the first file in the output file list Params ------ * ``extra``: additional program arguments (except `-i`) Authors ------- * Filipe G. Vieira Code ---- .. code-block:: python __author__ = "Filipe G. Vieira" __copyright__ = "Copyright 2022, Filipe G. Vieira" __license__ = "MIT" from snakemake.shell import shell log = snakemake.log_fmt_shell(stdout=False, stderr=True) extra = snakemake.params.get("extra", "") shell( "(bamToBed" " {extra}" " -i {snakemake.input[0]}" " > {snakemake.output[0]}" ") {log}" ) .. |nl| raw:: html