DEEPTOOLS PLOTFINGERPRINT

deepTools plotFingerprint plots a profile of cumulative read coverages from a list of indexed BAM files. For usage information about deepTools plotFingerprint, please see the documentation. For more information about deepTools, also see the source code.

In addition to required output, an optional output file of read counts can be generated by setting the output variable “counts” (see example Snakemake rule below).

plotFingerprint option Output

Name of output

variable to be used

Recommended

extension(s)

–plotFile, -plot, -o coverage plot

fingerprint

(required)

“.png” or

“.eps” or

“.pdf” or

“.svg”

–outRawCounts

tab-separated table of

read counts per bin

counts “.tab”

Software dependencies

  • deeptools ==3.4.3

Example

This wrapper can be used in the following way:

rule plot_fingerprint:
    input:
         bam_files=expand("samples/{sample}.bam", sample=["a", "b"]),
         bam_idx=expand("samples/{sample}.bam.bai", sample=["a", "b"])
    output:
        # Please note that --plotFile and --outRawCounts are exclusively defined via output files.
        # Usable output variables, their extensions and which option they implicitly call are listed here:
        #         https://snakemake-wrappers.readthedocs.io/en/stable/wrappers/deeptools/plotfingerprint.html.
        fingerprint="plot_fingerprint/plot_fingerprint.png",  # required
        # optional output
        counts="plot_fingerprint/raw_counts.tab"
    log:
        "logs/deeptools/plot_fingerprint.log"
    params:
        # optional parameters
        "--numberOfSamples 200 "
    wrapper:
        "0.65.0/bio/deeptools/plotfingerprint"

Note that input, output and log file paths can be chosen freely. When running with

snakemake --use-conda

the software dependencies will be automatically deployed into an isolated environment before execution.

Authors

  • Antonie Vietor

Code

__author__ = "Antonie Vietor"
__copyright__ = "Copyright 2020, Antonie Vietor"
__email__ = "antonie.v@gmx.de"
__license__ = "MIT"

from snakemake.shell import shell

log = snakemake.log_fmt_shell(stdout=True, stderr=True)

out_counts = snakemake.output.get("counts")

optional_output = ""

if out_counts:
    optional_output += " --outRawCounts {out_counts} ".format(out_counts=out_counts)

shell(
    "(plotFingerprint "
    "-b {snakemake.input.bam_files} "
    "-o {snakemake.output.fingerprint} "
    "{optional_output} "
    "{snakemake.params}) {log}"
)