Tutorials › High-Dimensional Genomic Data Analysis › Beta Values and M Values for CpG Sites

Epigenomic and Regulatory Data · Tutorial 769 of 795

Beta Values and M Values for CpG Sites

Learn how beta and M values are calculated from CpG signal intensities, converted between scales, and chosen with care for interpretation and statistical modeling.

Intermediate 12 min read

What You'll Learn

  • Calculate beta values and M values from methylated and unmethylated signal intensities.
  • Derive the exact conversion between the two scales when both use the same positive intensities.
  • Explain why beta values are intuitive proportions while M values are log-ratios.
  • Assess how offsets affect low-intensity measurements and the relationship between scales.
  • Recognize boundary cases and diagnostics that can make these summaries misleading.

Two Scales for a CpG Methylation Signal

A methylation array reports signal associated with methylated and unmethylated versions of a CpG site. A compact summary of those signals is useful, but the choice of scale changes how the result looks and how it should be interpreted. Beta values express relative methylated signal on a bounded scale, while M values express a log-ratio on an unbounded scale. Neither scale turns array intensity into a direct count of methylated molecules.

The earlier material on methylation array probe chemistry and signal channels establishes the source of these two signal components. Here, write \(X\) for the measured methylated intensity and \(Y\) for the measured unmethylated intensity for one CpG site in one sample. Initially assume both are positive and measured on a comparable scale. These are signal intensities, not necessarily integer counts.

Definition: For positive methylated intensity \(X\) and unmethylated intensity \(Y\), the unadjusted beta value is \(\beta=X/(X+Y)\), and the unadjusted M value is \(M=\log_2(X/Y)\). The beta value lies strictly between 0 and 1; the M value can be any real number.

The formulas are summaries of signal. A beta value near 0.8 means that the methylated channel contributes about 80% of the sum of these two intensities. It does not, by itself, establish that exactly 80% of cells, DNA molecules, or alleles are methylated. Probe behavior, signal processing, cell mixture, and measurement noise can all affect the observed intensities.

Deriving the Conversion Between Scales

The two summaries are linked exactly when they are calculated from the same positive pair \(X,Y\). Starting with the M value, exponentiation gives the methylated-to-unmethylated intensity ratio. Substituting that ratio into the beta formula gives the conversion:

$$ 2^M=\frac{X}{Y} \qquad\Longrightarrow\qquad \beta=\frac{X}{X+Y} =\frac{X/Y}{X/Y+1} =\frac{2^M}{1+2^M}. $$

Conversely, because \(1-\beta=Y/(X+Y)\), the ratio \(\beta/(1-\beta)\) equals \(X/Y\). Taking its base-2 logarithm recovers M:

$$ M=\log_2\!\left(\frac{\beta}{1-\beta}\right). $$

Thus \(M\) is the base-2 log-odds of the beta value. The word “odds” describes the mathematical transformation of the relative signal; it does not make beta a calibrated probability of methylation for an individual molecule. If \(X=Y\), then \(\beta=0.5\) and \(M=0\). If \(X>Y\), then \(\beta>0.5\) and \(M>0\); if \(X<Y\), then \(\beta<0.5\) and \(M<0\).

The conversion also explains why equal changes on the two scales do not have a constant correspondence. Differentiating \(\beta=2^M/(1+2^M)\) with respect to \(M\) gives:

$$ \frac{d\beta}{dM} =\frac{(\ln 2)2^M}{(1+2^M)^2} =(\ln 2)\beta(1-\beta). $$

This slope is largest at \(\beta=0.5\) and shrinks as beta approaches 0 or 1. Therefore, a fixed M-scale change corresponds to a smaller beta-scale change near the extremes than near the middle. The transformation is monotone, so it preserves the ordering of samples at a site when all are calculated from the same positive intensities, but it does not preserve differences or distances.

Worked Example: Calculating Both Values From Signal

Suppose a hypothetical sample has methylated intensity \(X=81\) and unmethylated intensity \(Y=21\) at a CpG site. Both are positive, so the unadjusted formulas apply directly.

The beta value is:

$$ \beta=\frac{81}{81+21} =\frac{81}{102} \approx 0.7941. $$

The M value is:

$$ M=\log_2\!\left(\frac{81}{21}\right) =\log_2\!\left(\frac{27}{7}\right) \approx 1.94753 \approx 1.948. $$

The methylated signal is about 3.86 times the unmethylated signal, and its share of the two-channel sum is about 0.794. Applying the inverse conversion gives \(\beta=2^{1.94753}/(1+2^{1.94753})\approx0.7941\), agreeing with the direct calculation up to rounding.

Worked Comparisons Across Samples

Beta differences are often easy to communicate as differences in relative signal, while M differences describe ratios of ratios. To see the distinction, use two hypothetical samples measured at the same site with comparable processing. Assume their intensities are positive and use the unadjusted formulas for both samples.

Worked Example: Comparing Two Samples on Both Scales

Sample A has \((X,Y)=(91,11)\), and Sample B has \((X,Y)=(61,41)\). For each sample, the denominator \(X+Y\) is 102, so the beta calculations use the same total signal.

For Sample A:

$$ \beta_A=\frac{91}{102}\approx0.8922, \qquad M_A=\log_2\!\left(\frac{91}{11}\right)\approx3.048. $$

For Sample B:

$$ \beta_B=\frac{61}{102}\approx0.5980, \qquad M_B=\log_2\!\left(\frac{61}{41}\right)\approx0.5732. $$

Using the unrounded fractions, the beta-scale difference, Sample A minus Sample B, is:

$$ \beta_A-\beta_B =\frac{91}{102}-\frac{61}{102} =\frac{30}{102} \approx0.2941. $$

This is a difference of about 0.294 in relative signal share. The M-scale difference is approximately \(3.04836-0.57318=2.475\) log-base-2 units. Equivalently, the ratio \(X/Y\) in Sample A is about \(2^{2.475}\), or 5.56, times the ratio in Sample B. These are different descriptions of the same pair of signal comparisons, not interchangeable effect sizes.

Offsets, Zeros, and Implementation Choices

Real measurements can be near zero, and the logarithm in an M value is undefined when either intensity is zero. Implementations therefore may use an offset or other preprocessing. There is no single offset convention that can be assumed without checking how the values were produced. If a common positive offset \(a\) is added to both channels, define adjusted values using \(X+a\) and \(Y+a\). The exact beta–M conversion still holds if both summaries use that same adjusted pair:

$$ \beta_a=\frac{X+a}{X+Y+2a}, \qquad M_a=\log_2\!\left(\frac{X+a}{Y+a}\right), \qquad \beta_a=\frac{2^{M_a}}{1+2^{M_a}}. $$

An offset can have a substantial effect when the signals are small, because it contributes a larger fraction of the adjusted values. For large signals relative to \(a\), its proportional influence is smaller. Offsets also change the numerical estimand: the adjusted beta and M summarize the adjusted signals, not the original unadjusted pair.

Worked Example: The Effect of a Small-Signal Offset

Consider hypothetical intensities \(X=8\), \(Y=2\), and a common offset \(a=1\). Both raw signals are positive, so the raw values are defined; the adjusted calculation illustrates how an offset changes the result.

Without an offset, \(\beta=8/(8+2)=0.8000\) and \(M=\log_2(8/2)=2\). With the same offset added to each channel:

$$ \beta_a=\frac{8+1}{(8+1)+(2+1)} =\frac{9}{12} =0.7500, \qquad M_a=\log_2\!\left(\frac{9}{3}\right) =\log_2(3) \approx1.585. $$

The adjusted pair is positive, and the exact inverse conversion uses \(M_a=\log_2(3)\): \(2^{M_a}/(1+2^{M_a})=3/(1+3)=0.7500\). The displayed rounded value 1.585 is not exact; inserting it instead gives a value close to, but not exactly, 0.7500.

Some definitions use an offset in the beta denominator only, for example \(X/(X+Y+c)\), while the M value may be calculated as \(\log_2(X/Y)\). Those two definitions are not exact inverses of one another. For the example above with \(c=1\), the denominator-only beta is \(8/11\approx0.7273\), whereas the unadjusted M value remains 2. When comparing results across software or studies, check the actual formulas, offset choices, and signal preprocessing rather than assuming the conversion applies unchanged.

Choosing a Scale for Interpretation and Modeling

ScaleStrengthImportant qualification
BetaBounded between 0 and 1 and readily described as a relative signal share.Differences are compressed near 0 and 1; the value is not automatically a literal cell or molecule fraction.
MUnbounded log-ratio; zero means equal channel intensities, and differences compare intensity ratios multiplicatively.Less direct to interpret; zero or nonpositive signals require a defined handling rule.

Beta values are often useful for plots and summaries intended to communicate relative methylated signal in an intuitive way. M values are often considered for statistical modeling because a log-ratio can be more symmetric than a bounded proportion-like measure and avoids piling values against the beta boundaries. These are tendencies, not guarantees: the distribution and variance depend on the measurements and preprocessing. A transformation alone does not ensure normal residuals, constant variance, independence, or valid inferential calibration.

The scale should match the question and the downstream model. A beta difference is in units of relative signal share; an M difference is in log-base-2 ratio units. If results are reported on one scale after fitting or summarizing on another, state the conversion and its assumptions. A nonlinear transformation means that a group difference on the M scale cannot generally be converted into one constant beta difference that applies at every baseline beta value.

Diagnostics and Common Pitfalls

Before interpreting either scale, check that intensities are finite and that the chosen formula is defined. Inspect the distributions of both channels, the resulting values, and the frequency of values at or near the boundaries. Unexpected beta values outside the intended range, non-finite M values, or substantial numbers of zeros can indicate a mismatch in signal handling or a need to examine preprocessing. Extreme values may also reflect saturation or weak signals; the transformation cannot resolve the underlying measurement problem.

A common mistake is to call beta a literal methylation percentage and then interpret a difference of 0.10 as exactly ten percentage points of molecules methylated. The correction is to describe beta as a relative signal share under the specified formula; stronger biological interpretations require appropriate measurement assumptions and evidence. Another mistake is to treat beta and M differences as numerically equivalent. The conversion is nonlinear, so report the scale and units, and do not translate an M difference into a fixed beta difference without a baseline value.

A further pitfall is comparing values produced with different offsets or definitions as though they were the same quantity. Record whether an offset was used, whether it was added to both channels or only the denominator, and whether values were transformed before calculation. The exact conversion derived above requires both summaries to use the same positive pair of intensities.

Key takeaway: Beta summarizes the methylated channel's share of the two-channel signal; M summarizes the base-2 log ratio of the channels. Their conversion is exact for a shared positive intensity pair, but offsets, preprocessing, and nonlinear scale differences matter for interpretation and modeling.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. If \(X=Y>0\), what are beta and M, and what do they indicate about the two signals?
  2. A CpG has \(\beta=0.75\) from positive unadjusted intensities. Calculate the corresponding M value.
  3. Why does an equal M-scale change not imply the same beta-scale change at every starting beta value?
  4. For \(X=0\) and \(Y=5\), is the unadjusted M value defined? What issue does this raise for analysis?

Solutions. (1) \(\beta=X/(2X)=0.5\) and \(M=\log_2(1)=0\), indicating equal methylated and unmethylated signals. (2) \(M=\log_2(0.75/0.25)=\log_2(3)\approx1.585\). (3) The conversion has slope \(d\beta/dM=(\ln2)\beta(1-\beta)\), which varies with beta and is smaller near 0 and 1 than near 0.5. (4) No. \(\log_2(0/5)\) is undefined; a prespecified offset or other valid signal-handling procedure is needed, and the resulting value depends on that choice.

Clinical Biostats