Learn R Programming

hbm (version 1.0)

hbm: Build a Hierarchical Block Matrix (HBM)

Description

hbm builds a hierarchical block matrix from an association matrix, typically a symmetric chromatin contact map, by iteratively aggregating clusters.

Usage

hbm(m, infl=2, ...)

Arguments

m
a numeric association matrix, typically a chromatin contact map.
infl
numeric giving the inflation parameter for mcl, set to 2 by default.
...
additional parameters for mcl.

Value

hbm returns a list with the following objects:
hm
The hierarchical block matrix, defined as:$hm_{i,j} =$ the minimal scale (iteration) at which i and j were clustered together, or 0 if i=j
scales
a list of length max(hm)-1 whose k-th entry gives the list of clusters found at k-th scale (iteration).

Details

hbm iteratively applies Markov Clustering (by calling mcl). In the first iteration, clustering is applied on the input association matrix. The resulting clusters are used to generate a new association matrix to cluster, whose i,j-th entry gives the mean association between all the nodes in the i-th and j-th clusters found in the previous iteration. This is repeated until all clusters are aggregated to a single cluster or when clusters can no longer be aggregated together.

References

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

See Also

mcl for the implementation of Markov Clustering detect.movement to see how hbm's results are used to detect movements communicability to see how hbm's results are used to compute the communicability between different locations. hierarchy to see how hbm's results are used to compute the hierarchy of the association matrix. hbm's tutorials at http://www.cl.cam.ac.uk/~ys388/hbm/

Examples

Run this code

set.seed(2)
n = 200 # 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)))
res = hbm(control)
m = res$hm
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) 
            
res$scales


Run the code above in your browser using DataLab