View source: R/Get_and_Filter_Regions.R
getRegions | R Documentation |
getRegions()
generates a set of regions and some statistics based on
the CpGs in a BSseq object and then saves it as a
tab-delimited text file. Regions can be defined based on CpG locations (for
CpG clusters), built-in genomic annotations from annotatr, or a custom
genomic annotation.
getRegions(
bs,
annotation = NULL,
genome = c("hg38", "hg19", "mm10", "mm9", "rn6", "rn5", "rn4", "dm6", "dm3",
"galGal5"),
upstream = 5000,
downstream = 1000,
custom = NULL,
maxGap = 150,
n = 3,
save = TRUE,
file = "Unfiltered_Regions.txt",
verbose = TRUE
)
bs |
A BSseq object. |
annotation |
A |
genome |
A |
upstream |
A |
downstream |
A |
custom |
A GRanges object with a custom
genomic annotation for defining regions. Construct this using
|
maxGap |
A |
n |
A |
save |
A |
file |
A |
verbose |
A |
These regions still need to be filtered for minimum coverage and methylation standard deviation.
A data.frame
with the region genomic locations along with some
statistics, including number of CpGs, coverage minimum, mean, and
standard deviation, and methylation mean and standard deviation.
plotRegionStats()
, plotSDstats()
, getRegionTotals()
, and
plotRegionTotals()
for help visualizing region
characteristics and setting cutoffs for filtering.
filterRegions()
for filtering regions by minimum coverage and
methylation standard deviation.
## Not run:
# Call Regions
regions <- getRegions(bs, file = "Unfiltered_Regions.txt")
plotRegionStats(regions, maxQuantile = 0.99,
file = "Unfiltered_Region_Plots.pdf")
plotSDstats(regions, maxQuantile = 0.99,
file = "Unfiltered_SD_Plots.pdf")
# Examine Region Totals at Different Cutoffs
regionTotals <- getRegionTotals(regions, file = "Region_Totals.txt")
plotRegionTotals(regionTotals, file = "Region_Totals.pdf")
# Filter Regions
regions <- filterRegions(regions, covMin = 10, methSD = 0.05,
file = "Filtered_Regions.txt")
plotRegionStats(regions, maxQuantile = 0.99,
file = "Filtered_Region_Plots.pdf")
plotSDstats(regions, maxQuantile = 0.99,
file = "Filtered_SD_Plots.pdf")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.