plot.enve.RecPlot2: Enveomics: Recruitment Plot (2)

plot.enve.RecPlot2R Documentation

Enveomics: Recruitment Plot (2)

Description

Plots an enve.RecPlot2 object.

Usage

## S3 method for class 'enve.RecPlot2'
plot(
  x,
  layout = matrix(c(5, 5, 2, 1, 4, 3), nrow = 2),
  panel.fun = list(),
  widths = c(1, 7, 2),
  heights = c(1, 2),
  palette = grey((100:0)/100),
  underlay.group = TRUE,
  peaks.col = "darkred",
  use.peaks,
  id.lim = range(x$id.breaks),
  pos.lim = range(x$pos.breaks),
  pos.units = c("Mbp", "Kbp", "bp"),
  mar = list(`1` = c(5, 4, 1, 1) + 0.1, `2` = c(ifelse(any(layout == 1), 1, 5), 4, 4, 1)
    + 0.1, `3` = c(5, ifelse(any(layout == 1), 1, 4), 1, 2) + 0.1, `4` =
    c(ifelse(any(layout == 1), 1, 5), ifelse(any(layout == 2), 1, 4), 4, 2) + 0.1, `5` =
    c(5, 3, 4, 1) + 0.1, `6` = c(5, 4, 4, 2) + 0.1),
  pos.splines = 0,
  id.splines = 1/2,
  in.lwd = ifelse(is.null(pos.splines) || pos.splines > 0, 1/2, 2),
  out.lwd = ifelse(is.null(pos.splines) || pos.splines > 0, 1/2, 2),
  id.lwd = ifelse(is.null(id.splines) || id.splines > 0, 1/2, 2),
  in.col = "darkblue",
  out.col = "lightblue",
  id.col = "black",
  breaks.col = "#AAAAAA40",
  peaks.opts = list(),
  ...
)

Arguments

x

enve.RecPlot2 object to plot.

layout

Matrix indicating the position of the different panels in the layout, where:

  • 0: Empty space

  • 1: Counts matrix

  • 2: position histogram (sequencing depth)

  • 3: identity histogram

  • 4: Populations histogram (histogram of sequencing depths)

  • 5: Color scale for the counts matrix (vertical)

  • 6: Color scale of the counts matrix (horizontal)

Only panels indicated here will be plotted. To plot only one panel simply set this to the number of the panel you want to plot.

panel.fun

List of functions to be executed after drawing each panel. Use the indices in layout (as characters) as keys. Functions for indices missing in layout are ignored. For example, to add a vertical line at the 3Mbp mark in both the position histogram and the counts matrix: list('1'=function() abline(v=3), '2'=function() abline(v=3)). Note that the X-axis in both panels is in Mbp by default. To change this behavior, set pos.units accordingly.

widths

Relative widths of the columns of layout.

heights

Relative heights of the rows of layout.

palette

Colors to be used to represent the counts matrix, sorted from no hits to the maximum sequencing depth.

underlay.group

If TRUE, it indicates the in-group and out-group areas couloured based on in.col and out.col. Requires support for semi-transparency.

peaks.col

If not NA, it attempts to represent peaks in the population histogram in the specified color. Set to NA to avoid peak-finding.

use.peaks

A list of enve.RecPlot2.Peak objects, as returned by enve.recplot2.findPeaks. If passed, peaks.opts is ignored.

id.lim

Limits of identities to represent.

pos.lim

Limits of positions to represent (in bp, regardless of pos.units).

pos.units

Units in which the positions should be represented (powers of 1,000 base pairs).

mar

Margins of the panels as a list, with the character representation of the number of the panel as index (see layout).

pos.splines

Smoothing parameter for the splines in the position histogram. Zero (0) for no splines. Use NULL to automatically detect by leave-one-out cross-validation.

id.splines

Smoothing parameter for the splines in the identity histogram. Zero (0) for no splines. Use NULL to automatically detect by leave-one-out cross-validation.

in.lwd

Line width for the sequencing depth of in-group matches.

out.lwd

Line width for the sequencing depth of out-group matches.

id.lwd

Line width for the identity histogram.

in.col

Color associated to in-group matches.

out.col

Color associated to out-group matches.

id.col

Color for the identity histogram.

breaks.col

Color of the vertical lines indicating sequence breaks.

peaks.opts

Options passed to enve.recplot2.findPeaks, if peaks.col is not NA.

...

Any other graphic parameters (currently ignored).

Value

Returns a list of enve.RecPlot2.Peak objects (see enve.recplot2.findPeaks). If peaks.col=NA or layout doesn't include 4, returns NA.

Author(s)

Luis M. Rodriguez-R [aut, cre]


enveomics.R documentation built on May 29, 2024, 4:17 a.m.