binPlots: Create line plots of averaged signal across a promoter

binPlotsR Documentation

Create line plots of averaged signal across a promoter

Description

Using a specified ordering of genes, they are split into multiple bins. In each bin, the signal across is summarized and displayed visually.

Usage

  ## S4 method for signature 'ScoresList'
binPlots(x, summarize = c("mean", "median"), ordering = NULL,
   ord.label = NULL, plot.type = c("line", "heatmap", "terrain"), n.bins = 10, cols = NULL,
   lwd = 3, lty = 1, same.scale = TRUE, symm.scale = FALSE, verbose = TRUE)

Arguments

x

A ScoresList object. See featureScores.

summarize

How to summarise the scores for each bin into a single value.

ordering

A data.frame of either numeric or factor variables, with the same number of rows as the annotation used to create x, or a vector of such types.

ord.label

Character string that describes what type of data the ordering is. e.g. "log2 expression". Used to label relevant plot axis.

plot.type

Style of plot to draw.

n.bins

The number of bins to split the features into, before summarisation.

cols

A vector of colours to use for the bins. In order from the lowest value bin, to the highest value bin.

lwd

Line width of lines in line plot (either scalar or vector).

lty

Line type of line in line plot (either scalar or vector).

same.scale

Whether to keep the scale on all plots be the same.

symm.scale

Whether the scale on plots is symmetrical around 0.

verbose

Whether to print details of processing.

Details

If plotType = "line", a line is plotted for each bin across the promoter.

If plotType = "heatmap", a series of bins are plotted as a heatmap. This can be useful to display a larger number of bins.

If plotType = "terrain", a series of bins are plotted as a 3D-terrain map. This can be useful to display a larger number of bins.

Value

Either a single- or multiple-panel figure.

Author(s)

Mark Robinson

Examples

  data(chr21genes)
  data(samplesList)  # Loads 'samples.list.subset'.
  data(expr)  # Loads 'expr.subset'.

  fs <- featureScores(samples.list.subset, chr21genes, up = 5000, down = 1000, dist = "base", freq = 1000,
                      s.width = 500)
  fs@scores <- list(tables(fs)[[2]] - tables(fs)[[4]])
  names(fs) <- "PC-Norm"

  binPlots(fs, ordering = expr.subset, ord.label = "expression", plot.type = "line", n.bins = 4)
  binPlots(fs, ordering = expr.subset, ord.label = "expression", plot.type = "heatmap", n.bins = 8)

markrobinsonuzh/Repitools documentation built on March 20, 2024, 6:04 a.m.