subtractMZ: Subtract MZ values based on ppm tolerance and noise ratio

Description Usage Arguments Value Examples

View source: R/purityD-subtract.R

Description

This function is intended for blank subtraction of mz values from two peaklists. It takes in 2 vectors of mz values and 2 coresponding vectors of Intensity values.

The second mz values are subtracted from the first set within an MZ tolerance.

However, if the mz match but the intensity is above a defined threshold then they are not subtracted

Usage

1
subtractMZ(mz1, mz2, i1, i2, ppm = 5, s2bthres = 10)

Arguments

mz1

vector = mz values to start with

mz2

vector = mz values to subtract

i1

vector = i values for mz1

i2

vector = i values for mz2

ppm

numeric = ppm tolerance

s2bthres

numeric = threshold for the samp2blank (i1/i2)

Value

a vector of the remaining mz values

Examples

1
2
3
4
5
6
mz1 <- c(100.001, 200.002, 300.302)
mz2 <- c(100.004, 200.003, 500.101)
i1 <- c(100, 100, 100)
i2 <- c(100, 10000, 100)

subtractMZ(mz1, mz2, i1, i2, ppm=5, s2bthres =10)

Example output

Loading required package: Rcpp
[1] 100.001 300.302

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