QUALIMAP RNASEQ

https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/qualimap/rnaseq?label=version%20update%20pull%20requests

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

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:
        "v3.8.0-1-g149ef14/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.

Notes

Software dependencies

  • qualimap=2.3

  • snakemake-wrapper-utils=0.6.2

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}"
)