normalize_correlation {spqn} | R Documentation |
This method was developed to remove a mean-correlation relationship in correlation matrices built from gene expression data. It can serve as pre-processing step prior to a co-expression analysis.
normalize_correlation(cor_mat, ave_exp, ngrp, size_grp, ref_grp)
cor_mat |
A (square and symmetrix) correlation matrix. |
ave_exp |
A vector of expression levels, same length as the
number of rows of the correlation matrix in |
ngrp |
Number of bins in each row/column to be used to partition the correlation matrix, integer. |
size_grp |
Size of the outer bins to be used to appriximate the distribution of the inner bins, in order to smooth the normalization. Note that the product of size_grp and ngrp must be equal or larger than than the row/column number of cor_mat, and there is no smoothness in the normalization when they are equal. |
ref_grp |
Location of the reference bin on the diagonal, whose distribution will be used as target distribution in the normalization, an integer. |
A normalized correlation matrix.
if(require(spqnData)){ data(gtex.4k) cor_ori <- cor(t(assay(gtex.4k))) ave_logrpkm <- rowData(gtex.4k)$ave_logrpkm normalize_correlation(cor_ori, ave_exp = ave_logrpkm, ngrp=10, size_grp=15, ref_grp=9)}