Description Usage Arguments Details Value Author(s) Examples
Sunburst plot and colored heatmaps
1 2 3 4 5 6 7 8 | draw_sunburst_wt_fill(module.df,
parent.col = "module.parent",id.col = "id",
min.angle = 5,
feat.col,
fill.type = "continuous",log.transform = TRUE,
fill.scale = NULL,
theme.adjust = NULL
)
|
module.df |
A data.frame table summarizing module information. Must contain module parent and child relation for hierarchy visualization. |
parent.col |
Character object, name for the parent module column in module.df. |
id.col |
Character object for the module id column in module df. |
min.angle |
Minimum angle that rectangles in the sunburst are labeled with respective module id. |
feat.col |
Chracter object, for the feature column in module.df to color the heatmaps. |
fill.type |
continuous/discrete, is the variable numeric (continuous) or factor (discrete)? |
log.transform |
TRUE/FALSE. do log10 transform for p-values? |
fill.scale |
A ggplot object to specify heatmap coloring scheme. Permissible functions are: scale_fill_gradient,scale_fill_gradient2,scale_fill_gradientn,scale_fill_manual. |
theme.adjust |
A ggplot object to specify theme for plotting. |
makes use of ggraph scheme to manipulate and draw sunburst plot in ggplot2 framework. fill.scale and theme.adjust provide flexibility to designate heatmap coloring schemes and figure aesthetics.
ggplot object for the figure
Won-Min Song
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | ## Not run:
rm(list = ls())
data(Sample_Expression)
ijw <- calculate.correlation(datExpr[1:100,],doPerm = 2)
el <- calculate.PFN(ijw[,1:3])
g <- graph.data.frame(el,directed = FALSE)
MEGENA.output <- do.MEGENA(g = g,remove.unsig = FALSE,doPar = FALSE,n.perm = 10)
output.summary <- MEGENA.ModuleSummary(MEGENA.output,
mod.pvalue = 0.05,hub.pvalue = 0.05,
min.size = 10,max.size = 5000,
annot.table = NULL,id.col = NULL,symbol.col = NULL,
output.sig = TRUE)
# no coloring
sbobj = draw_sunburst_wt_fill(module.df = output.summary$module.table,
feat.col = NULL,id.col = "module.id",parent.col = "module.parent")
sbobj
# get some coloring (with log transform option)
mdf= output.summary$module.table
mdf$heat.pvalue = runif(nrow(mdf),0,0.1)
sbobj = draw_sunburst_wt_fill(module.df = mdf,feat.col = "heat.pvalue",log.transform = TRUE,
fill.type = "continuous",
fill.scale = scale_fill_gradient2(low = "white",mid = "white",high = "red",
midpoint = -log10(0.05),na.value = "white"),
id.col = "module.id",parent.col = "module.parent")
sbobj
# get discrete coloring done
mdf$category = factor(sample(x = c("A","B"),size = nrow(mdf),replace = TRUE))
sbobj = draw_sunburst_wt_fill(module.df = mdf,feat.col = "category",
fill.type = "discrete",
fill.scale = scale_fill_manual(values = c("A" = "red","B" = "blue")),
id.col = "module.id",parent.col = "module.parent")
sbobj
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.