Learn R Programming

MetabolomicsBasics (version 1.4.5)

find_boundaries: find_boundaries.

Description

find_boundaries will determine peak boundaries within a BPC or mass trace.

Usage

find_boundaries(
  int = NULL,
  rt = NULL,
  p = which.max(int),
  k = 3,
  bl = min(int),
  local_min = int[p]
)

Value

Numeric vector of length=2 specifying the start and end index of the peak.

Arguments

int

The measured intensity of the ion mass (obviously ordered according to consecutive RTs).

rt

The respective retention times (can be omitted as currently not used).

p

The anticipated peak position (as index of int) if several peaks are within the mass trace.

k

The smoothing window parameter (provided to runmed).

bl

The baseline value. Can be provided explicitly if automatic determination is insufficient.

local_min

This is practically the upper end of the baseline. It can be set to avoid boundary detection at local minima (e.g. for peaks suffering ion suppression).

Details

It is yet another peak finder or, more precisely, it is a function to identify two RT values which flank a intensity maximum which is required if one would like to integrate the peak area.

Examples

Run this code
int <- sin(seq(-0.75 * pi, 1.75 * pi, by = 0.1))
plot(int)
abline(v = find_boundaries(int = int))

Run the code above in your browser using DataLab