normalize_correlation {spqn} | R Documentation

## Spatial quantile normalization (SpQN)

### Description

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.

### Usage

    normalize_correlation(cor_mat, ave_exp, ngrp, size_grp, ref_grp)

### Arguments

`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 `cor_mat`. For other types of data, `ave_exp` can be the vector corresponding to the row/column of the correlation matrix, whose dependency with the distribution of correlations need to be removed.
`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.

### Value

A normalized correlation matrix.

### Examples

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

[Package spqn version 1.2.0 Index]