QUALIMAP RNASEQ

Run qualimap rnaseq to create a QC report for RNA-seq data.

URL:

Example

This wrapper can be used in the following way:

rule qualimap:
    input:
        # BAM aligned, splicing-aware, to reference genome
        bam="mapped/a.bam",
        # GTF containing transcript, gene, and exon data
        gtf="annotation.gtf"
    output:
        directory("qc/a")
    log:
        "logs/qualimap/rna-seq/a.log"
    # optional specification of memory usage of the JVM that snakemake will respect with global
    # resource restrictions (https://snakemake.readthedocs.io/en/latest/snakefiles/rules.html#resources)
    # and which can be used to request RAM during cluster job submission as `{resources.mem_mb}`:
    # https://snakemake.readthedocs.io/en/latest/executing/cluster.html#job-properties
    wrapper:
        "0.77.0-2-gf3a6529/bio/qualimap/rnaseq"

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.

Software dependencies

  • qualimap==2.2.2d
  • snakemake-wrapper-utils==0.1.3

Input/Output

Input:

  • BAM file of RNA-seq data aligned to genome
  • GTF file containing genome annotations

Output:

  • QC report in html/pdf format

Authors

  • Brett Copeland

Code

__author__ = "Brett Copeland"
__copyright__ = "Copyright 2021, Brett Copeland"
__email__ = "brcopeland@ucsd.edu"
__license__ = "MIT"


import os

from snakemake.shell import shell

java_opts = snakemake.params.get("java_opts", "")
if java_opts:
    java_opts_str = f'JAVA_OPTS="{java_opts}"'
else:
    java_opts_str = ""
extra = snakemake.params.get("extra", "")
log = snakemake.log_fmt_shell(stdout=True, stderr=True)
shell(
    "{java_opts_str} qualimap rnaseq {extra} "
    "-bam {snakemake.input.bam} -gtf {snakemake.input.gtf} "
    "-outdir {snakemake.output} "
    "{log}"
)