Co-expression for a single sample, s, is defined as
$$c_{s,j,k} \equiv \left(g_{s,j}-\bar{g_j}\right)\left(g_{s,k}-\bar{g_k}\right)$$
where \(g_{s,j}\) denotes the expression of gene j in sample s and \(\bar{g_j}\) denotes the mean expression of gene j in all samples.
Denoting the sample size as N, coVar returns the co-expression profile across all samples:
$$c_{j,k} = (c_{1,j,k}, c_{2,j,k}, ... , c_{N,j,k})$$
References
Martin P, et al. Novel aspects of PPARalpha-mediated regulation of lipid and xenobiotic metabolism revealed through a nutrigenomic study. Hepatology, in press, 2007.
Queen K, Nguyen MN, Gilliland F, Chun S, Raby BA, Millstein J. ACDC: a general approach for detecting phenotype or exposure associated co-expression. Frontiers in Medicine (2023) 10. doi:10.3389/fmed.2023.1118824.
#load CCA package for example datasetlibrary(CCA)
# load datasetdata("nutrimouse")
# run function with first two samplescoVar(dataPair = c(1, 2),
fullData = nutrimouse$lipid)