Skip to contents

Get mass shift for target mz

Usage

getMzShift(peaks, targetMz, tol, tolppm = FALSE, verbose = TRUE)

Arguments

peaks

List of MALDIquant::MassPeak

targetMz

Numeric, target mass

tol

Numeric, tolerance around targetMz

tolppm

Logical, tolerance supplied in ppm

verbose

Logical, print logs to the console.

Value

List with two entries: MzShift The mass shift for each spectrum specIdx The index of the spectra with a match for targetMz

Examples

data(Blank2022peaks)
getMzShift(Blank2022peaks, targetMz = 760.585, tol = 0.1, tolppm = FALSE)
#> found mz 760.585 in 32 / 32 spectra
#> 13:36 mzshift was -0.0796625 in mean and 0.0828  abs. max.
#> $mzshift
#>  [1] -0.0828 -0.0828 -0.0828 -0.0828 -0.0828 -0.0828 -0.0828 -0.0828 -0.0828
#> [10] -0.0828 -0.0828 -0.0828 -0.0828 -0.0828 -0.0828 -0.0828 -0.0828 -0.0828
#> [19] -0.0828 -0.0828 -0.0828 -0.0828 -0.0828 -0.0828 -0.0828 -0.0828 -0.0828
#> [28] -0.0828 -0.0577 -0.0577 -0.0577 -0.0577
#> 
#> $specIdx
#>  [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#> [26] 26 27 28 29 30 31 32
#>