Learn R Programming

MAST (version 0.931)

addlayer: Layer management methods

Description

A layer is a "slice" of a 3d array. SingleCellAssay objects are stateful, in that a layer can be set, and then various routines will operate on that layer.

Usage

addlayer(x, name)

# S4 method for DataLayer,character addlayer(x, name)

# S4 method for DataLayer layername(x)

# S4 method for DataLayer,character layername(x) <- value

# S4 method for DataLayer nlayer(x)

# S4 method for DataLayer layer(x)

# S4 method for DataLayer,numeric layer(x) <- value

# S4 method for DataLayer,character layer(x) <- value

Arguments

x

a SingleCellAssay or derived

name

a code character

value

replacement

Details

addlayer(x): add a new layer with name name. Returns a modified object.

layername(x): Return name of current layer, equivalent to layer(x).

layername(x)<-value: Rename current layer to character value

nlayer(x): Return the number of layers.

codelayer(x): Return the current layer.

codelayer(x)<-value: Change the current layer (by integer or character value)

Examples

Run this code
# NOT RUN {
data(vbetaFA)
vbetaFA <- addlayer(vbetaFA, 'expressed')
layername(vbetaFA)
ee <- exprs(vbetaFA)
layer(vbetaFA) <- 'expressed'
exprs(vbetaFA) <- (ee>0)*1
layer(vbetaFA) <- 'Et'
layername(vbetaFA) <- 'et'
layername(vbetaFA)
nlayer(vbetaFA)
# }

Run the code above in your browser using DataLab