peaks.fsa: Get maximal value in ranges

View source: R/peaks.fsa.R

peaks.fsaR Documentation

Get maximal value in ranges

Description

Look for the maximal value in one or many ranges, typically for peak detection.

Usage

  peaks.fsa(x, peaks, names, size.min, size.max, channels, colors,
    logTransform = FALSE, lowThreshold = 1000, noiseRange = c(-10, 0))

Arguments

x

An aligned object of class fsa, as returned by align.fsa.

peaks

A data.frame with one row for each peak to consider. Can be provided instead of individual names (corresponding to peaks row names instead of a column), size.min, size.max, channels and colors argument vectors.

names

Character vector, the names to give to the peaks (duplicated values should be avoided). If peaks is provided, this vector will be used instead.

size.min

Numeric vector, the minimal size (in base pairs) to look for the corresponding peak. If peaks is provided, this vector will be used instead.

size.max

Numeric vector, the maximal size (in base pairs) to look for the corresponding peak. If peaks is provided, this vector will be used instead.

channels

Character vector, the name of the channel in x in which to look for the corresponding peak. If peaks is provided, this vector will be used instead.

colors

Vector defining the color to use in future plots to highlight the corresponding peak. If peaks is provided, this vector will be used instead.

logTransform

Single logical value, whether to apply log transformation (base 2) to normalized values (previously floored to 0 and summed with 1) or not.

lowThreshold

Single numeric value, threshold for which "low profile" warnings are called if all peaks are lower.

noiseRange

Numeric vector of length 2, defining the range (relative to the starting range of the first peak defined in ranges) in which measure the noise (in bp). If the noise peak is 20 percent greater than the first peak, a warning is raised as the accuracy of the measure may be compromised.

Value

Returns x, with a new or updated peaks attribute, a data.frame with a row for each range :

size.min

User-provided argument.

size.max

User-provided argument.

channels

User-provided argument.

colors

User-provided argument.

size

Size at which the maximum was found, in base pairs.

height

Maximum found, in fluorescence units.

offScale

Is there any off-scale value in the range ?

normalized

Current peak's height divided by the mean of all peak heights.

A normalized vector attribute is also set, corresponding to the normalized column only.

Author(s)

Sylvain Mareschal

See Also

generic.process

Examples

  # Example FSA file provided
  fsa <- read.fsa(system.file("extdata/fsa_GEP/A5918.fsa", package="FSAtools"))
  fsa <- align.fsa(fsa)
  
  # Single custom interval
  fsa <- peaks.fsa(
    fsa,
    names = "IRF4",
    size.min = 86.2,
    size.max = 87.5,
    channels = "6-FAM",
    colors = "blue"
  )
  print(attr(fsa, "peaks"))
  
  # Using a design file
  design <- designFile(system.file("extdata/design_GEP.conf", package="FSAtools"))
  fsa <- peaks.fsa(fsa, peaks=design$GLOBALS$PEAKS)
  print(attr(fsa, "peaks"))

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