# NOT RUN {
# }
# 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
# }
Run the code above in your browser using DataLab