groupTable | R Documentation |
This class holds all the information for grouped features.
groupTable(object, ...)
groupFeatIndex(fGroups)
groupInfo(fGroups)
unique(x, incomparables = FALSE, ...)
overlap(fGroups, which, exclusive = FALSE, ...)
selectIons(fGroups, components, prefAdduct, ...)
groupQualities(fGroups)
groupScores(fGroups)
internalStandards(fGroups)
internalStandardAssignments(fGroups, ...)
normInts(
fGroups,
featNorm = "none",
groupNorm = FALSE,
normFunc = max,
standards = NULL,
ISTDRTWindow = 120,
ISTDMZWindow = 300,
minISTDs = 3,
...
)
## S4 method for signature 'featureGroups'
names(x)
## S4 method for signature 'featureGroups'
analyses(obj)
## S4 method for signature 'featureGroups'
replicateGroups(obj)
## S4 method for signature 'featureGroups'
groupNames(obj)
## S4 method for signature 'featureGroups'
length(x)
## S4 method for signature 'featureGroups'
show(object)
## S4 method for signature 'featureGroups'
groupTable(object, areas = FALSE, normalized = FALSE)
## S4 method for signature 'featureGroups'
analysisInfo(obj)
## S4 method for signature 'featureGroups'
groupInfo(fGroups)
## S4 method for signature 'featureGroups'
featureTable(obj)
## S4 method for signature 'featureGroups'
getFeatures(obj)
## S4 method for signature 'featureGroups'
groupFeatIndex(fGroups)
## S4 method for signature 'featureGroups'
groupQualities(fGroups)
## S4 method for signature 'featureGroups'
groupScores(fGroups)
## S4 method for signature 'featureGroups'
annotations(obj)
## S4 method for signature 'featureGroups'
internalStandards(fGroups)
## S4 method for signature 'featureGroups'
internalStandardAssignments(fGroups)
## S4 method for signature 'featureGroups'
adducts(obj)
## S4 replacement method for signature 'featureGroups'
adducts(obj) <- value
## S4 method for signature 'featureGroups'
concentrations(fGroups)
## S4 method for signature 'featureGroups'
toxicities(fGroups)
## S4 method for signature 'featureGroups,ANY,ANY,missing'
x[i, j, ..., rGroups, results, drop = TRUE]
## S4 method for signature 'featureGroups,ANY,ANY'
x[[i, j]]
## S4 method for signature 'featureGroups'
x$name
## S4 method for signature 'featureGroups'
delete(obj, i = NULL, j = NULL, ...)
## S4 method for signature 'featureGroups'
export(obj, type, out)
## S4 method for signature 'featureGroups'
as.data.table(
x,
average = FALSE,
areas = FALSE,
features = FALSE,
qualities = FALSE,
regression = FALSE,
averageFunc = mean,
normalized = FALSE,
FCParams = NULL,
concAggrParams = getDefPredAggrParams(),
toxAggrParams = getDefPredAggrParams(),
normConcToTox = FALSE
)
## S4 method for signature 'featureGroups'
unique(x, which, relativeTo = NULL, outer = FALSE)
## S4 method for signature 'featureGroups'
overlap(fGroups, which, exclusive)
## S4 method for signature 'featureGroups'
calculatePeakQualities(
obj,
weights,
flatnessFactor,
avgFunc = mean,
parallel = TRUE
)
## S4 method for signature 'featureGroups'
selectIons(
fGroups,
components,
prefAdduct,
onlyMonoIso = TRUE,
chargeMismatch = "adduct"
)
## S4 method for signature 'featureGroups'
normInts(
fGroups,
featNorm = "none",
groupNorm = FALSE,
normFunc = max,
standards = NULL,
ISTDRTWindow = 120,
ISTDMZWindow = 300,
minISTDs = 3,
...
)
## S4 method for signature 'featureGroups'
getTICs(obj, retentionRange = NULL, MSLevel = c(1, 2))
## S4 method for signature 'featureGroups'
getBPCs(obj, retentionRange = NULL, MSLevel = c(1, 2))
## S4 method for signature 'featureGroupsSet'
sets(obj)
## S4 method for signature 'featureGroupsSet'
internalStandardAssignments(fGroups, set = NULL)
## S4 method for signature 'featureGroupsSet'
adducts(obj, set, ...)
## S4 replacement method for signature 'featureGroupsSet'
adducts(obj, set, reGroup = TRUE) <- value
## S4 method for signature 'featureGroupsSet'
delete(obj, i = NULL, j = NULL, ...)
## S4 method for signature 'featureGroupsSet'
show(object)
## S4 method for signature 'featureGroupsSet'
featureTable(obj)
## S4 method for signature 'featureGroupsSet,ANY,ANY,missing'
x[i, j, ..., rGroups, sets = NULL, drop = TRUE]
## S4 method for signature 'featureGroupsSet'
export(obj, type, out, set)
## S4 method for signature 'featureGroupsSet'
unique(x, which, ..., sets = FALSE)
## S4 method for signature 'featureGroupsSet'
overlap(fGroups, which, exclusive, sets = FALSE)
## S4 method for signature 'featureGroupsSet'
selectIons(fGroups, components, prefAdduct, ...)
## S4 method for signature 'featureGroupsSet'
normInts(
fGroups,
featNorm = "none",
groupNorm = FALSE,
normFunc = max,
standards = NULL,
ISTDRTWindow = 120,
ISTDMZWindow = 300,
minISTDs = 3,
...
)
## S4 method for signature 'featureGroupsSet'
unset(obj, set)
## S4 method for signature 'featureGroupsKPIC2'
delete(obj, ...)
## S4 method for signature 'featureGroups'
plotTICs(
obj,
retentionRange = NULL,
MSLevel = 1,
retMin = FALSE,
title = NULL,
colourBy = c("none", "analyses", "rGroups"),
showLegend = TRUE,
xlim = NULL,
ylim = NULL,
...
)
## S4 method for signature 'featureGroups'
plotBPCs(
obj,
retentionRange = NULL,
MSLevel = 1,
retMin = FALSE,
title = NULL,
colourBy = c("none", "analyses", "rGroups"),
showLegend = TRUE,
xlim = NULL,
ylim = NULL,
...
)
## S4 method for signature 'featureGroupsXCMS'
delete(obj, ...)
## S4 method for signature 'featureGroupsXCMS3'
delete(obj, ...)
... |
For the For For 1featureGroups |
fGroups , obj , x , object |
|
incomparables |
Ignored. |
which |
A character vector with replicate groups used for comparison. For |
exclusive |
If |
components |
The |
prefAdduct |
The 'preferred adduct' (see method description). This is often |
featNorm |
The method applied for feature normalization: |
groupNorm |
If |
normFunc |
A |
standards |
A Can also be a See the |
ISTDRTWindow , ISTDMZWindow |
The retention time and m/z windows for IS selection. Only used if
|
minISTDs |
The minimum number of IS that should be assigned to each feature (if possible). Only used if
|
areas |
If set to For |
normalized |
If For |
value |
For |
i , j |
For |
rGroups |
For |
results |
Optional argument. If specified only feature groups with results in the specified object are kept. The
class of |
drop |
ignored. |
name |
The feature group name (partially matched). |
type |
The export type: |
out |
The destination file for the exported data. |
average |
If For |
features |
If |
qualities |
Adds feature (group) qualities ( |
regression |
Set to |
averageFunc |
Function used for averaging. Only used when |
FCParams |
A parameter list to calculate Fold change data. See |
concAggrParams , toxAggrParams |
Parameters to aggregate calculated concentrations/toxicities (obtained with
|
normConcToTox |
Set to |
relativeTo |
A character vector with replicate groups that should be
used for unique comparison. If |
outer |
If |
weights |
A named |
flatnessFactor |
Passed to MetaClean as the |
avgFunc |
The function used to average the peak qualities and scores for each feature group. |
parallel |
If set to |
onlyMonoIso |
Set to |
chargeMismatch |
Specifies how to deal with a mismatch in charge between adduct and isotope annotations. Valid
values are: |
retentionRange |
Range of retention time (in seconds) to collect TIC traces. Should be a numeric vector with length of two containing the min/max values. Set to NULL to ignore. |
MSLevel |
Integer vector with the ms levels (i.e., 1 for MS1 and 2 for MS2) to obtain TIC traces. |
set |
\setsWF The name of the set. |
reGroup |
\setsWF Set to |
sets |
\setsWF For For |
retMin |
Plot retention time in minutes (instead of seconds). |
title |
Character string used for title of the plot. If |
colourBy |
Sets the automatic colour selection: "none" for a single colour or "analyses"/"rGroups" for a distinct colour per analysis or analysis replicate group. |
showLegend |
Plot a legend if TRUE. |
xlim , ylim |
Sets the plot size limits used by
|
The featureGroup
class is the workhorse of patRoon: almost all functionality operate on its instantiated
objects. The class holds all information from grouped features (obtained from features
). This class
itself is virtual
, hence, objects are not created directly from it. Instead, 'feature groupers' such as
groupFeaturesXCMS
return a featureGroups
derived object after performing the actual grouping of
features across analyses.
delete
returns the object for which the specified data was removed.
calculatePeakQualities
returns a modified object amended with peak qualities and scores.
selectIons
returns a featureGroups
object with only the selected feature groups and amended
with adduct annotations.
normInts
returns a featureGroups
object, amended with data in the ISTDs
and
ISTDAssignments
slots if featNorm="istd"
.
names(featureGroups)
: Obtain feature group names.
analyses(featureGroups)
: returns a character
vector with the names of the
analyses for which data is present in this object.
replicateGroups(featureGroups)
: returns a character
vector with the names of the
replicate groups for which data is present in this object.
groupNames(featureGroups)
: Same as names
. Provided for consistency to other classes.
length(featureGroups)
: Obtain number of feature groups.
show(featureGroups)
: Shows summary information for this object.
groupTable(featureGroups)
: Accessor for groups
slot.
analysisInfo(featureGroups)
: Obtain analysisInfo (see analysisInfo slot in features
).
groupInfo(featureGroups)
: Accessor for groupInfo
slot.
featureTable(featureGroups)
: Obtain feature information (see features
).
getFeatures(featureGroups)
: Accessor for features
slot.
groupFeatIndex(featureGroups)
: Accessor for ftindex
slot.
groupQualities(featureGroups)
: Accessor for groupQualities
slot.
groupScores(featureGroups)
: Accessor for groupScores
slot.
annotations(featureGroups)
: Accessor for annotations
slot.
internalStandards(featureGroups)
: Accessor for ISTDs
slot.
internalStandardAssignments(featureGroups)
: Accessor for ISTDAssignments
slot.
adducts(featureGroups)
: Returns a named character
with adduct annotations assigned to each feature group (if
available).
adducts(featureGroups) <- value
: Sets adduct annotations for feature groups.
concentrations(featureGroups)
: Accessor for concentrations
slot.
toxicities(featureGroups)
: Accessor for toxicities
slot.
x[i
: Subset on analyses/feature groups.
x[[i
: Extract intensity values.
$
: Extract intensity values for a feature group.
delete(featureGroups)
: Completely deletes specified feature groups.
export(featureGroups)
: Exports feature groups to a ‘.csv’ file that is readable to Bruker ProfileAnalysis (a
'bucket table'), Bruker TASQ (an analyte database) or that is suitable as input for the Targeted peak
detection
functionality of MZmine.
as.data.table(featureGroups)
: Obtain a summary table (a data.table
) with retention, m/z, intensity
and optionally other feature data.
unique(featureGroups)
: Obtain a subset with unique feature groups
present in one or more specified replicate group(s).
overlap(featureGroups)
: Obtain a subset with feature groups that overlap
between a set of specified replicate group(s).
calculatePeakQualities(featureGroups)
: Calculates peak and group qualities for all features and feature groups. The peak qualities
(and scores) are calculated with the features method of this
function, and subsequently averaged per feature group. Then, MetaClean is used to calculate the
Elution Shift
and Retention Time Consistency
group quality metrics (see the MetaClean
publication cited below for more details). Similarly to the features
method, these metrics are scored
by normalizing qualities among all groups and scaling them from ‘0’ (worst) to ‘1’ (best). The
totalScore
for each group is then calculated as the weighted sum from all feature (group) scores. The
getMCTrainData
and predictCheckFeaturesSession
functions can be used to train and apply
Pass/Fail ML models from MetaClean.
selectIons(featureGroups)
: uses componentization results to select feature groups with
preferred adduct ion and/or isotope annotation. Typically, this means that only feature groups are kept if they are
(de-)protonated adducts and are monoisotopic. The adduct annotation assignments for the selected feature groups are
copied from the components to the annotations
slot. If the adduct for a feature group is unknown, its
annotation is defaulted to the 'preferred' adduct, and hence, the feature group will never be removed. Furthermore,
if a component does not contain an annotation with the preferred adduct, the most intense feature group is selected
instead. Similarly, if no isotope annotation is available, the feature group is assumed to be monoisotopic and thus
not removed. An important advantage of selectIons
is that it may considerably simplify your dataset.
Furthermore, the adduct assignments allow formula/compound annotation steps later in the workflow to improve their
annotation accuracy. On the other hand, it is important the componentization results are reliable. Hence, it is
highly recommended that, prior to calling selectIons
, the settings to generateComponents
are
optimized and its results are reviewed with checkComponents
. Finally, the adducts<-
method can
be used to manually correct adduct assignments afterwards if necessary.
normInts(featureGroups)
: Provides various methods to normalizes feature intensities for each sample analysis or of
all features within a feature group. See the Feature intensity normalization
section below.
getTICs(featureGroups)
: Obtain the total ion chromatogram/s (TICs) of the analyses.
getBPCs(featureGroups)
: Obtain the base peak chromatogram/s (BPCs) of the analyses.
plotTICs(featureGroups)
: Plots the total ion chromatogram/s (TICs) of the analyses.
plotBPCs(featureGroups)
: Plots the base peak chromatogram/s (BPCs) of the analyses.
groups
Matrix (data.table
) with intensities for each feature group (columns) per analysis (rows).
Access with groups
method.
analysisInfo,features
Analysis info and features
class associated
with this object. Access with analysisInfo
and featureTable
methods, respectively.
groupInfo
data.frame
with retention time (rts
column, in seconds) and m/z (mzs
column) for each feature group. Access with groupInfo
method.
ftindex
Matrix (data.table
) with feature indices for each feature group (columns) per analysis
(rows). Each index corresponds to the row within the feature table of the analysis (see
featureTable
).
groupQualities,groupScores
A data.table
with qualities/scores for each feature group (see the
calculatePeakQualities
method).
annotations
A data.table
with adduct annotations for each group (see the selectIons
method).
ISTDs
A data.table
with screening results for internal standards (filled in by the normInts
method).
ISTDAssignments
A list
, where each item is named by a feature group and consists of a vector with
feature group names of the internal standards assigned to it (filled in by the normInts
method).
concentrations,toxicities
A data.table
with predicted concentrations/toxicities for each feature group.
Assigned by the calculateConcs
/calculateTox
methods. Use the
concentratrions
/toxicities
methods for access.
groupAlgo,groupArgs,groupVerbose
Grouping parameters that were used when this object was created. Used
by adducts<-
and selectIons
when these methods perform a re-grouping of features.
annotations,ISTDAssignments
As the featureGroups
slots, but contains the data per set.
annotationsChanged
Set internally by adducts()<-
and applied as soon as reGroup=TRUE
.
workflowStep
featureGroups
featureGroupsSet
featureGroupsScreeningSet
featureGroupsUnset
featureGroupsScreening
featureGroupsSetScreeningUnset
featureGroupsBruker
featureGroupsConsensus
featureGroupsEnviMass
featureGroupsKPIC2
featureGroupsOpenMS
featureGroupsSIRIUS
featureGroupsBrukerTASQ
featureGroupsXCMS
featureGroupsXCMS3
The normInts
method performs normalization of feature intensities
(and areas). These values are amended in the features
slot, while the original intensities/areas are kept.
To use the normalized intensities set normalized=TRUE
to methods such as plotInt
,
generateComponentsIntClust
and as.data.table
. Please see the normalized
argument
documentation for these methods for more details.
The normInts
method supports several methods to normalize intensities/areas of features within the same
analysis. Most methods are influenced by the normalization concentration (norm_conc
in the
analysis information) set for each sample analysis. For NA
or zero values the
output will be zero. If the norm_conc
is completely absent from the analysis information, the normalization
concentration is defaulted to one.
The different normalization methods are:
featNorm="istd"
Uses internal standards (IS) for normalization. The IS are screened internally
by the screenSuspects
function. Hence, the IS specified by the standards
argument should
follow the format of a suspect list. Note that labelled elements in IS formulae should
be specified with the rcdk format, e.g. "[13]C"
for 13C, "[2]H"
for a deuterium etc.
Example IS lists are provided with the patRoonData package.
The assignment of IS to features is automatically performed, using the following criteria:
Only analyses are considered with a defined normalization concentration.
The IS must be detected in all of the analyses in which the feature was detected.
The retention time and m/z are reasonably close (ISTDRTWindow
/ISTDMZWindow
arguments).
However, additional IS candidates outside these windows will be chosen if the number of candidates is less than the
minISTDs
argument. In this case the next close(st) candidate(s) will be chosen.
Normalization of features within the same feature group always occur with the same IS. If multiple IS are assigned
to a feature then normalization occurs with the combined intensity (area), which is calculated with the function
defined by the normFunc
argument. The (combined) IS intensity is then normalized by the normalization
concentration, and finally used for feature normalization.
featNorm="tic"
Uses the Total Ion Current (TIC) to normalize intensities. The TIC is calculated by
combining all intensities with the function defined by the normFunc
argument. For this reason, you may need
to take care to perform normalization before e.g. suspect screening or other prioritization techniques. The
TIC normalized intensities are finally divided by the normalization concentration.
featNorm="conc"
Simply divides all intensities (areas) with the normalization concentration defined
for the sample.
featNorm="none"
Performs no normalization. The raw intensity values are simply copied. This is mainly
useful if you only want to do group normalization (described below).
The meaning of the normalization concentration differs for each method: for "istd"
it resembles the IS
concentration of a sample analysis, whereas for "tic"
and "conc"
it is used to normalize different
sample amounts (e.g. injection volume).
If groupNorm=TRUE
then feature intensities (areas) will be normalized by the combined values for its feature
group (again, combination occurs with normFunc
). This group normalization always occurs after
aforementioned normalization methods. Group normalization was the only method with patRoon ‘<2.1’, and
still occurs automatically if normInts
was not called when a method is executed that requests normalized
data.
featureGroupsSetfeatureGroups
\setsWFNewMethodsFeatfeatureGroupsUnsetThe adduct annotations for the selected set are used to convert all feature (group) masses to ionic m/z values. The annotations persist in the converted object.
\setsWFChangedMethods \itemadducts
, adducts<-
require the set
argument. The order of the data that is
returned/changed follows that of the annotations
slot. Furthermore, adducts<-
will perform a
re-grouping of features when its reGroup
parameter is set to TRUE
. The implications for this are
discussed below. Note that no adducts are changed until reGroup=TRUE
.
the subset operator ([
) has specific arguments to choose (feature presence in) sets. See the argument
descriptions.
as.data.table
: normalization of intensities is performed per set.
export
Only allows to export data from one set. The unset
method is used prior to exporting the
data.
overlap
and unique
allow to handle data per set. See the sets
argument description.
selectIons
Will perform a re-grouping of features. The implications of this are discussed below.
normInts
Performs normalization for each set independently.
A re-grouping of features occurs if selectIons
is called or adducts<-
is used with
reGroup=TRUE
. Afterwards, it is very likely that feature group names are changed. Since data generated later
in the workflow (e.g. annotation steps) rely on feature group names, these objects are not valid
anymore, and must be re-generated.
Rick Helmus <r.helmus@uva.nl> and Ricardo Cunha <cunha@iuta.de> (getTICs
and
getBPCs
functions)
Chetnik2020patRoon
groupFeatures
for generating feature groups, feature-filtering and
feature-plotting for more advanced featureGroups
methods.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.