addAnnotation: Adding sample annotations to a 'SummarizedExperiment' object

View source: R/classes.R

addAnnotationR Documentation

Adding sample annotations to a SummarizedExperiment object

Description

Adds a new sample annotation to the SummarizedExperiment object. In other words it adds and column with sample annotations to the colData of the SummarizedExperiment object.

Usage

addAnnotation(x, sampleAnnotationType, sampleAnnotation)

Arguments

x

Object of type SummarizedExperiment.

sampleAnnotationType

The name of the new column to be added to the colData table of SummarizedExperiment object.

sampleAnnotation

Vector with the same length as the row-size of the colData attribute of the SummarizedExperiment object, which includes the sample annotations.

Value

An InterestResult object.

Author(s)

Ali Oghabian

See Also

getAnnotation

Examples

# Check the annotation table of mdsChr22Obj data
getAnnotation(mdsChr22Obj)

# Add a new sample annotation
newMdsChr22Obj <- addAnnotation(x=mdsChr22Obj,
	sampleAnnotationType="sample_number",
	sampleAnnotation=1:16
)

# Retrieve annotations of the new object
getAnnotation(newMdsChr22Obj)


gacatag/IntEREst documentation built on Aug. 20, 2023, 6:06 p.m.