binaryMatrix: Class '"BinaryMatrix"'

BinaryMatrix-classR Documentation

Class "BinaryMatrix"

Description

The BinaryMatrix object class underlies the threshLGF and Mercator methods and visualizations of the Mercator package. The BinaryMatrix function returns a new object of BinaryMatrix class.

Usage

BinaryMatrix(binmat, columnInfo, rowInfo)

Arguments

binmat

A binary matrix of class numeric or integer with values 0 and 1.

columnInfo

A data.frame of at least one column containing column names. If no colnames are specified, the column names associated with the data matrix will be used.

rowInfo

A dataframe of at least one column containing row names. If no rownames are specified, the row names associated with the data matrix will be used.

Value

The BinaryMatrix function returns a new object of binaryMatrix class.

Objects from the Class

Objects should be defined using the BinaryMatrix constructor. In the simplest case, you simply pass in the binary data matrix that you want to visualize, and the BinaryMatrix is constructed using the matrix's existing column and row names.

Slots

binmat:

Object of class matrix; the binary data used for visualization.

columnInfo:

Object of class data.frame; names and definitions of columns.

rowInfo:

Object of class data.frame; names and definitions of rows.

info:

Object of class list; identifies $notUsed and $redundant features.

history:

Object of class "character"; returns a history of manipulations by Mercator functions to the BinaryMatrix object, including "Newly created," "Subsetted," "Transposed," "Duplicate features removed," and "Threshed."

Methods

[]:

Subsetting by [] returns a subsetted binary matrix, including subsetted row and column names. Calling @history will return the history "Subsetted."

dim:

returns the dimensions of the @binmat component of the binaryMatrix object.

print:

Shows the first ten rows and columns of the @binmat component.

show:

Shows the first ten rows and columns of the @binmat component.

summary:

For a given BinaryMatrix, returns object class, dimensions of the @binmat component, and @history.

t:

Transposes the @binmat and its associated rowInfo and columnInfo. Calling @history will return the history "Subsetted."

Note

Attempting to construct or manipulate a BinaryMatrix containing NAs, missing values, or columns containing exclusively 0 values may introduce error.

Author(s)

Kevin R. Coombes <krc@silicovore.com>, Caitlin E. Coombes

See Also

The removeDuplicateFeatures function can be used to remove duplicate columns from the binaryMatrix class before threshing or visualization. The threshLGF can be used to identify and remove uninformative features before visualization or further analysis.

Examples

my.matrix <- matrix(rbinom(50*100, 1, 0.15), ncol=50)
my.rows <- as.data.frame(paste("R", 1:100, sep=""))
my.cols <- as.data.frame(paste("C", 1:50, sep=""))
my.binmat <- BinaryMatrix(my.matrix, my.cols, my.rows)
summary(my.binmat)
my.binmat <- my.binmat[1:50, 1:30]
my.binmat <- t(my.binmat)
dim(my.binmat)
my.binmat@history
my.binmat

Mercator documentation built on May 29, 2024, 1:41 a.m.