plotBindingSites
takes several genomic regions (e.g. protein binding
sites), centers them such that the position 0 refers to the center of each region
and finally calculates the mean methylation of all regions for each given sample.
If several samples are given, the median of the samples' methylation values and
optionally other quantiles are plotted.
plotBindingSites(object, regions, width, groups, quantiles, bandwidth, ...)
BSraw
or BSrel
.GRanges
object. The regions may have different widths.width
.plot
function.width
by adding
or removing base pairs symmetrically at both ends of the regions (not by scaling).
A new coordinate system is centered at the middle of the equally sized regions.
Next, the relative methylation values for each sample are averaged accross all
regions. That means, if there are several CpGs from different regions lying the
same position, the mean methylation value is calculated for that position. Then,
the median of these methylation values across all samples is calculated.
Optionally, other quantiles are calculated, too. The median of the methylation is
then plotted for each position after smoothing using a gaussian kernel with the
given bandwidth.If the given regions correspond to binding sites of a certain protein, the plot can be used to discover whether the protein induces changes in the DNA methylation in the proximity of its binding sites.
BSraw-class
, BSrel-class
data(rrbs)
data(promoters)
plotBindingSites(object=rrbs,
regions=promoters,
width=4000,
groups=colData(rrbs)$group)
Run the code above in your browser using DataLab