Why Correlation Choice Matters
For a pair of genes, a correlation coefficient compresses their paired expression values across samples into one number. That compression is not neutral: Pearson correlation emphasizes a linear relationship and can be strongly affected by extreme observations; Spearman correlation summarizes a monotone relationship through ranks; biweight midcorrelation (bicor) downweights observations far from each gene's median. These measures can therefore describe different features of the same expression data and produce different edge sets in a co-expression network.
In the earlier material on nodes, edges, and co-expression network estimands, a gene pair's association was treated as the quantity represented by a candidate edge. Here, the choice of correlation measure specifies how that association is summarized. A correlation is a marginal, pairwise description: it does not by itself establish a causal relationship, adjust for covariates, or show that the genes interact directly.
Pearson and Spearman Correlation
The sample Pearson correlation is the sample covariance divided by the product of the sample standard deviations. Provided both genes have nonzero sample standard deviation, it lies between \(-1\) and \(1\). Its sign gives the direction of linear association, and its magnitude describes the strength of linear association in the observed paired data. It is sensitive to extreme values because the deviations from the means are squared in the standard deviations, and large cross-products enter the covariance.
Spearman correlation replaces each observation with its rank within that gene and calculates Pearson correlation on the ranks. With no ties, ranks are \(1,\ldots,n\); with ties, assign tied observations their average rank. Spearman correlation is sensitive to the ordering of observations, not the original distances between expression values. It can capture a monotone but nonlinear pattern, but it is not a general measure of every possible non-linear relationship. Ties are common with discrete or rounded measurements and should be handled by the stated average-rank convention.
For descriptive calculation, neither coefficient requires normally distributed expression values. Classical tests or intervals for correlations require additional sampling assumptions; for example, standard parametric inference for Pearson correlation commonly uses independent paired observations from a bivariate normal population. In genomic data, samples may be related, repeated, or otherwise dependent, so that assumption should not be taken for granted. The coefficients themselves do not correct for dependence.
Worked Example: A High-Expression Sample Changes Pearson More Than the Ranks
Suppose a hypothetical expression dataset for five independent samples gives \(x=(1,2,3,4,5)\) and \(y=(1,2,3,4,10)\), in normalized expression units. There are no ties. The sample means are \(\bar{x}=3\) and \(\bar{y}=4\).
For Pearson correlation, the centered values are \(x_i-\bar{x}=(-2,-1,0,1,2)\) and \(y_i-\bar{y}=(-3,-2,-1,0,6)\). Thus the cross-product sum is \(6+2+0+0+12=20\). The sums of squared deviations are \(10\) for \(x\) and \(9+4+1+0+36=50\) for \(y\). Therefore,
The ranks of \(x\) are \((1,2,3,4,5)\), and those of \(y\) are also \((1,2,3,4,5)\). Their rank correlation is therefore \(r_{\mathrm{Spearman}}=1\). The high fifth value changes the spacing of the \(y\) observations and hence the Pearson calculation, but it does not change their ordering. This example does not show that Spearman is always preferable: it answers a rank-based question, whereas Pearson describes linear association on the measured scale.
Biweight Midcorrelation
Bicor uses a robust center and scale for each gene. Let \(\operatorname{med}(x)\) be the sample median and let \(\operatorname{MAD}(x)\) be the median of the absolute deviations from that median. Define \(u_{xi}=(x_i-\operatorname{med}(x))/(9\operatorname{MAD}(x))\), and define \(u_{yi}\) analogously. The Tukey biweight is \((1-u^2)^2\) when \(|u|<1\), and zero otherwise. The transformed values are \(A_i=(x_i-\operatorname{med}(x))(1-u_{xi}^2)^2\) when \(|u_{xi}|<1\), and \(A_i=0\) otherwise; define \(B_i\) in the same way for \(y\). Bicor is the Pearson-style normalized cross-product of these transformed values.
This definition requires positive MAD for each gene and nonzero sums of transformed squares. If a gene has MAD zero, or all its transformed values are zero, this version of bicor is undefined; software may return a missing value or use a documented fallback. The tuning constant controls how far from the median a point can be before receiving zero weight. A larger constant downweights fewer observations. Robustness is relative, not a guarantee: an unusual pattern affecting many samples can alter the median and MAD, and separate univariate weights do not protect against every form of bivariate contamination.
Worked Example: One Gene's Zero-Weight Sample Still Affects the Other Denominator
Consider hypothetical paired measurements \(x=(-3,-2,-1,0,1,2,20)\) and \(y=(-3,-2,-1,0,1,2,4)\). Both medians are \(0\), and both MADs are \(2\). Thus the cutoff \(9\operatorname{MAD}\) is \(18\). For the first six samples, \(x_i=y_i\), so \(A_i=B_i\). For sample 7, the \(x\)-deviation is \(20\), exceeding 18, so \(A_7=0\). The \(y\)-deviation is \(4\), which is within the cutoff, so \(B_7\) is nonzero:
For the first six observations, the transformed values are generated by deviations \(-3,-2,-1,0,1,2\), with cutoff 18. Let \(S=\sum_{i=1}^{6}A_i^2=\sum_{i=1}^{6}B_i^2\). Substitution of the deviations gives
The numerator is \(S\), because \(A_7B_7=0\), and the \(x\) denominator sum of squares is \(S\), because \(A_7=0\). But the \(y\) denominator sum is \(S+B_7^2\): the seventh \(B\)-value remains in that sum. Therefore,
The coefficient is below 1, despite the first six transformed pairs matching exactly. Dropping sample 7 from both denominators would calculate a different statistic. This example also shows why bicor is not simply Pearson correlation after deleting a shared set of outliers: each gene receives its own weights.
From Coefficient to Network Edge
A correlation measure and a network construction rule are separate choices. For example, suppose a hypothetical network includes a pair as an edge when the absolute correlation is at least \(0.8\). In the first worked example, Pearson gives \(0.8944\), so that pair passes the threshold; Spearman gives \(1\), so it also passes. In the bicor example, \(0.7578\) falls below the threshold and would not pass if bicor were used. The examples use different data, so they do not compare the three coefficients for one pair; they illustrate how a coefficient enters an edge rule.
In an actual analysis, changing the correlation measure can change which pairs qualify, their edge weights, and downstream summaries of the graph. A threshold does not make a coefficient a test of biological interaction, and a pair just above a chosen cutoff is not necessarily meaningfully different from one just below it. The threshold and correlation definition should be reported together, with any signed or unsigned edge convention made explicit.
| Measure | Association emphasized | Typical sensitivity | Useful when |
|---|---|---|---|
| Pearson | Linear association on the expression scale | Can be strongly affected by extreme values | Linear co-variation is the target and extreme points are credible |
| Spearman | Monotone association in ranks | Less driven by distances, but ranks can change with influential observations and ties | Ordering is meaningful or a monotone nonlinear pattern is plausible |
| Biweight midcorrelation | Association among observations near each gene's median | Downweights large marginal deviations; depends on median, MAD, and tuning choice | Robustness to a small number of unusual observations is desired |
These alternatives are not interchangeable robustness settings for one fixed estimand. Pearson's target is linear co-variation, Spearman's is rank-based monotonic association, and bicor's weighting changes the contribution of observations according to their distance from each marginal median. A curved, non-monotone relationship can be poorly represented by all three. If the scientific target is a different kind of dependence, the choice of summary must change accordingly.
Diagnostics, Limitations, and Common Mistakes
Inspect paired expression plots for selected gene pairs, especially pairs near an edge cutoff or with unusually large correlations. A scatterplot can reveal whether association is approximately linear, monotone but curved, driven by one or two samples, or concentrated in distinct groups. Check for ties, zero variance, near-zero MAD, and sample-level anomalies. Compare measures as a sensitivity analysis when outliers are plausible; disagreement is informative about the association structure, not proof that one coefficient is correct.
A common mistake is to say, “Bicor removes the outlier, so its numerator and both denominator sums use the same remaining samples.” That is wrong because the two genes have separate weights: a sample can have zero \(A_i\) but nonzero \(B_i\). The correct calculation retains \(B_i^2\) in the \(y\) denominator even when \(A_iB_i=0\). Another mistake is to interpret a high correlation as evidence that one gene regulates the other. Correlation summarizes paired variation; shared regulation, technical effects, cell composition, or other factors may explain it. Pairwise correlations are also not adjusted for other genes or covariates.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- If two genes have a strictly increasing but curved relationship and no ties, which of Pearson or Spearman is guaranteed to equal 1? Why?
- For a gene pair, \(A_7=0\) and \(B_7\ne0\). Which terms involving sample 7 remain in the bicor calculation?
- A pair has Pearson correlation \(0.79\) and Spearman correlation \(0.91\). Under an illustrative absolute-correlation threshold of \(0.8\), what happens to its edge status under each measure?
- Why does observing a large gene-pair correlation not establish direct regulation?
Solutions. (1) Spearman equals 1 because a strictly increasing relationship preserves every rank; Pearson equals 1 only when the paired values lie exactly on a positively sloped straight line. (2) Sample 7 contributes zero to the numerator through \(A_7B_7=0\), and zero to the \(x\) denominator through \(A_7^2=0\), but \(B_7^2\) remains in the \(y\) denominator. (3) Pearson does not pass the threshold, while Spearman does; the pair's edge status depends on the selected measure. (4) Correlation is a marginal association and can arise from common causes, technical effects, or other unadjusted factors; it does not identify causal direction or direct interaction.