getMID: getMID.

View source: R/getMID.R

getMIDR Documentation

getMID.

Description

getMID will determine the measurable isotopic spectrum for a chemical formula.

Usage

getMID(
  fml,
  resolution = 20000,
  cutoff = 1e-04,
  isotopes = NULL,
  prec = 4,
  step = 0
)

Arguments

fml

Chemical formula.

resolution

Currently fixed to 20000 (might be made changable in the future).

cutoff

Discard peaks below this threshold (relative to highest peak).

isotopes

Specify explicitly or keep NULL to use internally provided list.

prec

Rounding precision of returned mz and int values.

step

Can be used to return intermediate results (might be deprecated in the future).

Details

The computation yields similar results that would be obtained by packages 'Rdisop' or 'enviPat' but is completely in R (no C++ dependencies). However, it is approx. 7-fold slower than 'Rdisop'. Where processing speed is of importance, please use the 'algo' parameter of the 'CorMID' function.

Value

A two column matrix for mz and int values of the calculated spectrum.

Examples

fml <- "C3H7Cl1"
getMID(fml)
## Not run: 
bench::mark(
 CorMID = dim(getMID(fml, prec=5)),
 Rdisop = dim(round(t(Rdisop::getMolecule(fml)$isotopes[[1]])[1:4,],5))
)

## End(Not run)

## Not run: 
data(chemforms, package = "enviPat")
chemforms <- chemforms[-grep("[[]", chemforms)]
bench::mark(
 CorMID = length(lapply(chemforms, getMID)),
 Rdisop = length(lapply(chemforms, Rdisop::getMolecule))
)

## End(Not run)

CorMID documentation built on Oct. 2, 2024, 5:06 p.m.