6.5 Advanced

6.5.1 Initiating a sets workflow from feature groups

The makeSet function can also be used to initiate a sets workflow from feature groups:

# as before ...
anaInfoPos <- patRoonData::exampleAnalysisInfo("positive")
anaInfoNeg <- patRoonData::exampleAnalysisInfo("negative")
fListPos <- findFeatures(anaInfoPos, "openms")
fListNeg <- findFeatures(anaInfoNeg, "openms")

fGroupsPos <- groupFeatures(fListPos, "openms")
fGroupsNeg <- groupFeatures(fListNeg, "openms")

fGroups <- makeSet(fGroupsPos, fGroupsNeg, groupAlgo = "openms",
                   adducts = c("[M+H]+", "[M-H]-"))

# do rest of the workflow...

In this case makeSet takes the positive and negative features, neutralizes them and creates new feature groups by grouping the original set specific groups (with the algorithm specified by groupAlgo).

While this option involves some extra steps, an advantage is that allows processing the feature data before they are combined, e.g.:

fGroupsPos <- groupFeatures(fListPos, "openms")
fGroupsNeg <- groupFeatures(fListNeg, "openms")

# apply intensity theshold filters. Lower threshold for negative.
fGroupsPos <- filter(fGroupsPos, absMinIntensity = 1E4)
fGroupsNeg <- filter(fGroupsNeg, absMinIntensity = 1E3)

fGroups <- makeSet(fGroupsPos, fGroupsNeg, groupAlgo = "openms",
                   adducts = c("[M+H]+", "[M-H]-"))

Visually, this workflow looks like this:

Of course, any other processing steps on the feature groups data such as subsetting and visually checking features are also possible before the sets workflow is initiated. Furthermore, it is also possible to perform adduct annotations prior to grouping, which is an alternative way to improve neutralization to what was discussed before.

6.5.2 Inspecting and converting set objects

The following generic functions may be used to inspect or convert data from sets workflows:

Generic Purpose Notes
sets Return the names of the sets in this object.
setObjects Obtain the raw data objects that were used to construct this object. Not available for features and feature groups.
unset Converts this object to a regular workflow object. The set argument must be given to specify which of the set data is to be converted. This function will restore the original m/z values of features.

These methods are heavily used internally, but rarely needed otherwise. More details can be found in the reference manual.