plotMEtraitDot | R Documentation |
plotMEtraitDot()
takes a vector
of module eigennode values and
a vector
of categorical sample trait values, generates a dot plot, and
then saves it as a .pdf. ME
and trait
must be in the same order.
plotMEtraitDot(
ME,
trait,
traitCode = NULL,
colors = NULL,
fun.data = c("median_hilow", "mean_cl_boot", "mean_cl_normal", "mean_sdl"),
fun.args = list(conf.int = 0.5),
binwidth = 0.01,
stackratio = 1.4,
dotsize = 0.85,
ylim = NULL,
nBreaks = 4,
axis.title.size = 20,
axis.text.size = 16,
xlab = "Trait",
ylab = "Module Eigennode",
save = TRUE,
file = "ME_Trait_Dotplot.pdf",
width = 6,
height = 6,
verbose = TRUE
)
ME |
A |
trait |
A |
traitCode |
A named |
colors |
A named |
fun.data |
A |
fun.args |
A |
binwidth |
A |
stackratio |
A |
dotsize |
A |
ylim |
A |
nBreaks |
A |
axis.title.size |
A |
axis.text.size |
A |
xlab |
A |
ylab |
A |
save |
A |
file |
A |
width |
A |
height |
A |
verbose |
A |
NA
values in the trait are removed if present, along with corresponding
ME
values. Data is summarized like a box plot (median, Q1, Q3) by
default, but can also be summarized with other methods. See
ggplot2::stat_summary()
for more details. 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.
getMEtraitCor()
and plotMEtraitCor()
to calculate and
visualize all ME-trait correlations.
plotMEtraitScatter()
and plotMethTrait()
for other methods
to visualize a single ME-trait correlation.
## Not run:
# Get Comethylation Modules
modules <- getModules(methAdj, power = sft$powerEstimate, regions = regions,
corType = "pearson", file = "Modules.rds")
# Test Correlations between Module Eigennodes and Sample Traits
MEs <- modules$MEs
MEtraitCor <- getMEtraitCor(MEs, colData = colData, corType = "bicor",
file = "ME_Trait_Correlation_Stats.txt")
plotMEtraitCor(MEtraitCor, moduleOrder = moduleDendro$order,
traitOrder = traitDendro$order,
file = "ME_Trait_Correlation_Heatmap.pdf")
# Explore Individual ME-Trait Correlations
plotMEtraitDot(MEs$bisque4, trait = colData$Diagnosis_ASD,
traitCode = c("TD" = 0, "ASD" = 1),
colors = c("TD" = "#3366CC", "ASD" = "#FF3366"),
ylim = c(-0.2,0.2), xlab = "Diagnosis",
ylab = "Bisque 4 Module Eigennode",
file = "bisque4_ME_Diagnosis_Dotplot.pdf")
plotMEtraitScatter(MEs$paleturquoise, trait = colData$Gran,
ylim = c(-0.15,0.15), xlab = "Granulocytes",
ylab = "Pale Turquoise Module Eigennode",
file = "paleturquoise_ME_Granulocytes_Scatterplot.pdf")
regions <- modules$regions
plotMethTrait("bisque4", regions = regions, meth = meth,
trait = colData$Diagnosis_ASD,
traitCode = c("TD" = 0, "ASD" = 1),
traitColors = c("TD" = "#3366CC", "ASD" = "#FF3366"),
trait.legend.title = "Diagnosis",
file = "bisque4_Module_Methylation_Diagnosis_Heatmap.pdf")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.