Learn R Programming

MAST (version 0.931)

DataLayer-class: DataLayer class

Description

DataLayer is a 3-D array, wrapped to make it look like a matrix. It is used to hold matrix-like expression data, for which we might want to keep several representations (transformations) around. The number of matrix "layers" is given by the trailing dimension. Dimensions 1 and 2 correspond to the "rows" and "columns" of the matrix. The layer that is active can be set, and additional layers created (concatenated).

Arguments

Slots

DataLayer extends array, and has the following additional slots

.Data

the underlying array

valid

a logical that may optionally indicate the freshness of derived layers (if the underlying data changes). Not currently used.

layer

which 'slice' of the array is being used

Methods

addlayer

Concatentate another slice onto the object

layername

Return the name of the current slice

layer

Return the active layer

layer<-

Set the active layer

exprs

Return the matrix representation of the active layer

exprs<-

Replace the matrix on the current layer.

See Also

SingleCellAssay, SingleCellAssay-class

Examples

Run this code
# NOT RUN {
ar <- array(1:10, dim=c(2, 5, 1))
dl <- new('DataLayer', .Data=ar)
nrow(dl) #2
ncol(dl) #5
layer(dl)
dl <- addlayer(dl, 'negative')
ex <- exprs(dl)
layer(dl) <- 'negative' #or could use 2
exprs(dl)<- -ex
exprs(dl)
# }

Run the code above in your browser using DataLab