pcalc: Perform purity calculation on a peak matrix

Description Usage Arguments Value Examples

View source: R/pcalc.R

Description

This is the main purity calculation that is performed in purityX, purityD and purityA.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
pcalc(
  peaks,
  mzmin,
  mzmax,
  mztarget,
  ppm = NA,
  iwNorm = FALSE,
  iwNormFun = NULL,
  ilim = 0,
  targetMinMZ = NA,
  targetMaxMZ = NA,
  isotopes = FALSE,
  im = NULL
)

Arguments

peaks

matrix; Matrix of peaks consisting of 2 columns: mz and i

mzmin

numeric; Isolation window (min)

mzmax

numeric; Isolation window (max)

mztarget

numeric; The mz window to target in the isolation window

ppm

numeric; PPM tolerance for the target mz value. If NA will presume targetMinMZ and targetMaxMZ will be used

iwNorm

boolean; If TRUE then the intensity of the isolation window will be normalised based on the iwNormFun function

iwNormFun

function; A function to normalise the isolation window intensity. The default function is very generalised and just accounts for edge effects

ilim

numeric; All peaks less than this percentage of the target peak will be removed from the purity calculation, default is 5% (0.05)

targetMinMZ

numeric; Range to look for the mztarget (min)

targetMaxMZ

numeric; Range to look for the mztarget (max)

isotopes

boolean; TRUE if isotopes are to be removed

im

matrix; Isotope matrix, default removes C13 isotopes (single, double and triple bonds)

Value

a vector of the purity score and the number of peaks in the window e.g c(purity, pknm)

Examples

1
2
3
pm <- rbind(c(100, 1000),c(101.003, 10))
pcalc(pm, mzmin = 98, mzmax = 102, mztarget=100, ppm=5)
pcalc(pm, mzmin = 98, mzmax = 102, mztarget=100, ppm=5, isotopes = TRUE)

msPurity documentation built on Jan. 14, 2021, 2:44 a.m.