View source: R/Visualize_Comethylation_Network.R
plotHeatmap | R Documentation |
plotHeatmap()
takes a numeric matrix
and two dendrograms, plots
them, and then saves it all as a .pdf. The row names and column names of
x
must include the same set of values as the labels of rowDendro
and colDendro
, respectively.
plotHeatmap(
x,
rowDendro,
colDendro,
colors = blueWhiteRed(100, gamma = 0.3),
limit = max(abs(x)),
axis.text.size = 8,
legend.title = "Bicor",
legend.title.size = 16,
legend.text.size = 12,
legend.position = c(0.3, 0.905),
rowDendroMargins = c(-1.55, 1, -0.1, -1.1),
colDendroMargins = c(1, -0.5, -1, 0.8),
rowColorMargins = c(-1.85, -1.5, 0.55, 1.7),
colColorMargins = c(-1.6, -0.85, 1.8, 0.55),
save = TRUE,
file = "Heatmap.pdf",
width = 11,
height = 9.5,
verbose = TRUE
)
x |
A |
rowDendro |
An stats::hclust object generated by |
colDendro |
An stats::hclust object generated by |
colors |
A |
limit |
A |
axis.text.size |
A |
legend.title |
A |
legend.title.size |
A |
legend.text.size |
A |
legend.position |
A |
rowDendroMargins |
A |
colDendroMargins |
A |
rowColorMargins |
A |
colColorMargins |
A |
save |
A |
file |
A |
width |
A |
height |
A |
verbose |
A |
plotHeatmap()
is designed to be used in combination with getCor()
and getDendro()
. The function will check to see if module color names are
in the row and column names and then plot a color bar with the module colors.
A ggplot
object is produced and can be edited outside of this function
if desired.
A ggplot
object.
getModules()
to build a comethylation network and identify
modules of comethylated regions.
getDendro()
and plotDendro()
to generate and visualize
dendrograms.
getCor()
to calculate correlation coefficients.
## Not run:
# Get Comethylation Modules
modules <- getModules(methAdj, power = sft$powerEstimate, regions = regions,
corType = "pearson", file = "Modules.rds")
# Examine Correlations between Modules
MEs <- modules$MEs
moduleDendro <- getDendro(MEs, distance = "bicor")
plotDendro(moduleDendro, labelSize = 4, nBreaks = 5,
file = "Module_ME_Dendrogram.pdf")
moduleCor <- getCor(MEs, corType = "bicor")
plotHeatmap(moduleCor, rowDendro = moduleDendro, colDendro = moduleDendro,
file = "Module_Correlation_Heatmap.pdf")
# Examine Correlations between Samples
sampleDendro <- getDendro(MEs, transpose = TRUE, distance = "bicor")
plotDendro(sampleDendro, labelSize = 3, nBreaks = 5,
file = "Sample_ME_Dendrogram.pdf")
sampleCor <- getCor(MEs, transpose = TRUE, corType = "bicor")
plotHeatmap(sampleCor, rowDendro = sampleDendro, colDendro = sampleDendro,
file = "Sample_Correlation_Heatmap.pdf")
# Visualize Module Eigennode Values
plotHeatmap(MEs, rowDendro = sampleDendro, colDendro = moduleDendro,
legend.title = "Module\nEigennode",
legend.position = c(0.37,0.89),
file = "Sample_ME_Heatmap.pdf")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.