Summarize information in the supplementary matrix according to physical location into a new matrix with the same dimensions as the main matrix
1  summarize_mat(mat_main,ann_main,mat_supp,ann_supp,n_limit=50,extend=100000,method="pca")

mat_main 
The main matrix or data frame. Rows are features (genes/peaks/etc) and cols are samples (conditions/replicates) 
ann_main 

mat_supp 
The supplementary matrix or data frame. Rows are features (genes/peaks/etc) and cols are samples (conditions/replicates) 
ann_supp 

n_limit 
The most number of closet features in the supplemenatry matrix that can be used for summarization for each feature in the main matrix 
extend 
The genomic features in the supplemenatry matrix that are no farther away than 
method 
Which method to summarize the information in the supplementary matrix when there are >1 neighboring row vectors associated with the row vector in the main matrix. "pca" (default) or "max". In the "max" method, the row vector of these neighboring vectors with the highest correlation with the row vector in the main matrix is used. In the "pca" method, PCA is caculated for these row vectors and the first principal component is used. 
The main matrix and supplementary matrix must have the same columns corresponding to conditions or replicates. They have different features on rows that can be linked by physical location on genomes. The basic assumption is that one feature's variation in the main matrix is correlated with nearby feature(s)' principal variation in the supplementary matrix.
A modified matrix with the same dimensions as the main matrix
mancie
1 2 3  data(mancie_example,package="MANCIE")
sum_DNase=summarize_mat(exp,ann_exp,DNase,ann_DNase)
lev_exp=mancie(exp,sum_DNase)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.