.. _`bio/purge_dups/ngscstat`: PURGE_DUPS NGSCSTAT =================== .. image:: https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/purge_dups/ngscstat?label=version%20update%20pull%20requests :target: https://github.com/snakemake/snakemake-wrappers/pulls?q=is%3Apr+is%3Aopen+label%3Abio/purge_dups/ngscstat Purge haplotigs and overlaps in an assembly based on read depth **URL**: https://github.com/dfguan/purge_dups Example ------- This wrapper can be used in the following way: .. code-block:: python rule purge_dups_ngscstat: input: bam="reads.bam", output: cov="out/ngscstat.cov", stat="out/ngscstat.stat", log: "logs/ngscstat.log", params: extra="", threads: 1 wrapper: "v3.0.1/bio/purge_dups/ngscstat" 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. Software dependencies --------------------- * ``purge_dups=1.2.6`` Input/Output ------------ **Input:** * mapped reads in PAF format **Output:** * coverage * stats Authors ------- * Filipe Vieira Code ---- .. code-block:: python __author__ = "Filipe G. Vieira" __copyright__ = "Copyright 2022, Filipe G. Vieira" __license__ = "MIT" import tempfile from snakemake.shell import shell extra = snakemake.params.get("extra", "") log = snakemake.log_fmt_shell(stdout=True, stderr=True) with tempfile.TemporaryDirectory() as tmpdir: shell("ngscstat {extra} -O {tmpdir} {snakemake.input} {log}") if snakemake.output.get("cov"): shell("cat {tmpdir}/TX.base.cov > {snakemake.output.cov}") if snakemake.output.get("stat"): shell("cat {tmpdir}/TX.stat > {snakemake.output.stat}") .. |nl| raw:: html