plotAnnot: Plot annotation statistics

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Plot maping statistics of an object containing mapping statistics in counts as percentages in stacked barplots.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
plotAnnot(x, scope, title, group = "default", facet = NULL,
  normalise = TRUE)

## S4 method for signature 'data.frame'
plotAnnot(x, scope, title, group = "default",
  facet = NULL, normalise = TRUE)

## S4 method for signature 'DataFrame'
plotAnnot(x, scope, title, group = "default",
  facet = NULL, normalise = TRUE)

## S4 method for signature 'CAGEexp'
plotAnnot(x, scope, title, group = "default",
  facet = NULL, normalise = TRUE)

Arguments

x

An object from which can be extracted a table with columns named promoter, exon, intron, mapped, extracted, rdna, and tagdust, that will be passed to the mapStats function.

scope

The name of a “scope”, that defines which data is plotted and how it is normalised, or a function implementing that scope. See mapStatsScopes() for details on each scope.

title

The title of the plot.

group

A factor to group the samples, or the name of a colData column of a CAGEexp object, or a formula giving the names of columns to be pasted together.

facet

A factor or the name of a colData column of a CAGEexp object, to facet the samples in the sense of ggplot2's facet_wrap function.

normalise

Whether to normalise or not. Default: TRUE.

Details

Stacked barplots with error bars inspired from http://stackoverflow.com/questions/10417003/stacked-barplot-with-errorbars-using-ggplot2. See http://www.biomedcentral.com/1471-2164/14/665/figure/F1 for example.

Value

Returns invisibly a ggplot2 object of class c("gg", "ggplot").

Author(s)

Charles Plessy

See Also

mapStats() for a list of scopes.

Other CAGEr annotation functions: annotateCTSS, ranges2annot, ranges2genes, ranges2names

Other CAGEr plot functions: hanabiPlot, plotCorrelation, plotExpressionProfiles, plotInterquantileWidth, plotReverseCumulatives

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
p <- plotAnnot(exampleCAGEexp, 'counts', 'Here is the title')
print(p)
p + ggplot2::theme_bw()
ggplot2::theme_set(ggplot2::theme_bw()) ; p
plotAnnot(exampleCAGEexp, 'counts', 'Same, non-normalised', normalise = FALSE)
exampleCAGEexp$myGroups <- factor(c("A", "A", "B", "B", "C"))
plotAnnot(exampleCAGEexp, 'counts', group = "myGroups")
plotAnnot(exampleCAGEexp, 'counts', group = ~myGroups)
plotAnnot(exampleCAGEexp, 'counts', group = ~sampleLabels + myGroups)
plotAnnot(exampleCAGEexp, CAGEr:::msScope_counts , group = "myGroups")

CAGEr documentation built on Jan. 17, 2021, 2 a.m.