Basic differential correlation analysis using DGCA

Andrew McKenzie, Bin Zhang

November 2, 2016

This basic vignette shows how to perform the most basic DGCA analysis. To learn how to perform the pipeline step-by-step as well as explore some of the different options available in DGCA, please see the extended vignette in the inst/doc folder of the source package.

First, we will load the package and read in some example data from single-cell RNA-sequencing data from neurons and oligodendrocytes, generated in Darmanis et al. (Darmanis 2015), cleaned for this analysis, and put in the data folder.

library(DGCA, quietly = TRUE)
data(darmanis)
data(design_mat)

Note that the design matrix is a standard design matrix as used in other packages (e.g., limma, DESEq, MatrixEQTL), and specifies the group indices to be extracted from the original columns.

To run the full differential correlation analysis and extract all of the top differentially correlated pairs, run this:

ddcor_res = ddcorAll(inputMat = darmanis, design = design_mat,
  compare = c("oligodendrocyte", "neuron"),
  adjust = "none", nPerm = 0, nPairs = 100)
head(ddcor_res)
##    Gene1  Gene2 oligodendrocyte_cor oligodendrocyte_pVal neuron_cor
## 1 CACYBP   NACA        -0.070261455           0.67509118  0.9567267
## 2 CACYBP    SSB        -0.055290516           0.74162636  0.9578999
## 3 NDUFB9    SSB        -0.009668455           0.95405875  0.9491904
## 4 CACYBP NDUFB9         0.333616044           0.04066732  0.9709674
## 5 CACYBP   ST13        -0.104422773           0.53268567  0.9246014
## 6   NACA    NCL        -0.168001214           0.31334753  0.9051576
##   neuron_pVal zScoreDiff     pValDiff Classes
## 1           0  10.256977 1.100991e-24     0/+
## 2           0  10.251847 1.161031e-24     0/+
## 3           0   9.515191 1.813802e-21     0/+
## 4           0   9.145779 5.920161e-20     +/+
## 5           0   8.951700 3.500493e-19     0/+
## 6           0   8.666293 4.464170e-18     0/+

To run the full differential correlation analysis to find the top differentially correlated pairs for one specific gene compared to all of the others, specify one gene for the “splitSet” argument. Here, we specify the gene “RTN4”:

ddcor_res = ddcorAll(inputMat = darmanis, design = design_mat,
  compare = c("oligodendrocyte", "neuron"),
  adjust = "perm", nPerm = 5, splitSet = "RTN4")
head(ddcor_res)
##    Gene1 Gene2 oligodendrocyte_cor oligodendrocyte_pVal neuron_cor
## 1 COX6A1  RTN4         -0.14366658            0.3895065  0.8513757
## 2   NACA  RTN4         -0.11316838            0.4987289  0.8543674
## 3 NDUFB9  RTN4          0.03053324            0.8556029  0.8623108
## 4    UBB  RTN4          0.04794437            0.7750003  0.8528796
## 5 CACYBP  RTN4          0.07272359            0.6643624  0.8577493
## 6    SSB  RTN4          0.06587898            0.6943441  0.8528114
##   neuron_pVal zScoreDiff     pValDiff     empPVals pValDiff_adj Classes
## 1           0   7.296730 2.948461e-13 0.0003502627   0.01127815     0/+
## 2           0   7.192726 6.351033e-13 0.0003502627   0.01127815     0/+
## 3           0   6.600928 4.085911e-11 0.0003502627   0.01127815     0/+
## 4           0   6.325298 2.527438e-10 0.0003502627   0.01127815     0/+
## 5           0   6.290375 3.166991e-10 0.0003502627   0.01127815     0/+
## 6           0   6.230608 4.646295e-10 0.0003502627   0.01127815     0/+

To plot the differential correlations between RTN4 and its top target, you can use this function:

plotCors(inputMat = darmanis, design = design_mat,
  compare = c("oligodendrocyte", "neuron"), geneA = "RTN4", geneB = "COX6A1")

As a convenience function, DGCA also offers users the ability to plot the values of individual genes across conditions. For example, for RTN4:

plotVals(inputMat = darmanis, design = design_mat,
  compare = c("oligodendrocyte", "neuron"), gene = "RTN4") 

References

Darmanis. 2015. “A Survey of Human Brain Transcriptome Diversity at the Single Cell Level.” PNAS 112 (23): 7285–90. https://doi.org/10.1073/pnas.1507125112.