| BinaryMatrix-class {Mercator} | R 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 |
columnInfo |
A |
rowInfo |
A |
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$notUsedand$redundantfeatures.history:Object of class
"character"; returns a history of manipulations byMercatorfunctions to theBinaryMatrixobject, 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@historywill return the history "Subsetted."dim:returns the dimensions of the
@binmatcomponent of thebinaryMatrixobject.print:Shows the first ten rows and columns of the
@binmatcomponent.show:Shows the first ten rows and columns of the
@binmatcomponent.summary:For a given
BinaryMatrix, returns object class, dimensions of the@binmatcomponent, and@history.t:Transposes the
@binmatand its associatedrowInfoandcolumnInfo. Calling@historywill 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