View source: R/TP-library_formula.R
genFormulaTPLibrary | R Documentation |
Functionality to automatically generate a TP library with formula data from a set of transformation rules, which can
be used with generateTPsLibraryFormula
. TP calculation will be skipped if the transformation involves
subtraction of elements not present in the parent.
genFormulaTPLibrary(
parents,
transformations = NULL,
minMass = 40,
generations = 1,
skipInvalid = TRUE,
prefCalcChemProps = TRUE,
neutralChemProps = FALSE
)
parents |
The parents to which the given transformation rules should be used to generate the TP library. Should
be either a suspect list (see suspect screening for more information) or the resulting
output of |
transformations |
A |
minMass |
The minimum mass for a TP to be kept. |
generations |
An |
skipInvalid |
Set to |
prefCalcChemProps |
If |
neutralChemProps |
If |
A data.table
that is suitable for the TPLibrary
argument to
generateTPsLibraryFormula
.
The transformations
argument specifies custom rules to calculate
transformation products. This should be a data.frame
with the following columns:
transformation
The name of the chemical transformation
add
The elements that are added by this reaction (e.g. "O"
).
sub
The elements that are removed by this reaction (e.g. "H2O"
).
retDir
The expected retention time direction relative to the parent (assuming a reversed phase like LC
separation). Valid values are: ‘-1’ (elutes before the parent), ‘1’ (elutes after the parent) or ‘0’
(no significant change or unknown).
The algorithms using transformation reactions are directly based on the work done by Schollee et al. (see references).
Chemical properties such as SMILES, InChIKey and formula in the parent suspect list are automatically validated and calculated if missing/invalid.
The internal validation/calculation process performs the following steps:
Validation of SMILES, InChI, InChIKey and formula data (if present). Invalid
entries will be set to NA
.
If neutralChemProps=TRUE
then chemical data (SMILES, formulae etc.) is neutralized by
(de-)protonation (using the --neutralized
option of OpenBabel
). An additional column
molNeutralized
is added to mark those molecules that were neutralized. Note that neutralization requires
either SMILES or InChI data to be available.
The SMILES and InChI data are used to calculate missing or invalid SMILES,
InChI, InChIKey and formula data. If prefCalcChemProps=TRUE
then existing
InChIKey and formula data is overwritten by calculated values whenever possible.
The chemical formulae which were not calculated are verified and normalized. This process may be time
consuming, and is potentially largely avoided by setting prefCalcChemProps=TRUE
.
Neutral masses are calculated for missing values (prefCalcChemProps=FALSE
) or whenever possible
(prefCalcChemProps=TRUE
).
Note that calculation of formulae for molecules that are isotopically labelled is currently only supported for deuterium (2H) elements.
This functionality relies heavily on OpenBabel, please make sure it is installed.
Scholle2015patRoon
\insertRefOBoyle2011patRoon
generateTPsLibraryFormula
and generateTPsLogic
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.