plotAnnot: Plot annotation statistics

plotAnnotR Documentation

Plot annotation statistics

Description

Extracts processing and alignment statistics from a CAGEr object and plots them as counts or percentages in stacked barplots.

Usage

plotAnnot(
  x,
  scope,
  title,
  group = "sampleLabels",
  facet = NULL,
  normalise = TRUE
)

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

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

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

## S4 method for signature 'GRangesList'
plotAnnot(
  x,
  scope,
  title,
  group = "sampleLabels",
  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. If no group is provided the sample labels will be used.

facet

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

normalise

Whether to normalise or not. Default: TRUE.

Details

When given a CAGEexp object or its column data, what will be counted is the number of CAGE tags. When given cluster objects (CTSS, TagClusters or ConsensusClusters) wrapped as a GenomicRanges::GRangesList, what will be counted is the number of clusters.

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 a ggplot2::ggplot object.

Author(s)

Charles Plessy

See Also

mapStats for a list of scopes.

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

Other CAGEr plot functions: TSSlogo(), hanabiPlot(), plotCorrelation(), plotExpressionProfiles(), plotInterquantileWidth(), plotReverseCumulatives()

Examples

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


charles-plessy/CAGEr documentation built on Oct. 27, 2024, 10:11 p.m.