Generate formula with Bruker DataAnalysis
Source:R/generics.R, R/deprecated-formulas-bruker.R
generateFormulasDA.RdUses Bruker DataAnalysis to generate chemical formulae.
Usage
generateFormulasDA(fGroups, ...)
# S4 method for class 'featureGroups'
generateFormulasDA(
fGroups,
MSPeakLists,
specSimParams = getDefSpecSimParams(removePrecursor = TRUE),
precursorMzSearchWindow = defaultLim("mz", "narrow"),
MSMode = "both",
adduct = NULL,
featThreshold = 0,
featThresholdAnn = 0.75,
absAlignMzDev = defaultLim("mz", "narrow"),
save = TRUE,
close = save
)
# S4 method for class 'featureGroupsSet'
generateFormulasDA(
fGroups,
MSPeakLists,
specSimParams = getDefSpecSimParams(removePrecursor = TRUE),
precursorMzSearchWindow = defaultLim("mz", "narrow"),
MSMode = "both",
adduct = NULL,
...,
setThreshold = 0,
setThresholdAnn = 0,
setAvgSpecificScores = FALSE
)Arguments
- fGroups
featureGroupsobject for which formulae should be generated. This should be the same or a subset of the object that was used to create the specifiedMSPeakLists. In the case of a subset only the remaining feature groups in the subset are considered.- ...
(sets workflow) Further arguments passed to the non-sets workflow method.
- MSPeakLists
An
MSPeakListsobject that was generated for the suppliedfGroups.- specSimParams
A named
listwith parameters that influence the calculation of the annotation similarity. See the spectral similarity parameters documentation for more details.- precursorMzSearchWindow
Search window for m/z values (+/- the feature m/z) used to find back feature data of precursor/parent ions from MS/MS spectra (this data is not readily available from
SmartFormula3Dresults).- MSMode
Whether formulae should be generated only from MS data (
"ms"), MS/MS data ("msms") or both ("both"). Selecting "both" will calculate formulae from MS data and MS/MS data and combines the results (duplicated formulae are removed). This is useful when poor MS/MS data would exclude proper candidates.- adduct
An
adductobject (or something that can be converted to it withas.adduct). Examples:"[M-H]-","[M+Na]+". If thefeatureGroupsobject has adduct annotations then these are used ifadducts=NULL.(sets workflow) The
adductargument is not supported for sets workflows, since the adduct annotations will then always be used.- featThreshold
If
calculateFeatures=TRUE: minimum presence (0-1) of a formula in all features before it is considered as a candidate for a feature group. For instance,featThreshold=0.75dictates that a formula should be present in at least 75% of the features inside a feature group.- featThresholdAnn
As
featThreshold, but only considers features with annotations. For instance,featThresholdAnn=0.75dictates that a formula should be present in at least 75% of the features with annotations inside a feature group.- absAlignMzDev
When the group formula annotation consensus is made from feature annotations, the m/z values of annotated MS/MS fragments may slightly deviate from those of the corresponding group MS/MS peak list. The
absAlignMzDevargument specifies the maximum m/z window used to re-align the mass peaks.- close, save
If
TRUEthen Bruker files are closed and saved after processing with DataAnalysis, respectively. Settingclose=TRUEprevents that many analyses might be opened simultaneously in DataAnalysis, which otherwise may use excessive memory or become slow. By defaultsaveisTRUEwhencloseisTRUE, which is likely what you want as otherwise any processed data is lost.- setThreshold
(sets workflow) Minimum abundance for a candidate among all sets (0-1). For instance, a value of 1 means that the candidate needs to be present in all the set data.
- setThresholdAnn
(sets workflow) As
setThreshold, but only taking into account the set data that contain annotations for the feature group of the candidate.- setAvgSpecificScores
(sets workflow) If
TRUEthen set specific scorings (e.g. MS/MS match) are also averaged.
Value
A formulas object containing all generated formulae.
Details
This function uses bruker to generate formula candidates. This function is called when calling generateFormulas with
algorithm="bruker".
This method supports scoring based on overlap between measured and theoretical isotopic patterns (both MS
and MS/MS data) and the presence of 'fitting' MS/MS fragments. The method will iterate through all features (or
"Compounds" in DataAnalysis terms) and call SmartFormula (and SmartFormula3D if MS/MS data is
available) to generate all formulae. Parameters affecting formula calculation have to be set in advance within the
DataAnalysis method for each analysis (e.g. by setDAMethod).
This method requires that features were obtained with findFeaturesBruker. It is recommended, but not
mandatory, that the MSPeakLists are also generated by DataAnalysis.
Calculation of formulae with DataAnalysis always occurs with the 'feature approach' (see Candidate
assignment in generateFormulas).
Note
If any errors related to DCOM appear it might be necessary to
terminate DataAnalysis (note that DataAnalysis might still be running as a
background process). The ProcessCleaner application installed
with DataAnalayis can be used for this.
See also
generateFormulas for more details and other algorithms.