Learn R Programming

hbm (version 1.0)

hbm.features: Compute Robust Features in an HBM

Description

hbm.features computes the main features of a hierarchical block matrix.

Usage

hbm.features(m, noise.factor, ncores = 1, ref = NULL, ...)

Arguments

m
a numeric association matrix, typically a chromatin contact map.
noise.factor
numeric vector giving the noise factor to add with add.noise at each iteration. The length of this vector will determine the number of iterations.
ncores
integer giving the number of cores to register and use. If this is larger than one, iterations will be executed in parallel.
ref
hierarchical block matrix computed with hbm from m. If set to NULL this matrix will be computed as part of the execution of hbm.features.
...
additional parameters for hbm.

Value

hbm.features returns a list with the following objects:
noisy.hm
The average hierarchical block matrix. A numeric matrix whose i,j-th entry gives the mean scale at which i and j were found in the same cluster across hbm iterations.
features
noisy.hm with entries set to NA when different from the entries in the original non-noisy hierarchical block matrix.

Details

hbm.features adds noise to the given association matrix and executes hbm to generate a hierarchical block matrix. Repeating this for multiple iterations (with the same or different noise factor values) gives a mean hierarchical block matrix that can be compared with the matrix computed from the non noisy association matrix.

References

hbm's website: http://www.cl.cam.ac.uk/~ys388/hbm/

See Also

add.noise to see how noise is added to matrices hbm to learn how to build hierarchical block matrices hbm's tutorials at http://www.cl.cam.ac.uk/~ys388/hbm/

Examples

Run this code

set.seed(2)
n = 100 # chain size
# generate chain configuration (random walk/giant loop model)
conf = generate.random.conf(n, sd = 0.5, scale = FALSE)
# generate a contact map -like matrix using the model c ~ exp(-d)
control = exp(-1*as.matrix(dist(conf)))
noise = rep(10, 10)
res = hbm.features(control, noise, prune = TRUE, pruning.prob = 0.01)

m = res$features
image(t(m)[,nrow(m):1], axes = FALSE)
ats = seq(0,1,0.2)
lbls = as.character(n*ats)
axis(1, at= ats, labels = lbls, cex.axis = 0.8) 
ats = seq(1,0,-1*0.2)
lbls = as.character(n*seq(0,1,0.2))
axis(2, at= ats, labels = lbls, cex.axis = 0.8) 
 
             





Run the code above in your browser using DataLab