eclust (version 0.1.0)

plot.eclust: Plot Heatmap of Cluster Summaries by Exposure Status

Description

Plots cluster summaries such as the 1st principal component or average by exposure status. This is a plot method for object of class eclust returned by the r_cluster_data function. Two heatmaps, side-by-side are returned, where the first heatmap corresponds to the unexposed subjects and the second heatmap corresponds to the exposed subjects.

Usage

"plot"(x, type = c("ECLUST", "CLUST"), summary = c("pc", "avg"), sample = c("training", "test"), unexposed_title = "E=0", exposed_title = "E=1", ...)

Arguments

x
object of class eclust, which is returned by the r_cluster_data function
type
show results from the "ECLUST" (which considers the environment) or "CLUST" (which ignores the environment) methods. Default is "ECLUST". See r_cluster_data for details. This function uses the clustersAddon object for "ECLUST" and the clustersAll for "CLUST"
summary
show the 1st principal component or the average of each cluster. Default is "pc".
sample
which sample to show, the "training" or the "test" set. Default is "training". This is determined by the train_index and test_index arguments in the r_cluster_data function. If you want to show all subjects, then provide the numeric vector 1:n to either argument, where n is the entire sample size.
unexposed_title
The title for the unexposed subjects heatmap. Default is "E=0".
exposed_title
The title for the exposed subjects heatmap. Default is "E=1".
...
other arguments passed to the Heatmap function

Value

a plot of two Heatmaps, side-by-side, of the cluster summaries by exposure status

Details

Rows are the cluster summaries and columns are the subjects. This function determines the minimum and maximum value for the whole dataset and then creates a color scale using those values with the colorRamp2. This is so that both heatmaps are on the same color scale, i.e., each color represents the same value in both heatmaps. This is done for being able to visually compare the results.

Examples

Run this code
## Not run: 
# data("tcgaov")
# tcgaov[1:5,1:6, with = FALSE]
# Y <- log(tcgaov[["OS"]])
# E <- tcgaov[["E"]]
# genes <- as.matrix(tcgaov[,-c("OS","rn","subtype","E","status"),with = FALSE])
# trainIndex <- drop(caret::createDataPartition(Y, p = 1, list = FALSE, times = 1))
# testIndex <- setdiff(seq_len(length(Y)),trainIndex)
# 
# cluster_res <- r_cluster_data(data = genes,
#                               response = Y,
#                               exposure = E,
#                               train_index = trainIndex,
#                               test_index = testIndex,
#                               cluster_distance = "tom",
#                               eclust_distance = "difftom",
#                               measure_distance = "euclidean",
#                               clustMethod = "hclust",
#                               cutMethod = "dynamic",
#                               method = "average",
#                               nPC = 1,
#                               minimum_cluster_size = 60)
# 
# class(cluster_res)
# 
# plot(cluster_res, show_column_names = FALSE)
# ## End(Not run)

Run the code above in your browser using DataLab