NDP: Calculate the normalised dot product

Description Usage Arguments Details Value Author(s) Examples

Description

Calculate the normalised dot product (NDP)

Usage

1
NDP(matrow1, matrow2, m = 0.5, n = 2, mass)

Arguments

matrow1

character or numeric vector, the entries correspond to the mass vector and contain corresponding intensities to the masses, it is the first feature to compare

matrow2

character or numeric vector, the entries correspond to the mass vector and contain corresponding intensities to the masses, it is the second feature to compare

m

numeric, exponent to calculate peak intensity-based weights

n

numeric, exponent to calculate peak intensity-based weights

mass

character or numeric vector, vector with all masses which occur in the data set

Details

The NDP is calculated according to the following formula:

∑(W_{S1, i} \cdot W_{S2, i}) ^ 2 ∑(W_{S1, i} ^ 2) * ∑(W_{S2, i} ^ 2)

, with W = [ peak intensity] ^{m} \cdot [m/z]^n. 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. NDP 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. For the calculation of the NDP only the elements of S1 and S2 that are not equal to 0 will be used.

Value

NDP returns a numeric similarity coefficient between 0 and 1

Author(s)

Thomas Naake, thomasnaake@googlemail.com

Examples

1
2
3
data("binnedMSP", package = "MetCirc")
NDP(matrow1 = binnedMSP[1,], matrow2 = binnedMSP[2,], m = 0.5, n = 2,
 mass = colnames(binnedMSP))

PlantDefenseMetabolism/MetCirc documentation built on May 8, 2019, 2:52 p.m.