View source: R/Build_Comethylation_Network.R
plotSoftPower | R Documentation |
plotSoftPower()
visualizes scale-free topology fit and mean
connectivity for multiple soft power thresholds as a scatterplot, and then
saves it as a .pdf.
plotSoftPower(
sft,
pointCol = "#132B43",
lineCol = "red",
nBreaks = 4,
save = TRUE,
file = "Soft_Power_Plots.pdf",
width = 8.5,
height = 4.25,
verbose = TRUE
)
sft |
A |
pointCol |
A |
lineCol |
A |
nBreaks |
A |
save |
A |
file |
A |
width |
A |
height |
A |
verbose |
A |
plotSoftPower()
is designed to be used in combination with
getSoftPower()
. A ggplot
object is produced and can be edited
outside of this function if desired.
A ggplot
object.
getRegionMeth()
, getPCs()
, and adjustRegionMeth()
to
extract methylation data and then adjust it for the top
principal components.
getSoftPower()
to calculate the best soft-thresholding power
and fit indices for scale-free topology.
getModules()
to build a comethylation network and identify
modules of comethylated regions.
## 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")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.