Learn R Programming

MineICA (version 1.12.0)

cor2An: Correlation between two matrices

Description

This function measures the correlation between two matrices containing the results of two decompositions.

Usage

cor2An(mat1, mat2, lab, type.corr = c("pearson", "spearman"), cutoff_zval = 0)

Arguments

mat1
matrix of dimension features/genes x number of components, e.g the results of an ICA decomposition
mat2
matrix of dimension features/genes x number of components, e.g the results of an ICA decomposition
lab
The vector of labels for mat1 and mat2, e.g the the names of the two datasets on which were calculated the two decompositions
type.corr
Type of correlation, either 'pearson' or 'spearman'
cutoff_zval
cutoff_zval: 0 (default) if all genes are used to compute the correlation between the components, or a threshold to compute the correlation on the genes that have at least a scaled projection higher than cutoff_zval.

Value

This function returns a list consisting of:
cor
a matrix of dimensions '(nbcomp1+nbcomp2) x (nbcomp1*nbcomp2)', containing the correlation values between each pair of components,
pval
a matrix of dimension '(nbcomp1+nbcomp2) x (nbcomp1*nbcomp2)', containing the p-value of the correlation tests for each pair of components,
inter
the intersection between the features/genes of mat1 and mat2,
labAn
the labels of the compared matrices.

Details

Before computing the correlations, the components are scaled and restricted to common row names.

It must be taken into account by the user that if cutoff_zval is different from NULL or zero, the computation will be slowler since each pair of component is treated individually.

When cutoff_zval is specified, for each pair of components, genes that are included in the circle of center 0 and radius cutoff_zval are excluded from the computation of the correlation between the gene projection of the two components.

See Also

rcorr, cor.test, compareAn

Examples

Run this code
cor2An(mat1=matrix(rnorm(10000),nrow=1000,ncol=10), mat2=matrix(rnorm(10000),nrow=1000,ncol=10),
       lab=c("An1","An2"), type.corr="pearson")

Run the code above in your browser using DataLab