updateRowDataCol: Updating contents of 'rowData' of 'SummarizedExperiment'...

View source: R/updateRowDataCol.R

updateRowDataColR Documentation

Updating contents of rowData of SummarizedExperiment objects

Description

Updates the values in a single column of the rowData of SummarizedExperiment objects.

Usage

updateRowDataCol(x,  updateCol, value)

Arguments

x

Object of type SummarizedExperiment.

updateCol

Name or the number of the column in the rowData of x to be updated with the new values. if the updateCol does not match to any column names it will be added as a new column.

value

The new Replacing values.

Value

Returns an object of type SummarizedExperiment.

Author(s)

Ali Oghabian

See Also

annotateU12

Examples


test<- mdsChr22Obj
# See the the frequency of each intron type annotation
table(rowData(test)$intron_type)

#Change U2 to u2
newIntType<- as.character(rowData(test)$intron_type)
newIntType[newIntType=="U2" & 
	!is.na(newIntType=="U2")]<- "u2"
#Updating values
test<- updateRowDataCol(test, updateCol="intron_type", 
	value=newIntType)
#See the frequency of the updated intron type annotations
table(rowData(test)$intron_type)

#Adding a new column
test<- updateRowDataCol(test, updateCol="new_column", 
	value=rep(NA, nrow(rowData(test))) )
head(rowData(test))


gacatag/IntEREst documentation built on July 29, 2024, 1:12 a.m.