8.6 Algorithm consensus
With patRoon
you have the option to choose between several algorithms for most workflow steps. Each algorithm is typically characterized by its efficiency, robustness, and may be optimized towards certain data properties. Comparing their output is therefore advantageous in order to design an optimum workflow. The consensus()
generic function will compare different results from different algorithms and returns a consensus, which may be based on minimal overlap, uniqueness or simply a combination of all results from involved objects. The output from the consensus()
function is of similar type as the input types and is therefore compatible to any ‘regular’ further data processing operations (e.g. input for other workflow steps or plotting). Note that a consensus can also be made from objects generated by the same algorithm, for instance, to compare or combine results obtained with different parameters (e.g. different databases used for compound annotation).
The consensus()
generic is defined for most workflow objects. Some of its common function arguments are listed below.
Argument | Classes | Remarks |
---|---|---|
obj , ... |
All | Two or more objects (of the same type) that should be compared to generate the consensus. |
compThreshold , relAbundance , absAbundance , formThreshold |
compounds , formulas , featureGroupsComparison |
The minimum overlap (relative/absolute) for a result (feature, candidate) to be kept. |
uniqueFrom |
compounds , formulas , transformationProductsStructure , featureGroupsComparison |
Only keep unique results from specified objects. |
uniqueOuter |
compounds , formulas , transformationProductsStructure , featureGroupsComparison |
Should be combined with uniqueFrom . If TRUE then only results are kept which are also unique between the objects specified with uniqueFrom . |
Note that current support for generating a consensus between components
objects is very simplistic; here results are not compared, but the consensus simply consists a combination of all the components from each object.
Generating a consensus for feature groups involves first generating a featureGroupsComparison
object. This step is necessary since (small) deviations between retention times and/or mass values reported by different feature finding/grouping algorithms complicates a direct comparison. The comparison objects are made by the comparison()
function, and its results can be visualized by the plotting functions discussed in the previous chapter.
Some examples are shown below
compoundsCons <- consensus(compoundsMF, compoundsSIR) # combine MetFrag/SIRIUS results
compoundsCons <- consensus(compoundsMF, compoundsSIR,
compThreshold = 1) # only keep results that overlap
TPsCons <- consensus(TPsLib, TPsBT) # combine library and BioTransformer TPs
fGroupComp <- comparison(fGroupsXCMS, fGroupsOpenMS, fGroupsEnviPick,
groupAlgo = "openms")
plotVenn(fGroupComp) # visualize overlap/uniqueness
fGroupsCons <- consensus(fGroupComp,
uniqueFrom = 1:2) # only keep results unique in OpenMS+XCMS
fGroupsCons <- consensus(fGroupComp,
uniqueFrom = 1:2,
uniqueOuter = TRUE) # as above, but also exclude any overlap between OpenMS/XCMS