compute_prior_prob: Compute prior probabilities for putative theoretical features

Description Usage Arguments Value Examples

View source: R/annotate_features.R

Description

Estimates prior probabilities of all possible theoretical features for each measured feature.

Usage

1
2
3
4
5
6
7
8
9
compute_prior_prob(
  hits.m,
  info.features,
  dat,
  pk = NULL,
  ppm,
  ppm.unknown = NULL,
  pr.limit = 1e-05
)

Arguments

hits.m

matrix with information about overlapping theoretical features (e.g. as generated by the function find_hits).

info.features

data.frame with information about theoretical possible features (e.g. as generated by the function chem_formula_2_adducts).

dat

data.frame with information about measured features with columns id (= unique identifier), mz (= measured mz value), intensity (= measured intensity).

pk

Numeric vector with probabilities of initial confidence of the presence of each theoretical feature.

ppm

Numeric. Resolution of mass spectrometer.

ppm.unknown

Numeric. Resolution assigned to unknown theoretical features (i.e. not contained in info.features).

pr.limit

Numeric. Lowest probability not set to 0 (default = 1e-05).

Value

matrix with measured features in rows and theoretical possible features in columns. The cell i,j contains the prior probability that measured feature i belongs to theoretical feature j.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data("se.example")
data("info.features")

dat = prepare_data_for_annotation(se = se.example)
hits.m = find_hits(info.features = info.features,
                   dat = dat,
                   ppm = 20)

prior.prob = compute_prior_prob(hits.m = hits.m,
                                info.features = info.features,
                                dat = dat,
                                ppm = 20)

szymczak-lab/preprocessHighResMS documentation built on Oct. 6, 2020, 12:50 a.m.