View source: R/ggheat.continuous.R
ggheat.continuous.single | R Documentation |
ggheat.continuous.single
ggheatmap function for plotting a single esetggheat.continuous.single
ggheatmap function for plotting a single eset
ggheat.continuous.single(
eset,
hc,
hr,
hmcolors = NA,
hmtitle = "expression",
col_lab,
col_legend,
ylabstr = "",
fout = NA,
p.heights = c(1.5, 0.5, 5),
xsize = 4,
ysize = 4,
ysizelab = 7,
xright = 0.24,
override.hc = NA
)
eset |
expression set |
hc |
column clustering from hclust or hcopt |
hr |
row clustering from hclust or hcopt |
hmcolors |
function for heatmap color gradient, default: hmcolors<-function(... ) scale_fill_gradient2(low = "blue", mid = "white", high = "red", midpoint = 0, limits=c(-3,3), oob=squish, ...) |
hmtitle |
title of heatmap color label, default: "expression" |
col_lab |
column color label to display, one or more of columns of pData(eset) |
col_legend |
named list of column color legends, names correspond to col_lab, see format: col_legend<-list(COL1 = list(col_breaks = COL1levels, col_values = brewer.pal(length(COL1levels),"Set1"), col_labels = COL1levels), COL2 = list(col_breaks = COL2levels, col_values = brewer.pal(length(COL2levels),"Set2"), col_labels = COL2levels)) |
ylabstr |
y axis title string, |
fout |
filename to save plot, default NA, save as object, to display to device, use grid.arrange |
p.heights |
panel heights default c(1.5, 0.5, 5), |
xsize |
default 4 x axis labels (uses colnames), set to 0 to turn off display |
ysize |
default 4, y axis labels (uses rownames), set to 0 to turn off display |
ysizelab |
default 7, text size for y axis title (specified in ylabstr) |
xright |
default 0.24, displayed width for right margin as fraction of whole plot width |
#load expression data
data(tcga.subset.400g.200s)
dat
#hclust for rows and columns
hc<-clust_eset(dat)
pData(dat)$hclust.groups<-as.factor(cutree(hc$hc, k = 4))
#scale expression by row
dat.scaled<-scale_row(dat)
subtypelevels<-levels(dat$subtype)
#color legends for column labels
col_legend<-list(subtype = list(col_breaks = subtypelevels,
col_values = brewer.pal(length(subtypelevels),"Set1"),
col_labels = subtypelevels),
hclust.groups = list(col_breaks = levels(pData(dat)$hclust.groups),
col_values = sapply(c("pink", "orange", "yellow", "cyan"), to.hex),
col_labels = levels(pData(dat)$hclust.groups)))
#heatmap fill gradient
hmcolors<-function(... ) scale_fill_gradient2(low = "blue", mid = "white",
high = "red", midpoint = 0, limits=c(-3,3), oob=squish, ...)
p<-ggheat.continuous.single(eset = dat.scaled,
hc = hc$hc,
hr = hc$hr,
hmcolors = hmcolors,
hmtitle = "row-zscore GE",
col_lab = c("subtype", "hclust.groups"),
col_legend = col_legend,
ylabstr = "",
fout = NA,
p.heights = c(1.5, 0.5, 5),
xsize = 0,
ysize = 0,
ysizelab = 7,
xright = 0.18
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.