calcMF: calcMF

Description Usage Arguments Details Value References Examples

View source: R/Functions_MF_prediction.R

Description

Calculate molecular formulas from a monoisotopic mass. This function uses Rdisop to generate molecular formulas, and can apply many of the filters described as the "seven golden rules"[1]

Usage

1
2
3
4
5
6
7
calcMF(mz = 200.000659, z = 1, ppm = 5, top = NULL,
  elements = Rdisop::initializeCHNOPS(), maxCounts = TRUE,
  SeniorRule = TRUE, HCratio = TRUE, moreRatios = TRUE,
  elementHeuristic = TRUE, Filters = list(DBErange = c(-5, 40),
  minElements = "C0", maxElements = "C99999", parity = "e", maxCounts =
  TRUE, SENIOR3 = 0, HCratio = TRUE, moreRatios = TRUE, elementHeuristic =
  TRUE), summarize = FALSE, BPPARAM = NULL)

Arguments

mz

monoisotopic mass or monoisotopic m/z value

z

charge (set 0 for uncharged)

ppm

error tolerance in ppm

top

if not NULL, maximum number of top formulas to be returned, as ranked by ppm error

elements

either NULL or an element list for Rdisop, as generated by initializeCHNOPS and related functions.

maxCounts

check each predicted molecula formula for maximum number of elements expected in a natural product of its size ("Golden Rule #1")

SeniorRule

for each predicted molecula formula, calculate the sum of valences minus twice (the number of atoms minus 1) (to check for Senior's third theorem, "Golden Rule #2")[1][2][3]

HCratio

for each predicted molecula formula, calculate Hydrogen/ Carbon count ratio ("Golden Rule #4")

moreRatios

for each predicted molecula formula, calculate Nitrogen/Carbon, Oxygen/Carbon, Phosphorus/Carbon and Sulfur/Carbon count ratios ("Golden Rule #5")

elementHeuristic

apply a heuristic HNOPS probability check as proposed in "Golden Rule #6"

Filters

which filters to apply, see Details

summarize

if TRUE, will return a single character string with molecular formulas and charge instead of a data.table

BPPARAM

parameters for parallel processing with BiocParallel. Can be bpparam(), or an object of these classes SnowParam-class, MulticoreParam-class. If NULL, SerialParam() is called (no multicore processing).

Details

Filters

These filtering steps can be selected. Filter items that are NULL (or not in the list) will not be applied.

DBErange

numeric vector of length 2, defining lower and upper limit for double bond equivalents in the molecule

minElements

character(1) with a molecula formula defining the minimum number of atom counts for a set of elements

maxElements

character(1) with a molecula formula defining the maximum number of atom counts for a set of elements

parity

filter for parity. must be "e" (for even) or "o" (for odd). What to expect depends on ionization technique used.

maxCounts

if TRUE, uses a filter limiting atom counts for elements as described by Kind & Fiehn [1]

SENIOR3

If TRUE, the sum of valences has to be greater than or equal to twice the number of atoms minus 1, as Senior's third theorem suggests [1][2][3]

HCratio

If TRUE, molecular formulas must have a Hydrogen/ Carbon count ratio of >0.2 and <3.1 ("Golden Rule #4")[1]. Will be ignored if no Hydrogen or Carbon present in a molecule.

moreRatios

If TRUE, molecular formulas must have these atom count ratios: Nitrogen/Carbon <1.3, Oxygen/Carbon <1.2, Phosphorus/Carbon <0.3 and Sulfur/Carbon <0.8 ("Golden Rule #5")[1]. Will be ignored if no Carbon present in a molecule.

elementHeuristic

If TRUE, additional element ratio heuristic is applied ("Golden Rule #6") [1]

Value

a data.frame (or list of data.frames if multiple mz values are supplied) with molecular formulas generated with decomposeMass() with additional information and optionally filtered as described. NOTE: If summarize = TRUE, results for each query mz value are summarized in a single character string with all molecular formulas matching filter criteria

References

  1. Kind T, Fiehn O (2007) Seven Golden Rules for heuristic filtering of molecular formulas obtained by accurate mass spectrometry. BMC Bioinformatics 8:105. doi: 10.1186/1471-2105-8-105

  2. Senior JK (1951) Partitions and Their Representative Graphs. Am J Math 73:663. doi: 10.2307/2372318

  3. Morikawa T, Newbold BT (2003) Analogous odd-even parities in mathematics and chemistry. Chemistry 12:445–450

Examples

1
calcMF(mz = 200.000659, z = 1, ppm = 5)

mjhelf/MassTools documentation built on Nov. 19, 2021, 2:38 a.m.