methLevelCor: Compute within-sample correlations of pairs of methylation...

Description Usage Arguments Details Constructing pairs of methylation loci Stratifying pairs by a genomic feature

Description

Given a MethPat object containing 1-tuples, methLevelCor computes the within-sample correlations of pairs of methylation levels. Methylation levels are computed by methLevel.

Usage

1
2
3
methLevelCor(methpat, pair_type = c("adjacent", "all", "strict_adjacent"),
  ipd = seq_len(2000L), ref_loci, method = c("pearson", "kendall",
  "spearman"), conf.level = 0.95, feature, ...)

Arguments

methpat

A MethPat object containing 1-tuples.

pair_type

A character string giving the type of pairs to be constructed when computing correlations. One of "neighbours" or "all", can be abbreviated. Please see the below section, "Construction of pairs of methylation loci", for details.

ref_loci

An MTuples object with the locations of all methylation loci 1-tuples in the sample/reference genome. Only required if pair_type = "neighbours" and otherwise ignored. Please see the below section, "Construction of pairs of methylation loci", for details.

method

A character string indicating which correlation coefficient is to be computed. One of "pearson" (default) or "spearman", can be abbreviated.

feature

An optional GRanges object with the locations of a "genomic feature". This GRanges object must be disjoint (see isDisjoint). Please see the below section, "Stratifying pairs by a genomic feature", for details.

...

Additional arguments passed to methLevel, such as min_cov, statistic and offset.

max_ipd

An integer specifying the maximal IPD of pairs (default: 2000). Only required if pair_type = "all" and otherwise ignored. Please see the below section, "Construction of pairs of methylation loci", for details.

Details

The manner in which the pairs are constructed is determined by additional arguments - see the section, "Constructing pairs of methylation loci". Correlations are stratified by the strand, the intra-pair distance and the feature (if supplied) of the pairs.

Constructing pairs of methylation loci

There are two algorithms for constructing pairs of methylation loci: neighbours, which requires the specification of mtuples, and all, which requires the specification of max_ipd.

Stratifying pairs by a genomic feature

Pairs of methylation levels may be stratified by whether they are inside or outside of a "genomic feature". For our example, we will use CpG islands as our feature. In this case feature should be a GRanges object containing all CpG islands in the genome.

The assignment of pairs as "inside" or "outside" is suprisingly nuanced. The same_feature argument controls how a pair is assigned as being "inside" or "outside" the feature.

Please think carefully about what defines a pair as being "inside" and "outside" a feature for your particular needs. While I have attempted to make methLevelCor fairly general, if you have more complex requirements then you may find the available options to be insufficient.


PeteHaitch/MethylationTuples documentation built on May 8, 2019, 1:30 a.m.