filterGRange: Filter methylation counts by coverage in a GRanges object

filterGRangeR Documentation

Filter methylation counts by coverage in a GRanges object

Description

The function is used to discard the cytosine positions with coverage values less than 'min.coverage' read counts or values greater than the specified 'percentile'.

Usage

filterGRange(
  x,
  min.coverage = 4,
  max.coverage = Inf,
  percentile = 0.999,
  col.names = c(coverage = NULL, mC = NULL, uC = NULL),
  sample.name = "",
  verbose = TRUE
)

Arguments

x

GRanges object

min.coverage

Cytosine sites with coverage less than min.coverage are discarded. Default: 0

max.coverage

Cytosine sites with coverage greater than max.coverage are discarded. Default: Inf

percentile

Threshold to remove the outliers from each file and all files stacked. If percentile is 1, all the outliers stay

col.names

The number of the 'coverage' column. Since no specific table format for the count data is specified, at least the number of the 'coverage' column must be given, or the number of the columns with methylated (mC) and unmethylated counts (uC). Then coverage = mC + uC.

sample.name

Name of the sample

verbose

If TRUE, prints the function log to stdout

Details

The input must be a GRanges object with a coverage column in the metacolumn table or the columns with methylated (mC) and unmethylated counts (uC).

Value

The input GRanges object or list of GRanges objects after filtering it.

Examples

    gr1 <- makeGRangesFromDataFrame(
        data.frame(chr = 'chr1', start = 11:15, end = 11:15,
                strand = c('+','-','+','*','.'), mC = 1, uC = 1:5),
        keep.extra.columns = TRUE)
    filterGRange(gr1, min.coverage = 1, max.coverage = 4,
                col.names = c(mC = 1, uC = 2), verbose = FALSE)


genomaths/MethylIT documentation built on Feb. 3, 2024, 1:24 a.m.