featureValues,XCMSnExp-method {xcms} | R Documentation

## Accessing mz-rt feature data values

### Description

`featureValues,XCMSnExp` : extract a `matrix` for feature values with rows representing features and columns samples. Parameter `value` allows to define which column from the `chromPeaks` matrix should be returned. Multiple chromatographic peaks from the same sample can be assigned to a feature. Parameter `method` allows to specify the method to be used in such cases to chose from which of the peaks the value should be returned.

### Usage

    ## S4 method for signature 'XCMSnExp'
    featureValues(object, method = c("medret", "maxint"),
      value = "index", intensity = "into", filled = TRUE)

### Arguments

`object` | A `XCMSnExp` object providing the feature definitions.
`method` | `character` specifying the method to resolve multi-peak mappings within the same sample, i.e. to define the representative peak for a feature in samples where more than one peak was assigned to the feature. If `"medret"`: select the peak closest to the median retention time of the feature. If `"maxint"`: select the peak yielding the largest signal.
`value` | `character` specifying the name of the column in `chromPeaks(object)` that should be returned or `"index"` (the default) to return the index of the peak in the `chromPeaks(object)` matrix corresponding to the representative peak for the feature in the respective sample.
`intensity` | `character` specifying the name of the column in the `chromPeaks(objects)` matrix containing the intensity value of the peak that should be used for the conflict resolution if `method = "maxint"`.
`filled` | `logical(1)` specifying whether values for filled-in peaks should be returned or not. If `filled = FALSE`, an `NA` is returned in the matrix for the respective peak. See `fillChromPeaks` for details on peak filling.

### Value

For `featureValues`: a `matrix` with feature values, columns representing samples, rows features. The order of the features matches the order found in the `featureDefinitions(object)` `DataFrame`. The rownames of the `matrix` are the same than those of the `featureDefinitions` `DataFrame`. `NA` is reported for features without corresponding chromatographic peak in the respective sample(s).

### Note

This method is equivalent to the `groupval` for `xcmsSet` objects.

### Author(s)

Johannes Rainer

### See Also

`XCMSnExp` for information on the data object. `featureDefinitions` to extract the `DataFrame` with the feature definitions. `hasFeatures` to evaluate whether the `XCMSnExp` provides feature definitions. `groupval` for the equivalent method on `xcmsSet` objects.

[Package xcms version 3.0.2 Index]