plot.fsa: Plot method for "fsa" objects

View source: R/plot.fsa.R

plot.fsaR Documentation

Plot method for "fsa" objects

Description

Plots a fsa object. For each selected channel, a line is drawn bewteen measured fluorescence intensities (y axis) along the electrophoresis time (x axis).

Usage

## S3 method for class 'fsa'
plot(x, units = NA, channels = NA, chanColors = NA, ladder = TRUE,
    offScaleCol = "#FF0000", offScalePch = "+", offScaleCex = 0.4, bg = "white",
    fg = "black", title = "", title.adj = 0, title.line = NA, xlab = NA,
    ylab = "Intensity", xlim = NA, ylim = NA, xaxt = "s", yaxt = "s", bty = "o",
    xaxp = NA, nticks = 5, all.bp = TRUE, peaks.alpha = 48L, peaks.srt = 30,
    peaks.adj = c(0, 0), peaks.cex = 1.3, peaks.font = 2, legend.x = "topleft", ...)

Arguments

x

The fsa object to plot.

units

Single character value, the unit to use on x axis. "index" uses the raw index contained in files, "bp" usess base pair estimations but needs the object to be aligned first using align.fsa. NA will select "bp" if x is aligned, "index" elsewhere.

channels

Character or integer vector, the channels to plot. If NA, all channels are selected.

chanColors

Character vector defining colors to use to plot channels. Can be named according to channel names stored in x, or parallel with channels (first color for first channel, etc, no recycling). If NA, colors stored in x are used. See the col argument in par for further details on allowed values.

ladder

Single logical value, whether to add an x axis with size ladder peaks or not. Raises a warning if x was not aligned before plotting.

offScaleCol

To be passed to points for off-scale value plot (see par for allowed values).

offScalePch

To be passed to points for off-scale value plot (see par for allowed values).

offScaleCex

To be passed to points for off-scale value plot (see par for allowed values).

bg

See par for further details.

fg

See par for further details. This value is also used for col.axis, col.lab, col.main and col.sub graphical parameters.

title

Single character value, the main title to print on the plot.

title.adj

To be passed as adj to title.

title.line

To be passed as line to title.

xlab

See plot for further details. If NA, units is used.

ylab

See plot for further details.

xlim

See plot for further details. If NA, x range is used.

ylim

See plot for further details. If NA, x range is used.

xaxt

See par for further details.

yaxt

See par for further details.

bty

See par for further details.

xaxp

See par for further details. If NA, a suitable value is computed.

nticks

Single integer value. When xaxp is NA and units is "bp", this values fixes the interval between X axis labels.

all.bp

Single logical value, whether to force an unlabeled axis tick at each bp when units is "bp" or not.

peaks.alpha

Single integer value, the alpha channel to add to peak colors to make a background (255 is no transparency at all, 0 is invisible).

peaks.srt

To be passed as srt to text while printing peak names.

peaks.adj

To be passed as adj to text while printing peak names.

peaks.cex

To be passed as cex to text while printing peak names.

peaks.font

To be passed as font to text while printing peak names.

legend.x

To be passed as x to legend.

...

Further arguments to be passed to plot.

Value

Invisibly returns TRUE on success.

Author(s)

Sylvain Mareschal

See Also

read.fsa

Examples

  # Example FSA file provided
  fsa <- read.fsa(system.file("extdata/fsa_GEP/A5918.fsa", package="FSAtools"))
  
  # Plot whole profile
  plot(fsa)
  
  # Plot subset of the profile (time index)
  plot(fsa, units="index", xlim=c(4000,5000))
  
  # Plot subset of the profile (base pairs)
  fsa <- align.fsa(fsa)
  plot(fsa, units="bp", xlim=c(80,130))

FSAtools documentation built on Aug. 19, 2023, 1:06 a.m.