neutralloss: Calculate similarity based on neutral losses

View source: R/similarity.R

neutrallossR Documentation

Calculate similarity based on neutral losses

Description

Calculate similarity based on neutral losses (NLS)

Usage

neutralloss(x, y, m = 0.5, n = 2, na.rm = TRUE, ...)

Arguments

x

Spectra object from Spectra containing intensity and m/z values, first MS/MS spectrum

y

Spectra object from Spectra containing intensity and m/z values, second MS/MS spectrum

m

numeric(1), exponent to calculate peak intensity-based weights

n

numeric(1), exponent to calculate m/z-based weights

na.rm

logical(1), if NA values should be removed

...

further arguments

Details

Similarities of spectra based on neutral losses are calculated according to the following formula:

NLS = \frac{\sum(W_{S1, i} \cdot W_{S2, i}) ^ 2}{ \sum(W_{S1, i} ^ 2) \cdot \sum(W_{S2, i} ^ 2) }

,

with W = [ peak intensity] ^{m} \cdot [ NL ]^n and NL = | m/z - precursor m/z |. For further information see Li et al. (2015): Navigating natural variation in herbivory-induced secondary metabolism in coyote tobacco populations using MS/MS structural analysis. PNAS, E4147–E4155.

In here, the precursor m/z is taken by the m/z feature with the highest intensity.

neutralloss returns a numeric value ranging between 0 and 1, where 0 indicates no similarity between the two MS/MS features, while 1 indicates that the MS/MS features are identical. Prior to calculating

W_{S1}

or

W_{S2}

, all intensity values are divided by the maximum intensity value.

Value

neutralloss returns a numeric similarity coefficient between 0 and 1

Author(s)

Thomas Naake, thomasnaake@googlemail.com

Examples

data("spectra", package = "MetCirc")
Spectra::compareSpectra(sps_tissue[1:10], FUN = neutralloss, m = 0.5, n = 2)


tnaake/MetCirc documentation built on April 23, 2023, 8:56 a.m.