.. _`bio/pretext/map`: PRETEXT MAP =========== .. image:: https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/pretext/map?label=version%20update%20pull%20requests :target: https://github.com/snakemake/snakemake-wrappers/pulls?q=is%3Apr+is%3Aopen+label%3Abio/pretext/map Paired REad TEXTure Mapper. Converts SAM formatted read pairs into genome contact maps. **URL**: https://github.com/wtsi-hpag/PretextMap Example ------- This wrapper can be used in the following way: .. code-block:: python rule pretext_map: input: "a.bam", output: "map.pretext", log: "logs/pretext_map.log", params: extra="--sortby length --sortorder descend --mapq 10", wrapper: "v3.0.4/bio/pretext/map" 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 arguments. Software dependencies --------------------- * ``pretextmap=0.1.9`` * ``samtools=1.18`` * ``snakemake-wrapper-utils=0.6.2`` Input/Output ------------ **Input:** * SAM/BAM/CRAM file **Output:** * pretext contact map 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 from snakemake_wrapper_utils.samtools import infer_out_format log = snakemake.log_fmt_shell(stdout=True, stderr=True) extra = snakemake.params.get("extra", "") if snakemake.input[0].endswith(".gz"): pipe = "gunzip -c" elif snakemake.input[0].endswith(".bz2"): pipe = "bunzip2 -c" elif infer_out_format(snakemake.input[0]) in ["SAM", "BAM", "CRAM"]: pipe = "samtools view -h" else: pipe = "cat" shell( "({pipe}" " {snakemake.input} | " "PretextMap" " {extra}" " -o {snakemake.output}" ") {log}" ) .. |nl| raw:: html