require(ggqualimap)
knitr::opts_chunk$set(
  comment = "#",
  error = FALSE,
  tidy = FALSE,
  cache = FALSE,
  collapse=TRUE)
# options(datatable.auto.index=FALSE)

ggqualimap package

The ggqualimap package allows quick summary plots of qualimap reports from Next Generation Sequencing data.

There are five functions for plotting various summary statistics:

The function qualimap() loads the entire report as an object of class qualimap which can be used to generate any additional plots that are required.


Load qualimap report

The qualimap() function loads data from qualimap generated reports via the argument sample_info which should be a file containing info about samples. The file should contain at least these three columns:

It can also optionally contain a group column. If present, the plots generated will take it into account and color / facet accordingly.

Note: {.bs-callout .bs-callout-warning}

It is recommended to have a group column.

Sample annotation file {#sample-annotation-file}

path = system.file("tests/qualimap-sample", package="ggqualimap")
ann_file = file.path(path, "annotation.txt")
path = "./"
ann_file = file.path(path, "annotation.txt")

Here's how an annotation file might look like.

data.table::fread(ann_file)

Using qualimap() to load reports

obj = qualimap(ann_file)
obj
class(obj)

{.bs-callout .bs-callout-info}

Read alignment

plot_read_alignment() provides a plot of read alignment stats. By default the argument interactive = TRUE, in which case it will try to plot a jitter plot using the plotly package. Jitter plots are possible only when interactive = TRUE.

The other types of plot that is possible is box. It is only possible when only one qualimap object is provided as input. Plots can be interactive or static for box type. If static, the function returns a ggplot2 plot.

Interative plot using plotly

plot_read_alignment(sample=obj)
pl = plot_read_alignment(sample=obj)
ll = htmltools::tagList()
ll[[1L]] = plotly::as.widget(pl)
ll

Note that the facet is automatically named sample which was the name provided to the input argument. More than one such qualimap object can be provided to a single function to generate facetted plot as shown above, for e.g., plot_read_alignment(s1 = obj1, s2 = obj2).

Using interactive=FALSE would result in a static ggplot2 plot, but it is limited to a maximum of one qualimap object.

Static plot using ggplot2

plot_read_alignment(sample=obj, interactive=FALSE, geom="box")

Sequence duplication percentage

plot_genomic_origin() provides a plot of percentage of reads mapped to different genomic regions. The usage is also identical to plot_genomic_region except that the possible geoms are "jitter" and "bar".

Interative plot using plotly

plot_genomic_origin(sample=obj)
pl = plot_genomic_origin(sample=obj)
ll = htmltools::tagList()
ll[[1L]] = plotly::as.widget(pl)
ll

Static plot using ggplot2

plot_genomic_origin(sample=obj, interactive=FALSE, geom="bar")

Bias profiles

plot_bias_profile() provides a bias profiles across 5', 3' and 5'-3' regions. The usage is also identical to plot_genomic_origin.

Interative plot using plotly

plot_bias_profile(sample=obj)
pl = plot_bias_profile(sample=obj)
ll = htmltools::tagList()
ll[[1L]] = plotly::as.widget(pl)
ll

Static plot using ggplot2

plot_bias_profile(sample=obj, interactive=FALSE, geom="bar")

Coverage profiles

plot_coverage_profile() provides a plot of high, low and total coverage profiles. The only geom implemented is line. Both interactive and non-interactive plots are possible, as shown below.

Interative plot using plotly

plot_coverage_profile(sample=obj)
pl = plot_coverage_profile(sample=obj)
ll = htmltools::tagList()
ll[[1L]] = plotly::as.widget(pl)
ll

Static plot using ggplot2

plot_coverage_profile(sample=obj, interactive=FALSE)

Junction analysis

plot_junction_analysis() provides a plot of percentage of reads mapped across specific junctions. The only geom implemented is bar. Both interactive and non-interactive plots are possible, as shown below.

Interative plot using plotly

plot_junction_analysis(sample=obj)
suppressWarnings(pl <- plot_junction_analysis(sample=obj))
ll = htmltools::tagList()
ll[[1L]] = plotly::as.widget(pl)
ll

Static plot using ggplot2

plot_junction_analysis(sample=obj, interactive=FALSE)



openanalytics/ggqualimap documentation built on May 24, 2019, 2:28 p.m.