.. _`bio/pretext/graph`: PRETEXT MAP =========== .. image:: https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/pretext/graph?label=version%20update%20pull%20requests :target: https://github.com/snakemake/snakemake-wrappers/pulls?q=is%3Apr+is%3Aopen+label%3Abio/pretext/graph Embeds bedgraph data into Pretext contact maps. **URL**: https://github.com/wtsi-hpag/PretextGraph Example ------- This wrapper can be used in the following way: .. code-block:: python rule pretext_graph: input: bedgraph="{a}.bedgraph", map="map.pretext", output: "{a}.pretext", log: "logs/{a}.pretext_graph.log", params: graph_name="graph_name", extra="", wrapper: "v3.0.4/bio/pretext/graph" 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 --------------------- * ``pretextgraph=0.0.6`` Input/Output ------------ **Input:** * BEDgraph 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 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" else: pipe = "cat" shell( "({pipe}" " {snakemake.input.bedgraph} | " "PretextGraph" " -i {snakemake.input.map}" " -n {snakemake.params.graph_name}" " {extra}" " -o {snakemake.output}" ") {log}" ) .. |nl| raw:: html