View source: R/ggheat.continuous.R
ggheat.continuous.group | R Documentation |
ggheat.continuous.group
ggheatmap function for plotting groups of esets, within-group column clusteringggheat.continuous.group
ggheatmap function for plotting groups of esets, within-group column clustering
ggheat.continuous.group(
esetlist,
hclist,
hrlist,
hmcolors,
hmtitle = "expression",
col_lab,
col_legend,
ylabstr = "",
fout,
p.heights = c(1.5, 0.5, 5),
xsize = 4,
ysize = 4,
ysizelab = 7,
xleft = 0.15,
xright = 0.24
)
esetlist |
list of expression sets, see ?heatmap.make.groups for preprocessing |
hclist |
list of column clustering from hclust or hcopt |
hrlist |
list of 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) |
xleft |
default 0.15, displayed width for left panel + margin as fraction of whole plot width |
xright |
default 0.24, displayed width for right margin as fraction of whole plot width |
data(tcga.subset.400g.200s)
dat
subtypelevels<-levels(dat$subtype)
grps<-ggheat.make.groups(eset = dat,
labelcol = "subtype", #column name for grouping in pData(eset)
labelvals = subtypelevels, #values to group on (e.g. factor levels of pData(eset)[, labelcol])
clustFUN = clust_eset #clustering function for eset
)
col_legend<-list(subtype = list(col_breaks = subtypelevels,
col_values = brewer.pal(length(subtypelevels),"Set1"),
col_labels = subtypelevels))
esetlist<-lapply(grps$esetlist, function(i) scale_row(i))
hmcolors<-function(... ) scale_fill_gradient2(low = "blue", mid = "white",
high = "red", midpoint = 0, limits=c(-3,3), oob=squish, ...)
p<-ggheat.continuous.group(esetlist,
grps$hclist,
grps$hrlist,
hmcolors,
hmtitle = "row-zscore GE",
col_lab = "subtype",
col_legend = col_legend,
ylabstr = "",
fout = NA,
p.heights = c(1.5, 0.5, 5),
xsize = 0,
ysize = 0,
ysizelab = 7,
xleft = 0.10,
xright = 0.24)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.