add_iheatmap
# S4 method for IheatmapHorizontal,matrix
add_iheatmap(
p,
data,
x = default_x(data),
cluster_cols = c("none", "hclust", "kmeans", "groups"),
col_clusters = NULL,
col_k = NULL,
col_clust_dist = stats::dist,
name = "Signal",
scale = c("none", "rows", "cols"),
scale_method = c("standardize", "center", "normalize"),
colors = NULL,
col_clusters_colors = NULL,
col_clusters_name = "Col
Clusters",
show_col_clusters_colorbar = TRUE,
row_annotation = NULL,
col_annotation = NULL,
row_annotation_colors = NULL,
col_annotation_colors = NULL,
row_labels = NULL,
col_labels = NULL,
row_title = NULL,
col_title = NULL,
buffer = 0.2,
...
)# S4 method for IheatmapVertical,matrix
add_iheatmap(
p,
data,
y = default_y(data),
cluster_rows = c("none", "hclust", "kmeans", "groups"),
row_clusters = NULL,
row_k = NULL,
row_clust_dist = stats::dist,
name = "Signal",
scale = c("none", "rows", "cols"),
scale_method = c("standardize", "center", "normalize"),
colors = NULL,
row_clusters_colors = NULL,
row_clusters_name = "Col
Clusters",
show_row_clusters_colorbar = TRUE,
row_annotation = NULL,
col_annotation = NULL,
row_annotation_colors = NULL,
col_annotation_colors = NULL,
row_labels = NULL,
col_labels = NULL,
row_title = NULL,
col_title = NULL,
buffer = 0.2,
...
)
Iheatmap-class
object, which can be printed to generate
an interactive graphic
iheatmap object
matrix of values to be plotted as heatmap
x xaxis labels, by default colnames of data
"none","hclust", or "k-means" for no clustering, hierarchical clustering, and k-means clustering of columnsrespectively
vector of pre-determined column cluster assignment
number of clusters for columns, needed if cluster_rows is kmeans or optional if hclust
distance function to use for column clustering if hierarchical clustering
Name for colorbar
scale matrix by rows, cols or none
what method to use for scaling, either standardize, center, normalize
name of RColorBrewer palette or vector of colors for main heatmap
colors for col clusters annotation heatmap
name for col clusters colorbar
show the colorbar for column clusters?
row annotation data.frame
column annotation data.frame
list of colors for row annotations heatmap
list of colors for col annotations heatmap
axis labels for y axis
axis labels for x axis
x axis title
y axis title
amount of space to leave empty before this plot, relative to size of first heatmap
additional argument to add_iheatmap
y axis labels, by default rownames of data
"none","hclust", or "k-means" for no clustering, hierarchical clustering, and k-means clustering of rows respectively
vector of pre-determined row cluster assignment
number of clusters for rows, needed if cluster_rows is kmeans or optional if hclust
distance function to use for row clustering if hierarchical clustering
colors for row clusters annotation heatmap
name for row clusters colorbar
show the colorbar for row clusters?
Alicia Schep
By default, no scaling is done of rows or columns. This can be changed by specifying the 'scale' argument. There are three options for scaling methods. "standardize" subtracts the mean and divides by standard deviation, "center" just subtracts the mean, and "normalize" divides by the sum of the values. "normalize" should only be used for data that is all positive! If alternative scaling is desired, the scaling should be done prior to calling the iheatmap function.
iheatmap
, main_heatmap
mat <- matrix(rnorm(24), nrow = 6)
mat2 <- matrix(rnorm(24), nrow = 6)
annotation = data.frame(gender = c(rep("M", 3),rep("F",3)),
age = c(20,34,27,19,23,30))
hm <- iheatmap(mat,
cluster_rows = "hclust",
cluster_cols = "hclust",
col_k = 3) %>%
add_iheatmap(mat2,
cluster_cols = "hclust",
col_k = 3,
row_annotation = annotation)
# Print heatmap if interactive session
if (interactive()) hm
Run the code above in your browser using DataLab