Tutorials › High-Dimensional Genomic Data Analysis › Marginal Versus Partial Co-Expression Networks

Co-Expression Networks · Tutorial 489 of 795

Marginal Versus Partial Co-Expression Networks

Compare correlation-based networks with networks built from partial correlations, and see how the choice of conditioning set changes which gene pairs appear directly associated.

Advanced 10 min read

What You'll Learn

  • Define marginal correlation and partial correlation for gene-expression measurements.
  • Derive the partial-correlation formula for one conditioning gene.
  • Calculate partial correlations using one or several conditioning genes.
  • Explain how indirect associations can create marginal network edges.
  • Recognize sign reversals and conditioning-set dependence.
  • Distinguish statistical association from direct biological or causal relationships.

Two Network Questions

A pair of genes can vary together because they are linked in a way not accounted for by other measured genes, or because both track a third gene. A marginal co-expression network records pairwise associations without accounting for other genes. A partial co-expression network instead asks whether a pair remains linearly associated after accounting for a specified set of other genes. These networks can therefore show different edges even when calculated from the same expression data.

The distinction is about the association being summarized, not a guarantee about biological mechanism. A partial correlation is not, by itself, proof that one gene regulates another. Its value depends on which genes are controlled for, how association is measured, and whether the relevant variables have been measured adequately.

Definition: The marginal correlation between two gene-expression variables \(X_i\) and \(X_j\) is their ordinary correlation, \(\operatorname{Cor}(X_i,X_j)\), considered without adjusting for other genes. The partial correlation between \(X_i\) and \(X_j\) given a set \(C\) of other variables is the correlation between the residuals left after linearly regressing each of \(X_i\) and \(X_j\) on the variables in \(C\). It measures their remaining linear association after that adjustment.

Here, a gene-expression variable represents expression for one gene across the same collection of samples. The partial correlation depends explicitly on the conditioning set \(C\). Conditioning on one selected gene is not necessarily equivalent to conditioning on every other measured gene. The word “partial” describes the adjustment; it does not imply that the resulting association is a causal or complete description of the biology.

From Residuals to a Partial Correlation

Suppose \(X_i\), \(X_j\), and the variables in \(C\) are standardized, so each has mean zero and variance one. Write \(R_{CC}\) for the correlation matrix among the conditioning variables, and \(r_{iC}\) and \(r_{Cj}\) for the corresponding vectors of correlations. Linear projection gives residuals after predicting each target from \(C\). Their residual covariance and variances are

$$ \operatorname{Cov}(e_i,e_j) = r_{ij}-r_{iC}R_{CC}^{-1}r_{Cj}, \qquad \operatorname{Var}(e_i) =1-r_{iC}R_{CC}^{-1}r_{Ci}, \qquad \operatorname{Var}(e_j) =1-r_{jC}R_{CC}^{-1}r_{Cj}. $$

These expressions follow by writing the linear projection coefficients as \(\beta_i=R_{CC}^{-1}r_{Ci}\) and \(\beta_j=R_{CC}^{-1}r_{Cj}\), then expanding the covariance of \(e_i=X_i-\beta_i^\mathsf{T}C\) and \(e_j=X_j-\beta_j^\mathsf{T}C\). The partial correlation is the residual covariance divided by the product of the residual standard deviations:

$$ \rho_{ij\mid C} = \frac{r_{ij}-r_{iC}R_{CC}^{-1}r_{Cj}} {\sqrt{ (1-r_{iC}R_{CC}^{-1}r_{Ci}) (1-r_{jC}R_{CC}^{-1}r_{Cj}) }}. $$

This expression requires that the conditioning variables have a nonsingular correlation matrix and that both residual variances are positive. For a single conditioning variable \(Z\), it simplifies to

$$ \rho_{XY\mid Z} = \frac{r_{XY}-r_{XZ}r_{YZ}} {\sqrt{(1-r_{XZ}^{2})(1-r_{YZ}^{2})}}. $$

The numerator is the covariance left after removing the linear contributions of \(Z\); the denominator rescales it to a correlation. In a multivariate normal model, a zero partial correlation corresponds to conditional independence given \(C\). Without that distributional assumption, zero partial correlation means only that the residuals have no linear correlation; nonlinear dependence may remain.

Worked Example: An Indirect Association in a Three-Gene Chain

Suppose a hypothetical data set has standardized expression measurements for genes \(X\), \(Z\), and \(Y\), with \(r_{XZ}=0.80\), \(r_{ZY}=0.60\), and \(r_{XY}=0.48\). Assume the same samples were used for all three correlations, the measurements are suitable for Pearson correlation, and the correlation matrix is valid. Compare the marginal and partial association of \(X\) and \(Y\), controlling for \(Z\).

The marginal correlation is \(r_{XY}=0.48\), a positive association. The partial correlation is

$$ \rho_{XY\mid Z} = \frac{0.48-(0.80)(0.60)} {\sqrt{(1-0.80^2)(1-0.60^2)}} = \frac{0.48-0.48}{\sqrt{(0.36)(0.64)}} = \frac{0}{0.48} =0. $$

Thus, these values show a positive marginal association but no remaining linear association between \(X\) and \(Y\) after controlling for \(Z\). A marginal network could include the \(X\)–\(Y\) pair if its edge rule includes correlations of magnitude \(0.48\). The partial network would not identify a nonzero \(X\)–\(Y\) partial correlation for this conditioning set. This example illustrates how an association transmitted through a third variable can appear as a marginal edge; it does not establish a biological chain of regulation.

Sign Reversal and Conditioning-Set Dependence

Adjustment can change not only the magnitude but also the sign of an association. This happens when the component of the marginal relationship attributable to the conditioning variable is larger than the total marginal correlation. A negative partial correlation alongside a positive marginal correlation is not an arithmetic contradiction: the two quantities describe different associations.

Worked Example: A Partial Correlation with the Opposite Sign

Consider hypothetical standardized expression measurements with \(r_{XY}=0.20\), \(r_{XZ}=0.80\), and \(r_{YZ}=0.50\). These correlations form a valid three-variable correlation matrix: its determinant is \(1+2(0.20)(0.80)(0.50)-0.20^2-0.80^2-0.50^2=0.23\), which is positive. Calculate the partial correlation of \(X\) and \(Y\) controlling for \(Z\).

$$ \rho_{XY\mid Z} = \frac{0.20-(0.80)(0.50)} {\sqrt{(1-0.80^2)(1-0.50^2)}} = \frac{-0.20}{\sqrt{(0.36)(0.75)}} = \frac{-0.20}{0.5196} \approx -0.385. $$

The marginal association is positive, \(0.20\), whereas the partial association is negative, approximately \(-0.385\). The result says that after linearly accounting for \(Z\), higher residual expression of \(X\) tends to accompany lower residual expression of \(Y\). It does not say that changing \(X\) would cause \(Y\) to decrease.

A partial correlation also changes when the conditioning set changes. Controlling for a single gene answers a different question from controlling for several genes together. When two or more conditioning genes are correlated, adjusting for them one at a time generally does not produce the same result as adjusting for them jointly.

Worked Example: Controlling for Two Genes Together

Suppose a hypothetical four-gene data set has the following correlation matrix, calculated from the same samples:

$$ \begin{pmatrix} 1 & 0.50 & 0.60 & 0 \\ 0.50 & 1 & 0.50 & 0 \\ 0.60 & 0.50 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}, $$

The rows and columns are ordered \(X,Y,Z,W\). Calculate the partial correlation of \(X\) and \(Y\) controlling jointly for \(C=\{Z,W\}\). Here \(Z\) and \(W\) are uncorrelated, so \(R_{CC}\) is the two-by-two identity matrix. The residual covariance is

$$ 0.50- \begin{pmatrix}0.60&0\end{pmatrix} \begin{pmatrix}1&0\\0&1\end{pmatrix} \begin{pmatrix}0.50\\0\end{pmatrix} = 0.50-(0.60)(0.50)=0.20. $$

The residual variances are \(1-0.60^2-0^2=0.64\) for \(X\), and \(1-0.50^2-0^2=0.75\) for \(Y\). Therefore,

$$ \rho_{XY\mid Z,W} = \frac{0.20}{\sqrt{(0.64)(0.75)}} = \frac{0.20}{\sqrt{0.48}} \approx 0.289. $$

The partial correlation is about \(0.289\), rather than the marginal \(0.50\). The matrix is consistent with positive residual variances and a positive residual covariance determinant, \(0.64(0.75)-0.20^2=0.44\). Gene \(W\) makes no further adjustment in this particular example because it is uncorrelated with both \(X\) and \(Y\); in general, conditioning variables can be correlated with one another, and the full \(R_{CC}^{-1}\) term must then be used.

Interpreting Networks and Checking Assumptions

A marginal network and a partial network summarize different features of the data. A marginal edge represents pairwise co-expression under the chosen marginal association measure. A partial edge represents residual linear association after adjustment for a stated conditioning set. The network may display only selected associations according to a threshold or another edge-selection rule, but the meaning of the underlying correlation does not change with that display choice.

FeatureMarginal correlation networkPartial correlation network
Association representedPairwise association without adjustment for other genesResidual linear association given a specified set of genes
Indirect associationCan appear as an edge when two genes co-vary through other variablesMay be reduced or removed if the relevant variables are included in the conditioning set
Dependence on choicesDepends on the correlation measure and samplesAlso depends on the conditioning set and whether its variables can be adjusted for reliably
InterpretationCo-expression, not direct regulationConditional linear association, not proof of direct regulation or causation

For partial-correlation interpretations to be meaningful, the measurements should refer to comparable samples and the linear adjustment should be appropriate for the question. Strong nonlinear relationships can be missed by correlations. Outliers can substantially affect Pearson correlations and regression residuals. If samples are dependent, ordinary correlation calculations may not represent the intended sampling uncertainty. A conditioning variable that is measured poorly or omitted may leave an association that adjustment was intended to remove.

In genomic settings, the number of genes may be large relative to the number of samples. Then estimating many partial correlations can be unstable, and the conditioning regressions may be underdetermined or highly collinear. Shrinkage and uncertainty considerations from the earlier material on shrinkage estimation and sampling uncertainty are relevant; a numerical partial correlation should not be treated as reliable merely because software returned one. Inspect the sample size, conditioning-set size, collinearity, missingness, and sensitivity of associations to reasonable analysis choices.

The earlier material on residual correlations after covariate adjustment concerns adjustment for covariates such as batch or other measured sample characteristics. Partial co-expression networks apply the same residual-correlation idea to other gene-expression variables as conditioning variables. These are distinct scientific choices: controlling for a technical covariate is not automatically the same as conditioning on a gene.

Common Mistake and Practical Limits

  • Wrong reasoning: “If two genes have a marginal correlation, they must have a direct link in the network.” Correction: A marginal correlation can reflect shared association with one or more other variables. It is an edge under a marginal definition, not evidence of direct regulation.
  • Wrong reasoning: “A zero partial correlation proves that the genes are independent.” Correction: It establishes zero residual linear correlation for the specified conditioning set. Conditional independence follows from zero partial correlation under a multivariate normal model, not in general.
  • Wrong reasoning: “The partial correlation is an intrinsic property of the gene pair.” Correction: It is conditional on the chosen set of variables and the model used to remove their linear contributions.
  • Wrong reasoning: “A partial edge is necessarily a direct biological connection.” Correction: Unmeasured genes, measurement error, model misspecification, and sampling variation can all affect the observed partial association. Correlation networks are descriptive, not causal by themselves.

Marginal networks are often easier to estimate and can be useful for broad co-expression structure, but their edges include indirect associations. Partial networks target conditional linear associations, but may be more sensitive to model specification and high-dimensional estimation. Neither is universally preferable: the choice should follow the scientific question, and the network definition should be reported with the conditioning set and association measure stated clearly.

Check Your Understanding

Use the definitions and calculations above to answer these questions. Solutions are included for checking your reasoning.

  1. If \(r_{XY}=0.30\), \(r_{XZ}=0.50\), and \(r_{YZ}=0.60\), calculate \(\rho_{XY\mid Z}\).
  2. What does a zero partial correlation establish without a multivariate normal assumption?
  3. Why can adjusting for two genes jointly give a different result from adjusting for each one separately?
  4. A marginal network has an \(X\)–\(Y\) edge, but the partial correlation controlling for \(Z\) is zero. What conclusion is supported, and what conclusion is not?

Solutions. (1) \(\rho_{XY\mid Z}=[0.30-(0.50)(0.60)]/\sqrt{(1-0.50^2)(1-0.60^2)}=0/\sqrt{(0.75)(0.64)}=0\). (2) It establishes zero linear correlation between the residuals after adjustment for the specified set; nonlinear dependence may remain. (3) The conditioning variables may be correlated, so their joint linear contributions are accounted for through the full conditioning-variable correlation matrix, not by simply combining separate adjustments. (4) The data support a marginal association that is removed by linear adjustment for \(Z\); they do not establish that \(Z\) causally mediates the association or that the genes have no other biological relationship.

Clinical Biostats