View source: R/Examine_Region_Methylation.R
getRegionMeth | R Documentation |
getRegionMeth()
extracts methylation values at specified regions for
all samples and then saves it as a .rds file.
getRegionMeth(
regions,
bs,
type = c("raw", "smooth"),
save = TRUE,
file = "Region_Methylation.rds",
verbose = TRUE
)
regions |
A |
bs |
A BSseq object, typically after filtering
with |
type |
A |
save |
A |
file |
A |
verbose |
A |
Methylation is summarized at the region level, and is estimated as the methylated reads divided by the total reads. Methylation values are obtained from a BSseq object and can be either raw or smoothed methylation.
A numeric matrix
, where each row is a region and each column
is a sample.
getPCs()
and adjustRegionMeth()
to adjust methylation for
the top principal components.
getDendro()
and plotDendro()
to generate and visualize
dendrograms.
## Not run:
# Get Methylation Data
meth <- getRegionMeth(regions, bs = bs, file = "Region_Methylation.rds")
# Adjust Methylation Data for Top 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")
# Assess Sample Similarity
getDendro(methAdj, distance = "euclidean") %>%
plotDendro(file = "Sample_Dendrogram.pdf", expandY = c(0.25,0.08))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.