View source: R/Build_Comethylation_Network.R
| getModules | R Documentation |
getModules() builds a comethylation network, identifies comethylated
modules, outputs a list with region module assignments, eigennode
values, dendrograms, and module membership, and then saves this as a .rds
file.
getModules(
meth,
power,
regions,
maxBlockSize = 40000,
corType = c("pearson", "bicor"),
maxPOutliers = 0.1,
deepSplit = 4,
minModuleSize = 10,
mergeCutHeight = 0.1,
nThreads = 4,
save = TRUE,
file = "Modules.rds",
verbose = TRUE
)
meth |
A |
power |
A |
regions |
A |
maxBlockSize |
A |
corType |
A |
maxPOutliers |
A |
deepSplit |
A |
minModuleSize |
A |
mergeCutHeight |
A |
nThreads |
A |
save |
A |
file |
A |
verbose |
A |
Comethylation networks are built and modules are identified by
WGCNA::blockwiseModules(), with corType set to either
pearson or bicor. Calculations are performed for a signed
network in blocks of regions of maximum size maxBlockSize (default =
40000). If there are more than maxBlocksize regions, then regions are
pre-clustered into blocks using projective K-means clustering. Region
correlations are performed within each block and regions are clustered with
average linkage hierarchical clustering. Modules are then identified with a
dynamic hybrid tree cut and highly correlated modules are merged together.
More information is given in the documentation for WGCNA::blockwiseModules().
A list with 11 elements. See WGCNA::blockwiseModules()
for a description of these. Additional regions element is a
data.frame with the region locations, statistics, module
assignment, module membership, and hub region status.
getRegionMeth(), getPCs(), and adjustRegionMeth() to
extract methylation data and then adjust it for the top
principal components.
getSoftPower() and plotSoftPower() to estimate the best
soft-thresholding power and visualize scale-free topology fit
and connectivity.
plotRegionDendro() and getModuleBED() to visualize region
similarity, genomic locations, and module assignments.
## Not run:
# Get Methylation Data
meth <- getRegionMeth(regions, bs = bs, file = "Region_Methylation.rds")
# Adjust Methylation Data for PCs
mod <- model.matrix(~1, data = pData(bs))
PCs <- getPCs(meth, mod = mod, file = "Top_Principal_Components.rds")
methAdj <- adjustRegionMeth(meth, PCs = PCs,
file = "Adjusted_Region_Methylation.rds")
# Select Soft Power Threshold
sft <- getSoftPower(methAdj, corType = "pearson", file = "Soft_Power.rds")
plotSoftPower(sft, file = "Soft_Power_Plots.pdf")
# Get Comethylation Modules
modules <- getModules(methAdj, power = sft$powerEstimate, regions = regions,
corType = "pearson", file = "Modules.rds")
# Visualize Comethylation Modules
plotRegionDendro(modules, file = "Region_Dendrograms.pdf")
BED <- getModuleBED(modules$regions, file = "Modules.bed")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.