transformData: Transform the original data in a ClusterExperiment object

transformDataR Documentation

Transform the original data in a ClusterExperiment object

Description

Provides the transformed data

Usage

## S4 method for signature 'matrixOrHDF5'
transformData(object, transFun = NULL, isCount = FALSE)

## S4 method for signature 'ClusterExperiment'
transformData(object, whichAssay = 1, ...)

## S4 method for signature 'SingleCellExperiment'
transformData(object, whichAssay = 1, ...)

## S4 method for signature 'SummarizedExperiment'
transformData(object, ...)

Arguments

object

a matrix, SummarizedExperiment, SingleCellExperiment or ClusterExperiment object.

transFun

a transformation function to be applied to the data. If the transformation applied to the data creates an error or NA values, then the function will throw an error. If object is of class ClusterExperiment, the stored transformation will be used and giving this parameter will result in an error.

isCount

if transFun=NULL, then isCount=TRUE will determine the transformation as defined by function(x){log2(x+1)}, and isCount=FALSE will give a transformation function function(x){x}. Ignored if transFun=NULL. If object is of class ClusterExperiment, the stored transformation will be used and giving this parameter will result in an error.

whichAssay

numeric or character specifying which assay to use. See assay for details.

...

Values passed on the the 'matrix' method.

Details

The data matrix defined by assay(x) is transformed based on the transformation function either defined in x (in the case of a ClusterExperiment object) or by user given values for other classes.

Value

A DataFrame defined by assay(x) suitably transformed

Examples

mat <- matrix(data=rnorm(200), ncol=10)
mat[1,1] <- -1 #force a negative value
labels <- gl(5, 2)
cc <- ClusterExperiment(mat, as.numeric(labels), transformation =
function(x){x^2}) #define transformation as x^2
z<-transformData(cc)

epurdom/clusterExperiment documentation built on April 28, 2024, 8:17 p.m.