View source: R/plot_gene_heatmap.R
This is a wrapper for heatmap3
, designed to make plotting of gene expression heatmaps more
automated. Samples can be order and/or colored based on variables in an optional design
object.
It also provides a nicer default color palette than the heatmap3 default.
1 2 3 4 5 6 7 8 9 | plot_gene_heatmap(
counts, design=NULL, libID_col="lib.id",
order_by_var=NULL, order_by_var_levels=NULL,
color_by_var=order_by_var, my_var_colors=NULL, color_by_var_levels=NULL,
norm.method="range01", scale="none", row_dendro=NULL, col_dendro=NULL,
filename=NULL, plotdims=c(9,9),
my_heatmap_cols=NULL,
add_legend=FALSE, leg_x=0.7, leg_y=1.1, xl=0.6, xr=0.7, yb=0.9, yt=1.1,
...)
|
counts |
a numeric matrix (or object that can be coerced to matrix) of gene expression values, with genes in rows and samples in columns, or an object from which counts can be extracted (such as an EList or DGEList). |
design |
(optional) design object, used for ordering or coloring samples. If provided, must include a column (named in |
libID_col |
(optional) string, the name of the column in |
order_by_var |
(optional) character vector, the names of the columns in |
order_by_var_levels |
(optional) character vector, or list of character vectors, one for each element in |
color_by_var |
(optional) character vector, the names of the columns in |
my_var_colors |
(optional) vector, or list of vectors, containing colors for use in coloring column identifiers, one for each element in |
color_by_var_levels |
(optional) vector, or list of vectors, one for each element in |
norm.method |
name of the function to be used in normalizing the gene expression values in each row. Defaults to "range01", which normalizes each row to extend from 0 to 1. Can be any function that returns a numeric vector of the same length as its argument. Passed to |
scale |
alternative method for normalizing counts. Passed to |
row_dendro, col_dendro |
variables that specify the row and/or columns dendrogram(s). Set to NA to suppress dendrograms. if |
filename |
a character string. If provided, the function outputs a pdf of the plot, named "filename.pdf". If not provided, the function prints to a plotting window. |
plotdims |
a numeric vector, the width and height (in inches) of the plotting object. Either the size of the pdf, or the size of the plotting window. |
my_heatmap_cols |
a vector of color names, typically the result of a call to |
add_legend |
logical, whether to add a legend for the coloring of sample labels. If samples are colored by more than one variable, legends are output as separate plots. Defaults to |
leg_x, leg_y |
x- and y-coordinates for the plot location of the legend for non-numeric variables. As the coordinates of heatmap3 vary with the data set, the defaults may not provide a good location. Used only if color_by_var has length 1. |
xl, xr, yb, yt |
x- and y-coordinates for the left, right, bottom, and top boundaries of the legend for numeric variables. As the coordinates of heatmap3 vary with the data set, the defaults may not provide a good location. Used only if color_by_var has length 1. |
... |
(optional) additional arguments passed to |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.