betaCor: Compute correlations of pairs of beta-values.

Description Usage Arguments Value Note

Description

Given a CoMeth1 object, betaCor computes the correlations of pairs of beta-values. Correlations are computed per-sample and are stratified by the strand, features and ipd of the pairs of methylation loci.

Usage

1
2
3
betaCor(cometh, mls, nil = 0L, ipd, feature, feature_name,
  same_feature = FALSE, ignore_strand = FALSE, method = c("pearson",
  "kendall", "spearman"))

Arguments

cometh

A CoMeth1 object.

mls

A MethylationLociSet object containing the positions of all methylation loci in the sample. This is usually the set of all methylation loci in the reference genome. If a MethylationLociSet is unavailable, then set to NA, in which case betaCor effectively assumes that cometh contains all potential methylation loci (this is not recommended).

ipd

An integer vector of IPDs. Correlations will only be computed using pairs with an IPD found in ipd. If ipd is specified, then the number of intervening loci (NIL) is ignore. Only one of ipd or nil should be specified.

nil

The number of intervening loci (NIL) allowed in each pair. The default, nil = 0, means that only pairs made of adjacent loci are considered. See the ipd parameter for information on how to use all pairs, regardless of NIL. Only one of ipd or nil should be specified.

feature

A GRanges object. If supplied, the correlations are stratified by whether the methylation loci overlap a range in the supplied feature. For example, correlations might be stratified by whether the loci are from a CGI. The details of this stratification are controlled by the same_strand parameter.

same_feature

logical. If supplying a feature, should pairs of methylation loci be required to be in the same feature (TRUE) or just in the same feature class (FALSE). Two loci are in the same feature class if, for example, they are both in CGIs but each loci is in a different CGI. This only affects pairs of loci that are in the feature, i.e., pairs in the "gaps" betweens features need not be in the same "gap".

ignore_strand

logical. Should the strand of the methylation loci be ignored (default: FALSE).

method

A character string indicating which correlation coefficient is to be computed. One of "pearson" (default), "kendall", or "spearman", can be abbreviated. Currently, only "pearson" and "spearman" are supported because "kendall" is very slow (see Note in cor).

Value

A data.frame. While the exact format depends on the parameters used, the first column is the correlation, the second column is the sample name and the remaining columns are IPD and features, if relevant. Therefore, each row corresponds to the correlation for a particular "sample-IPD-features" combination.

Note

Correlations are computed using cor, with use = "na.or.complete".


PeteHaitch/cometh documentation built on May 8, 2019, 1:32 a.m.