This function will build a GRanges methylation pool from a list of GRanges objects

poolFromGRlist(
  LR,
  stat = c("mean", "median", "jackmean", "sum"),
  prob = FALSE,
  column = 1L,
  jstat = c("sum", "mean", "median"),
  columns = NULL,
  verbose = TRUE,
  ...
)

Arguments

LR

List of GRanges objects to build a virtual individual (methylation pool). It is assumed that the list of GRanges was obtained with readCounts2GRangesList. That is, the metacolumn from each GRanges object must contain the columns named 'mC' (number of reads signaling methylated cytosine) and 'uC' (number of reads signaling non-methylated cytosine). If more than two columns are carried on each GRanges object, then the parameter "columns" denoting the column numbers where "uC" and "mC" are located must be passed to uniqueGRanges function.

stat

statistic used to estimate the methylation pool: row 'mean', row 'median', row 'sum', or Jacknife row mean ('jackmean') of methylated and unmethylated read counts across individuals. Notice that, for only two samples, 'jackmean' makes not sense. Since the centrality statistics are sensitive to extreme values, stat = 'sum' is an attractive option. However, in this last case, a further correction for the minimum coverage for the reference sample must be taken into account in a furhter estimation of the Hellinger divergence of methylation levels, which is explained in the detail section from the help of function estimateDivergence. A conservative option is 'mean', which will return the group centroid.

prob

Logic. Whether the variable for pooling is between 0 and 1 (a probability), e.g., methylation levels. If TRUE, then Fisher's transformation is applied, the row mean is computed for each cytosine site and returned in the original measurement scale between 0 and 1 by using the inverse of Fisher's transformation.

column

If prob == TRUE, then the 'column' from the LR metacolumns where the prob values are found must be provided. Otherwise, column = 1L.

jstat

If stat = 'jackmean', then any of the 'stat' possible values: 'sum', 'mean', or 'median' can be used to compute, for each cytosine site, the Jacknife vector of the selected statistics and then to compute the corresponding mean. Default is jstat = 'sum'.

columns

A parameter to pass for uniqueGRanges function.

verbose

If TRUE, prints the function log to stdout

...

Additional parameters for uniqueGRanges function.

Value

A GRanges object

Details

The list of GRanges objects (LR) provided to build a virtual methylome should be an output of the function 'readCounts2GRangesList' or at least each GRanges must have the columns named 'mC' and 'uC', for the read counts of methylated and unmethylated cytosines, respectively.

Examples

gr1 <- makeGRangesFromDataFrame(
data.frame(chr = 'chr1', start = 11:15, end = 11:15, strand = '*',
mC = 1, uC = 1:5), keep.extra.columns = TRUE)
gr2 <- makeGRangesFromDataFrame(
data.frame(chr = 'chr1', start = 11:15, end = 11:15,
strand = '*', mC = 1, uC = 1:5), keep.extra.columns = TRUE)

answer <- poolFromGRlist(list(gr1, gr2), stat = 'mean', verbose = FALSE)