getRegionTotals() calculates the total number of regions, as well as
the total width and number of CpGs remaining in a region set after filtering
at different covMin and methSD cutoffs and then saves it as a
tab-delimited text file.
Arguments
- regions
 A
data.frameoutput fromgetRegions()giving the set of regions and statistics for each region.- covMin
 A
numericspecifying the minimum number of reads at CpGs in a region in any sample for that region to be included in the total.- methSD
 A
numericspecifying the minimum methylation standard deviation for that region to be included in the total.- save
 A
logical(1)indicating whether to save thedata.frame- file
 A
character(1)giving the file name (.txt) for the saveddata.frame- verbose
 A
logical(1)indicating whether messages should be printed.
Value
A data.frame giving the total number of regions, width, and
number of CpGs at all combinations of covMin and methSD.
Details
The purpose of this function is to help balance cutoffs for minimum coverage
and methylation standard deviation and identify a robust set of variably
methylated regions. It's recommended to input multiple covMin and
methSD cutoffs for comparison. Computational resources are also a
consideration for network construction, with region sets of 250K or less
generally performing well.
See also
getRegions()to generate the set of regions.plotRegionStats(),plotSDstats(), andplotRegionTotals()for more help visualizing region characteristics and setting cutoffs for filtering.filterRegions()for filtering regions by minimum coverage and methylation standard deviation.
Examples
if (FALSE) {
# 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")
}