Learn R Programming

M3D (version 1.6.2)

M3D_Wrapper: Computes the components of the M3D test-statistic over all regions for all sample-pairs.

Description

Returns the two components of the M3D test-statistic - the MMD (Gretton et al. 2006) for the full data and the coverge only data, respectively - for all regions and all samples pairs, as a matrix.

Usage

M3D_Wrapper(rrbs, overlaps, para = FALSE)

Arguments

rrbs
An rrbs object containing methylation and coverage data as created using the BiSeq pacakge
overlaps
The overlaps between the list of testing regions and the methylation data. This is obtained using the function findOverlaps(CpGs,rrbs) for a GRanges object CpGs detailing the testing regions.
para
Set to true if called via M3D_Para

Value

This returns the two components of the M3D test-statistic for each region over all sample pairs as a matrix. Subtracting them gives the M3D test-statistic. This is processed with the function pvals.

References

Gretton, A., Borgwardt, K. M., Rasch, M., Scholkopf, B., Smola, A. J. (2006). A kernel method for the two-sample-problem. In Advances in neural information processing systems (pp. 513-520).

Examples

Run this code
data(rrbsDemo)
data(CpGsDemo)
overlaps <- findOverlaps(CpGsDemo,rrbsDemo)
M3D_list <- M3D_Wrapper(rrbsDemo,overlaps)
head(M3d_list$Full-M3D_list$Coverage)

Run the code above in your browser using DataLab