Skip to contents

filterRegions() filters a region set using specified covMin and methSD thresholds and then saves it as a tab-delimited text file.

Usage

filterRegions(
  regions,
  covMin = 10,
  methSD = 0.05,
  save = TRUE,
  file = "Filtered_Regions.txt",
  verbose = TRUE
)

Arguments

regions

A data.frame output from getRegions() giving the set of regions and statistics for each region.

covMin

A numeric(1) specifying the minimum number of reads at CpGs in a region in any sample

methSD

A numeric(1) specifying the minimum methylation standard deviation in a region

save

A logical(1) indicating whether to save the data.frame

file

A character(1) giving the file name (.txt) for the saved data.frame

verbose

A logical(1) indicating whether messages should be printed.

Value

A filtered version of the regionsdata.frame

Details

The purpose of this function is to use cutoffs for minimum coverage and methylation standard deviation guided by other functions and obtain a robust set of variably methylated regions. Computational resources are also a consideration for network construction, with region sets of 250K or less generally performing well.

See also

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")
}