Description Usage Arguments Details Constructing pairs of methylation loci Stratifying pairs by a genomic feature
Given a MethPat
object containing 1-tuples,
methLevelCor
computes the within-sample correlations of pairs of
methylation levels. Methylation levels are computed by
methLevel
.
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, ...)
|
methpat |
A |
pair_type |
A character string giving the type of pairs to be
constructed when computing correlations. One of " |
ref_loci |
An |
method |
A character string indicating which correlation coefficient is
to be computed. One of " |
feature |
An optional |
... |
Additional arguments passed to |
max_ipd |
An |
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.
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
.
pair_type = "neighbours"
: Creates pairs of methylation
levels from neighbouring methylation loci. It checks that the constructed
pairs are neighbours by comparing these to the set of all known methylation
loci in the sample, hence this must be given by mtuples
.
pair_type = "all"
: Creates pairs of methylation levels using
all methylation loci in the sample such that each pair has an intra-pair
distance less than or equal to max_ipd
.
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.
same_feature = FALSE
: A pair is considered to be "inside"
the feature if and only if both loci that make up in the pair overlap an
element of feature
. However, the two loci in each pair may overlap
different elements of feature
, e.g., different CpG islands.
Similarly, a pair is considered to be "outside" the feature if and only if
both loci that make up the pair overlap a "gap" between elements of
feature
. However, the two loci in each pair may overlap different
"gaps", non-CpG island regions of the genome. This is the default.
same_feature = TRUE
: A pair is considered to be "inside" the
feature only if and only if both loci that make up the pair are in the same
feature, e.g., the same CpG island. Similarly, a pair is considered
"outside" the feature only if and only if both loci that make up the pair
are in the same "gap" between elements of feature
. All other pairs
are discarded, e.g., those where both loci that make up the pair are in a
CpG island but lie in distinct CpG islands.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.