plot.similarity {eclust} | R Documentation |
Function to generate heatmap
Description
Plots a heatmap of a similarity matrix such as a correlation
matrix or a TOM matrix. This function is a plotting method for an object of
class similarity. These objects are returned by the
s_generate_data
and s_generate_data_mars
functions
Usage
## S3 method for class 'similarity'
plot(x, color = viridis::viridis(100), truemodule,
active, ...)
Arguments
x |
an object of class similarity. This is a p x p symmetric matix such as a correlation matrix or a TOM matrix, where p is the number of genes |
color |
colors for the heatmap. By default it uses the |
truemodule |
a numeric vector of length p where p is the number of genes, giving the module membership. By default, 0 = Grey, 1 = Turquoise, 2 = Blue, 3 = Red, 4 = Green, and 5 = Yellow. This information is used for annotating the heatmap |
active |
a binary vector of length p (where p is the number of genes) where 0 means that gene is not related to the response, and 1 means that the gene is associated to the response. |
... |
other arguments passed to the pheatmap function |
Value
a heatmap of a similarity matrix
Note
this function is only meant to be used with output from the
s_generate_data
and s_generate_data_mars
functions, since it assumes a fixed number of modules.
Examples
## Not run:
corrX <- cor(simdata[,c(-1,-2)])
class(corrX) <- append(class(corrX), "similarity")
plot(corrX, truemodule = c(rep(1:5, each=150), rep(0, 250)))
## End(Not run)