featureGroups: Get or set feature group definitions from an object

featureGroupsR Documentation

Get or set feature group definitions from an object

Description

featureGroups and ⁠featureGroups<-⁠ allow to extract or set the feature definitions from the input object. The implementations for SummarizedExperiment() get or set the content of a column named "feature_group" in the object's rowData.

This method should be implemented for all other object for which a groupFeatures() method is defined.

Usage

featureGroups(object, ...)

featureGroups(object) <- value

## S4 method for signature 'SummarizedExperiment'
featureGroups(object)

## S4 replacement method for signature 'SummarizedExperiment'
featureGroups(object) <- value

Arguments

object

the input object. In the MsFeatures package this method is implemented for SummarizedExperiment.

...

ignored.

value

the new value for the feature groups variable.

Value

a character with the group assignment of the features. Has to have the same length as there are features in object.

Author(s)

Johannes Rainer

Examples


## Load the test SummarizedExperiment
library(SummarizedExperiment)
data(se)

## No column "feature_group" present in the object, this NA is returned
featureGroups(se)

## Add a column "feature_group" to the `rowData` of the object
rowData(se)$feature_group <- seq_len(nrow(rowData(se)))

featureGroups(se)

rformassspectrometry/MsFeatures documentation built on April 21, 2023, 6:20 a.m.