plotRegions: Plot the coverage information surrounding genomic regions

View source: R/plotRegions.R

plotRegionsR Documentation

Plot the coverage information surrounding genomic regions

Description

This function plot the coverage information surrounding genomic regions while summarizing the annotation.

Usage

plotRegions(
  object,
  region,
  normCvg = TRUE,
  annot = NULL,
  allSignReg = TRUE,
  featureAnnot = NULL,
  flankReg = 10,
  colGroup = c("#0080ff", "#ff00ff"),
  fillReg = c("darkgreen", "darkred"),
  fillAnnot = "#FFD58A",
  type = "a",
  chrTitle = TRUE,
  trNames = c("DER", "coverage"),
  legend = TRUE,
  ...
)

Arguments

object

An object of class srnadiffExp as returned by srnadiff function.

region

A GRanges object. By example, ranges in the output from regions used on an object of class srnadiffExp.

normCvg

Boolean. If TRUE (the default), normalized coverages are displayed, else, the raw coverages are used.

annot

A GRanges or data.frame object containing gene and/or sRNA annotation information.

allSignReg

Boolean. If TRUE, all differeltially expressed regions contained in the annotated regions will be displayed.

featureAnnot

Character scalar. Feature annotation to be used, it will be one from column names of mcols(annot) if annot is a GRanges or one from colnames(annot) if annot is a data.frame.

flankReg

Integer value. If flankReg is positive, the displayed genomic interval is extended by flankReg nucleotides from the minimum start and maximum end from the displayed (ranges) regions.

colGroup

Character vector of length 2. The fill colors to be used to indicate samples per group.

fillReg

Character vector of length 2. The fill colors to be used to indicate 'up' or 'down' regulated regions.

fillAnnot

Character scalar. The fill color to be used for annotated regions.

type

Character vector. The plot type, one of ("a", "l", "p", "b", "confint") or combinations thereof. See Details for more information on the individual plotting types.

chrTitle

Boolean or character vector of length one. Defaults TRUE, the chromosome name is added to the plot. If character, this will be used for title.

trNames

Title for the tracks. By default "DER" and "coverage".

legend

Boolean triggering the addition of a legend to the (coverage) data track to indicate groups.

...

Additional display parameters to control the look and feel of the plots. See the "Display Parameters" section for functions GenomeAxisTrack, GeneRegionTrack, AnnotationTrack, DataTrack in the Gviz package.

Details

This function provides a flexible genomic visualization framework by displaying tracks in the sense of the Gviz package. Given a region (or regions), four separate tracks are represented: (1) GenomeAxisTrack, a horizontal axis with genomic coordinate tickmarks for reference location to the displayed genomic regions; (2) GeneRegionTrack, if the annot argument is passed, a track displaying all gene and/or sRNA annotation information in a particular region; (3) AnnotationTrack, regions are plotted as simple boxes if no strand information is available, or as arrows to indicate their direction; and (4) DataTrack, plot the sample coverages surrounding the genomic regions.

The sample coverages can be plotted in various different forms as well as combinations thereof. Supported plotting types are:

p: simple dot plot.

l: lines plot.

b: combination of dot and lines plot.

a: lines plot of the sample-groups average (i.e., mean) values.

confint: confidence intervals for average values. In combination with a type.

Value

A list of GenomeGraph track objects, all inheriting from class GdObject.

Examples

srnaExp <- srnadiffExample()
srnaExp <- srnadiff(srnaExp)

plotRegions(srnaExp, regions(srnaExp)[1])
plotRegions(srnaExp, regions(srnaExp)[1], type = c("a", "confint"))


mzytnicki/srnadiff documentation built on March 7, 2023, 2:18 a.m.