.. _`bio/deeptools/alignmentsieve`: DEEPTOOLS ALIGNMENT-SIEVE ========================= .. image:: https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/deeptools/alignmentsieve?label=version%20update%20pull%20requests :target: https://github.com/snakemake/snakemake-wrappers/pulls?q=is%3Apr+is%3Aopen+label%3Abio/deeptools/alignmentsieve filters/shift alignments in a BAM/CRAM file according the the specified parameters. It can optionally output to BEDPE format. **URL**: https://deeptools.readthedocs.io/en/develop/content/tools/alignmentSieve.html Example ------- This wrapper can be used in the following way: .. code-block:: python rule test_deeptools_alignment_sieve: input: aln="a.bam", output: "filtered.bam", threads: 1 log: "logs/deeptools.log", params: extra="", wrapper: "v3.0.1/bio/deeptools/alignmentsieve" 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 ----- Input/output formats are automatically detected. Software dependencies --------------------- * ``deeptools=3.5.4`` Input/Output ------------ **Input:** * ``aln``: Path to BAM/CRAM formatted alignments. Bam filesm ust be indexed. **Output:** * Path to filtered bam alignments or bedpe intervals. Params ------ * ``extra``: Optional arguments for `alignmentSieve.py` Authors ------- * Thibault Dayris Code ---- .. code-block:: python __author__ = "Thibault Dayris" __copyright__ = "Copyright 2023, Thibault Dayris" __email__ = "thibault.dayris@gustaveroussy.fr" __license__ = "MIT" from snakemake.shell import shell log = snakemake.log_fmt_shell(stdout=True, stderr=True) extra = snakemake.params.get("extra", "") blacklist = snakemake.input.get("blacklist", "") if blacklist: extra += f" --blackListFileName {blacklist} " out_file = snakemake.output[0] if out_file.endswith(".bed"): extra += " --BED " shell( "alignmentSieve " "{extra} " "--numberOfProcessors {snakemake.threads} " "--bam {snakemake.input.aln} " "--outFile {out_file} " "{log} " ) .. |nl| raw:: html