hbm: Build a Hierarchical Block Matrix (HBM)

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/hbm.R

Description

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

Usage

1
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.

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.

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).

Author(s)

Yoli Shavit

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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

hbm documentation built on May 1, 2019, 6:32 p.m.