compDists {MMDiff2} | R Documentation

## Compute distances between Peaks

### Description

This function computes pairwise distances between histograms according to the dist.method (MMD, KS). For large data sets it is a bit time consuming.

### Usage

    compDists(MD, dist.method = "MMD", sigma = NULL, run.parallel = TRUE)

### Arguments

`MD` | DBAmmd Object. This Object can be created using `DBAmmd()`.
`dist.method` | specify method used for distances between samples. Currently only Maximum Mean Discrepancy (MMD) and Kolmogorov-Smirnov (KS) implemented. (DEFAULT: 'MMD')
`sigma` | sigma parameter of the RBF kernel, determining the distance (along the genome) at which fragment counts decorrelate. If set to NULL, 100 random Peaks are used to determine sigma heuristically according to the method described in the MMDiff paper [1]. (DEFUALT: NULL)
`run.parallel` | whether to run in parallel (currently no parallelization implemented) (DEFAULT: FALSE)

### Value

DBAmmd object with updated slot `Dists`

### Author(s)

Gabriele Schweikert G.Schweikert@ed.ac.uk

### References

[1] Schweikert et al. BMC Genomics 2013 ...

### See Also

`DBAmmd`, `plotDists`, `plotDISTS4Peak`, `compPvals`

### Examples

    ## Example using a small data set provided with this package:

    data("MMD")
    MMD.1 <- compDists(MMD)

    # To inspect the computed distances:
    D <- Dists(MMD.1,dist.method='MMD')
    head(D)

    # To analyse the result:
    plotDists(MMD.1)

[Package MMDiff2 version 1.18.0 Index]