scorePairs {metabCombiner} | R Documentation

## Calculate Pairwise Alignment Scores

### Description

Helper function for `calcScores` & `evaluateParams`. Calculates a pairwise similarity score between grouped features using differences in m/z, rt, and Q.

### Usage

    scorePairs(A, B, C, mzdiff, rtdiff, qdiff, rtrange, adductdiff)

### Arguments

`A` | Numeric weight for penalizing m/z differences.
`B` | Numeric weight for penalizing differences between fitted & observed retention times.
`C` | Numeric weight for differences in Q (abundance quantiles).
`mzdiff` | Numeric differences between feature m/z values
`rtdiff` | Differences between model-projected retention time value & observed retention time
`qdiff` | Difference between feature quantile Q values
`rtrange` | Range of dataset Y retention times
`adductdiff` | Numeric divisors of computed score when non-empty adduct labels do not match

### Details

The score between two grouped features x & y is calculated as:

S = -exp(-A |mzx - mzy| - B |rty - rtproj|/rtrange - C |Qx - Qy|)

where `mzx` & `Qx` correspond to the m/z and abundance quantile values of feature x; `mzy`, `rty`, and `Qy` correspond to the m/z, retention time, and quantile values of feature y; `rtproj` is the model-projected retention time of feature x onto the Y dataset chromatogram and `rtrange` is the retention time range of the Y dataset chromatogram. `A`, `B`, `C` are non-negative constant weight parameters for penalizing m/z, rt, and Q differences. Values between 0 (no confidence alignment) and 1 (high confidence alignment).

### Value

Numeric similarity score between 0 & 1

[Package metabCombiner version 1.2.2 Index]