Description Usage Arguments Value
View source: R/generate_heatmap.R
Produce heatmap of count data. uses euclidean distances (recommdended) of clr transformed data; zero replacement completed by Bayesian-multiplicative replacement
1 2 3 4 5 |
data |
dataframe. long format, with column of xdata, variable (such as taxonomy, or compounds), and value (such as abundance or concentration) |
x_var |
string. variable to be heatmap x-axis. example: sample should be a column name in data |
y_var |
string. variable to be heatmap y-axis. example: species or compound should be column name in data |
value_var |
string. column containing heatmap values |
x_dist |
string; dist method for x dendrogram; method for computing phylogenetic distance; supplied to the dist(); default method: "euclidean" dist method options: "euclidean", "maximum", "manhattan", "canberra", "binary" or "minkowski" |
x_hclust |
string; hclust method for x dendrogram; Linkage criteria to determine distance between sets of observations; to be used in hclust(); default method: "complete" hclust method options:"ward.D", "ward.D2", "single", "complete", "average" (= UPGMA), "mcquitty" (= WPGMA), "median" (= WPGMC) or "centroid" (= UPGMC) |
y_dist |
string; dist method for ydata dendrogram; method for computing phylogenetic distance; supplied to the dist(); default method: "euclidean" dist method options: "euclidean", "maximum", "manhattan", "canberra", "binary" or "minkowski" |
y_hclust |
string; hclust method for ydata dendrogram; Linkage criteria to determine distance between sets of observations; to be used in hclust(); default method: "complete" hclust method options:"ward.D", "ward.D2", "single", "complete", "average" (= UPGMA), "mcquitty" (= WPGMA), "median" (= WPGMC) or "centroid" (= UPGMC) When set to FALSE, xdata listed along y-axis |
x_meta |
dataframe. default NULL. Any metadata on heatmap x axis variable (such as sample) to be included x_var should be the identifier to link metadata |
y_meta |
dataframe. default NULL. any metadata on heatmap y axis variable (such as species) to be included y_var should be identifier to link metadata |
x_label |
string. default NULL. Should be column in x_meta. How x-axis of heatmap should be labelled. When set to NULL, x_var is used |
y_label |
string. default NULL. Should be a column in y_meta. How y-axis of heatmap should be labelled. When set to NULL, y_var is used |
heatmap_w |
numeric; default 20; width (cm) of heatmap panel |
heatmap_h |
numeric; default 20; height (cm) of heatmap panel |
dendro_x_h |
numeric; default 8; height (cm) of x-axis dendrogram; helps with ensuring x-axis dendrogram labels are not cut off |
dendro_y_w |
numeric; default 8; width(cm) of y-axis dendrogram; helps with ensuring y-axis dendrogram labels are not cut off |
output |
= string; path and file name of resulting heatmap png Example: "/path/to/my_heatmap.png" |
pdata
dataframe for heatmap
ddata_x
dataframe for x-axis dendrogram
ddata_x
dataframe for y-axis dendrogram
p_hl
ggplot of heatmap and legend
p_x
ggplot of x-axis dendrogram
p_y
ggplot of y-axis dendrogram
g
gtable grob of entire heatmap and dendrograms
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.