objective: Weight Parameter Objective Function

View source: R/evaluateParams.R

objectiveR Documentation

Weight Parameter Objective Function

Description

This function evaluates the A, B, C weight parameters in terms of score separability of matching versus mismatching compound alignments. Higher objective function value imply a superior weight parameter selection.

Usage

objective(
  cTable,
  idtable,
  A,
  B,
  C,
  minScore,
  mzdiff,
  rtdiff,
  qdiff,
  rtrange,
  adductdiff,
  penalty,
  matches,
  mismatches
)

Arguments

cTable

data frame. Abridged metabCombiner report table.

idtable

data frame containing all evaluated identities

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).

minScore

numeric. Minimum score to count towards objective value.

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

penalty

positive numeric penalty wherever S(i,j) > S(i,i), i =/= j

matches

integer row indices of identity matches

mismatches

list of integer identity row mismatches for each identity

Details

First, the similarity scores between all grouped features are calculated as described in scorePairs

Then, the objective value for a similarity S is evaluated as:

OBJ(S) = \sum h(S(i,i)) - h(S(i, j)) - p(S(i,i) > S(i,j))

-S(i,i) represents the similarity between correct identity alignments
-S(i,j), represents the maximum similarity of i to grouped feature j, i =/= j (the highest-scoring misalignment)
-h(x) = x if x > minScore, 0 otherwise
-p(COND) = 0 if the condition is true, and a penalty value otherwise

This is summed over all labeled compound identities (e.g. idx = idy) shared between input datasets.

Value

A numeric value quantifying total separability of compound match similarity scores from mismatch scores, given A,B,C values


hhabra/Combiner documentation built on Jan. 26, 2024, 10:30 p.m.