getMID | R Documentation |
getMID
will determine the measurable isotopic
spectrum for a chemical formula.
getMID(
fml,
resolution = 20000,
cutoff = 1e-04,
isotopes = NULL,
prec = 4,
step = 0
)
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). |
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.
A two column matrix for mz and int values of the calculated spectrum.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.