Merges 2 contact maps in sparse format and then aggregates it diagonals. The aggregation process is performed as follows:
start with k = 1 (first diagonal), group k consists of observations: val.x * val.y (from k-th diagonal)
take merge candidate i.e.: k' = k + 1, , group k' consists of observations: val.x * val.y (from k'-th diagonal)
perform chi-square test between group k and k', H0: observations from both groups come from the same distribution, H1: they come from different distributions
if rejected set k = k' (and pool diagonals k to k'-1 into single group), otherwise set k' = k' + 1
repeat until all diagonals are processed
After algorithm is finished diagonals are assigned to groups (pools).
| 1 2 3 4 5 6 7 8 | aggregate_diagonals(
  mtx1.sparse,
  mtx2.sparse,
  agg.diags = TRUE,
  which.test = c("energy", "KS")[1],
  alpha = 0.05,
  exclude.outliers = FALSE
)
 | 
| mtx1.sparse | data frame, contact map in sparse format | 
| mtx2.sparse | data frame, contact map in sparse format | 
| agg.diags | logical if false leave each diagonal in separate group (no pooling) | 
| alpha | numeric significance threshold for chi square test | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.