plot_heatmap {proBatch} | R Documentation |
Plot the heatmap of samples
plot_heatmap(data_matrix, sample_annotation = NULL, sample_id_col = "FullRunName", sample_annotation_col = NULL, sample_annotation_row = NULL, fill_the_missing = TRUE, cluster_rows = TRUE, cluster_cols = FALSE, annotation_color_list = NA, heatmap_color = colorRampPalette(rev(RColorBrewer::brewer.pal(n = 7, name = "RdYlBu")))(100), color_for_missing = "black", filename = NA, plot_title = NA, ...)
data_matrix |
features (in rows) vs samples (in columns) matrix, with feature IDs in rownames and file/sample names as colnames. in most function, it is assumed that this is the log transformed version of the original data |
sample_annotation |
data matrix with
; each column of sample annotation will get it's own row.
If |
sample_id_col |
name of the column in sample_annotation file, where the filenames (colnames of the data matrix are found) |
sample_annotation_col |
biological or technical factors to be annotated in heatmap columns |
sample_annotation_row |
biological or technical factors to be annotated in heatmap rows |
fill_the_missing |
boolean value determining if missing values should be substituted with -1 (and colored with black) |
cluster_rows |
boolean value determining if rows should be clustered |
cluster_cols |
boolean value determining if columns should be clustered |
annotation_color_list |
list specifying colors
for columns (samples). Best created by |
heatmap_color |
vector of colors used in heatmap (typicall a gradient) |
color_for_missing |
special color to make missing values.
Usually black or white, depending on |
filename |
filepath where to save the image |
plot_title |
Title of the plot (usually, processing step + representation level (fragments, transitions, proteins)) |
... |
other parameters of |
object returned by link[pheatmap]{pheatmap}
sample_annotation_to_colors
, pheatmap
color_scheme <- sample_annotation_to_colors (example_sample_annotation, factor_columns = c('MS_batch','EarTag', "Strain", "Diet", "digestion_batch", "Sex"), not_factor_columns = 'DateTime', numeric_columns = c('order')) heatmap_plot <- plot_heatmap(example_proteome_matrix, example_sample_annotation, sample_annotation_col = c("MS_batch", "digestion_batch", "Diet"), cluster_cols = TRUE, annotation_color_list = color_scheme$list_of_colors, show_rownames = FALSE, show_colnames = FALSE)