plotModulePreservation()
plots Z-scores for various module
preservation statistics by module size as a scatterplot, and then saves it as
a .pdf.
Usage
plotModulePreservation(
preservation,
line.size = 0.9,
point.size = 1.2,
nBreaks = 3,
strip.text.size = 8.5,
axis.text.size = 10,
axis.title.size = 12,
save = TRUE,
file = "Module_Preservation_Plots.pdf",
width = 9,
height = 9,
verbose = TRUE
)
Arguments
- preservation
A
data.frame
of module preservation statistics for each module, generated bygetModulePreservation()
.- line.size
A
numeric(1)
giving the size of the horizontal lines.- point.size
A
numeric(1)
indicating the size of the points.- nBreaks
A
numeric(1)
specifying the number of breaks used for both axes.- strip.text.size
A
numeric(1)
indicating the size of the title text for each plot.- axis.text.size
A
numeric(1)
specifying the size of the text for both axes.- axis.title.size
A
numeric(1)
indicating the size of the title text for both axes.- save
A
logical(1)
indicating whether to save the plot.- file
A
character(1)
giving the file name (.pdf) for the saved plot.- width
A
numeric(1)
specifying the width in inches of the saved plot.- height
A
numeric(1)
specifying the height in inches of the saved plot.- verbose
A
logical(1)
indicating whether messages should be printed.
Details
plotModulePreservation()
is designed to be used in combination with
getModulePreservation()
. A blue line is plotted at Z = 2 to indicate
weak to moderate evidence for preservation, while a green line is plotted at
Z = 10 to indicate strong evidence. A ggplot
object is produced and
can be edited outside of this function if desired. More information is given
in the documentation for WGCNA::modulePreservation()
.
See also
getModules()
to build a comethylation network and identify modules of comethylated regions.getModulePreservation()
to calculate module preservation statistics.
Examples
if (FALSE) {
# Calculate Module Preservation
regions_disc <- modules_disc$regions
regions_rep <- modules_rep$regions
preservation <- getModulePreservation(methAdj_disc,
regions_disc = regions_disc,
meth_rep = methAdj_rep,
regions_rep = regions_rep,
corType = "pearson",
file = "Module_Preservation_Stats.txt")
# Visualize Module Preservation
plotModulePreservation(preservation, file = "Module_Preservation_Plots.pdf")
}