Tutorials › Multi-Omics Data Integration › Zeros and Detection Limits Before Transformation

Preprocessing, Scaling and Block Weighting · Tutorial 36 of 597

Zeros and Detection Limits Before Transformation

Learn to identify what an observed zero represents and choose a defensible strategy before applying logarithmic or log-ratio transformations.

Intermediate 12 min read

What You'll Learn

  • Distinguish structural absence, finite-sampling zeros, and left-censored measurements.
  • Identify the assumptions behind common zero-replacement and censoring-aware approaches.
  • Calculate how an additive pseudocount changes a compositional log-ratio.
  • Derive and interpret a conditional log-scale value under a left-censored log-normal model.
  • Diagnose when zero handling may distort log-scale analyses and assess sensitivity to the chosen method.

Why the Meaning of a Zero Matters

A logarithm is not defined at zero, and a log-ratio involving a zero component is not finite. Yet the same recorded zero can mean very different things: a component may truly be absent, it may be present but missed in finite sampling, or its measurement may fall below an assay’s detection threshold. These cases are not interchangeable. Choosing a replacement value without identifying the measurement process can create artificial differences, distort ratios, or understate uncertainty.

The earlier material on log and power transformations and on log-ratio transforms established how those transformations are used. Here the focus is the data that cannot be transformed directly: how to interpret zero-like observations and choose a strategy consistent with what was measured.

Definition: A structural zero denotes true absence, inapplicability, or an impossible value under the scientific definition of the feature. A sampling zero occurs when a feature is present in the underlying material but is not observed in a finite sample or sequencing process. A below-detection-limit observation is a measurement known only to lie below a threshold, often recorded as zero or as a special code. It is left-censored, not necessarily equal to zero.

These definitions describe different data-generating situations. A structural zero is an exact statement about absence. A sampling zero is an observed count of zero despite a possibly positive underlying abundance. A censored observation supplies an inequality, such as \(0 \leq Y < L\), where \(L\) is a known detection limit. A reported zero without a detection flag or assay metadata may not reveal which situation applies.

Identify the Observation Process First

Before transforming data, consult the assay protocol, data dictionary, and preprocessing record. Ask whether zero is a possible true value, whether counts arise from finite sampling, and whether the instrument reports values below a threshold as zero, as a threshold code, or as missing. Detection limits may vary by feature, sample, or batch, so do not assume one common \(L\) unless the assay supports that assumption.

Worked Example: Classifying Three Reported Zeros

Suppose a hypothetical study records three kinds of zero. A metabolite is absent from a pathway in a particular cell type; a microbial feature has zero reads among 500 reads; and a protein assay reports zero for a sample whose signal is below its stated limit of 2.0 units. What does each zero mean?

Pathway metabolite. If the assay and scientific definition support genuine absence in that cell type, this is structural. It should not be changed to a small positive abundance merely to make a logarithm possible. A presence/absence representation or a model that accommodates absence may better match the question.

Zero reads. A zero among 500 reads is a sampling zero if the feature could be present but was not captured. A finite sample can miss a rare feature. The observation is a count of zero, not proof that the underlying abundance is exactly zero.

Protein signal. If the assay recorded zero because the signal was below 2.0 units, the data say the value lies below the detection threshold. Treating it as exactly zero discards the censoring information; treating it as exactly 1.0 also adds an unsupported exact measurement.

The distinction is practical: the first zero may represent absence, the second a stochastic non-observation, and the third an interval of possible values.

Replacement and Censoring-Aware Strategies

A replacement strategy assigns a positive value to an observed zero so that a log or log-ratio can be calculated. It is simple, but the assigned value is an assumption or approximation, not a recovered observation. A censoring-aware strategy instead uses the information that a value lies in an interval and incorporates that information into estimation. The appropriate choice depends on the zero mechanism and the scientific target.

SituationPossible strategyMain caution
Structural zeroRepresent absence explicitly, or use a model that allows a separate absence stateAdding a positive value contradicts true absence
Sampling zero in counts or compositionsUse a count-based model, or a stated zero-replacement rule before log-ratio analysisReplacement can affect ratios, especially for rare components
Below a known detection limitUse a censored likelihood or a model for values in the interval below the limitSubstituting one exact value ignores uncertainty below the threshold

For sampling zeros in compositional data, a common simple approach adds a small pseudocount and then closes the adjusted counts to sum to one. “Closes” means dividing each adjusted count by the adjusted total. This yields finite log-ratios, but the pseudocount must be reported and justified; it is not a universal estimate of the unobserved abundance. More elaborate replacements may preserve relative information among nonzero components, but they still rely on assumptions about the unobserved parts.

For values censored below a known limit, substitution by \(L/2\) or another fraction of \(L\) is sometimes used as a rough descriptive approximation. It treats all censored observations as if they had the same exact value and generally does not represent their uncertainty. If inference is the goal and a suitable measurement model is available, censoring-aware estimation is usually preferable.

Worked Example: A Pseudocount Changes a Log-Ratio

Consider a hypothetical composition recorded as counts \((0,10,20,70)\), totaling 100. Suppose, as a working assumption, that the zero is a sampling zero rather than a structural absence. Add a pseudocount \(\delta=0.5\) to each component. The adjusted counts are \((0.5,10.5,20.5,70.5)\), with total \(102\).

The closed proportions for the first two components are \(0.5/102\) and \(10.5/102\). Their log-ratio is

$$ \ln\left(\frac{0.5/102}{10.5/102}\right) =\ln\left(\frac{0.5}{10.5}\right) =\ln\left(\frac{1}{21}\right) \approx -3.045. $$

The common closure denominator cancels in a ratio. To see the sensitivity to the replacement, instead choose \(\delta=0.1\). The corresponding log-ratio is

$$ \ln\left(\frac{0.1}{10.1}\right) =\ln\left(\frac{1}{101}\right) \approx -4.615. $$

Both calculations are valid for their stated pseudocounts, but the substantial difference shows that the transformed value depends on the choice. Neither result establishes the true unobserved abundance. A structural zero would make this replacement inappropriate, and a sampling-zero interpretation should be checked against the assay and study design.

Modeling Values Below a Detection Limit

A simple censoring model makes the available information explicit. Let \(Y\) be a positive assay measurement, and suppose a value is reported as censored when \(Y<L\). Under a log-normal model, \(Z=\ln(Y)\) satisfies \(Z\sim N(\mu,\sigma^2)\), with \(\sigma>0\). This model assumes that log measurements follow the specified normal distribution and that the threshold \(L\) is known for the observation. It also assumes that censoring is determined by the threshold, rather than by an unrecorded process that depends on the unobserved value in another way.

For a censored observation, the likelihood contribution is the probability of falling below the limit, not a density evaluated at an invented replacement. For an uncensored observed value \(y\), the likelihood contribution is its density under the model. For a censored value, the contribution is

$$ P(Y<L)=P(Z<\ln L) =\Phi\left(\frac{\ln L-\mu}{\sigma}\right), $$

where \(\Phi\) is the standard normal cumulative distribution function. The probability uses the full interval below \(L\), preserving the distinction between a censored and an exactly measured value.

Justification: Set \(U=(Z-\mu)/\sigma\), so \(U\sim N(0,1)\), and let \(a=(\ln L-\mu)/\sigma\). Then \(Y<L\) is equivalent to \(U<a\), whose probability is \(\Phi(a)\). If a log-scale summary is needed for censored observations, its conditional expectation is \(E[Z\mid Z<\ln L]=\mu-\sigma\phi(a)/\Phi(a)\), where \(\phi\) is the standard normal density. This is a model-based conditional mean on the log scale, not an exact measurement.

The conditional-mean formula follows by integrating the truncated standard normal density. Since \(Z=\mu+\sigma U\), its conditional expectation is \(\mu+\sigma E[U\mid U<a]\). Also, \(\phi'(u)=-u\phi(u)\), so

$$ E[U\mid U<a] =\frac{\int_{-\infty}^{a}u\phi(u)\,du}{\Phi(a)} =\frac{-\phi(a)}{\Phi(a)}. $$

Substitution gives the stated result. This calculation can support model-based summaries or imputation, but it does not replace fitting a censoring-aware model when the inferential target is a model parameter.

Worked Example: A Log-Normal Model for a Censored Value

Assume, hypothetically, that a positive measurement \(Y\) follows a log-normal model with \(\mu=\ln(10)\), \(\sigma=0.5\), and detection limit \(L=10\) units. A recorded below-limit value contributes

$$ P(Y<10) =\Phi\left(\frac{\ln(10)-\ln(10)}{0.5}\right) =\Phi(0) =0.500. $$

Thus, under these assumed parameters, a censored observation contributes 0.500 to the likelihood. It does not contribute the density for an exact measurement of 5 units, or of any other substituted value.

For a model-based conditional log-scale summary, \(a=0\), \(\phi(0)=0.3989423\), and \(\Phi(0)=0.5\). Therefore,

$$ E[\ln(Y)\mid Y<10] =\ln(10)-0.5\left(\frac{0.3989423}{0.5}\right) =2.302585-0.398942 =1.903643. $$

Exponentiating this conditional mean log value gives \(\exp(1.903643)\approx 6.710\) units. This is the exponentiated conditional mean on the log scale, not the conditional arithmetic mean \(E[Y\mid Y<10]\). The result depends on the assumed log-normal model and parameters; it is not a direct observation or a universal replacement rule.

Diagnostics, Alternatives, and Limitations

Zero handling should be treated as part of the measurement model, not as a cosmetic cleanup step. Preserve the original values and, where possible, record a separate indicator for structural absence, sampling non-detection, or censoring. Record the detection limit and its units, including whether it varies across samples or features.

  • Check zero patterns. A concentration of zeros in one assay batch or at low signal levels may suggest a threshold mechanism. A pattern tied to biological presence or applicability may support structural absence. Neither pattern alone proves the mechanism.
  • Check threshold metadata. Values recorded exactly at a stated limit, or a common pile-up at a coded value, can indicate censoring or rounding. Confirm the meaning from assay documentation.
  • Assess replacement sensitivity. For sampling zeros, recompute key log-ratios under defensible pseudocount choices. Large changes show that conclusions depend on the replacement assumption.
  • Look for artificial structure. Replacing many censored observations with one constant can create ties and reduce apparent variability. It can also alter associations among features.
  • Check model fit. Censoring-aware models still depend on distributional and threshold assumptions. Compare fitted distributions with the observed uncensored values and check whether limits and censoring rates differ systematically across groups or batches.

The main alternatives answer different needs. Explicit presence/absence methods suit structural zeros when presence itself is informative. Count-based models can represent finite sampling without pretending every zero is a small positive value. Pseudocount replacement is computationally simple when log-ratios are required and zeros are plausibly due to finite sampling, but its sensitivity should be examined. Censored likelihoods use threshold information directly, while model-based imputation can provide completed data but adds uncertainty that should not be ignored in downstream inference.

No strategy can recover information that was never observed without assumptions. A censoring-aware model may be unstable when few uncensored values are available or when the distributional form is poorly supported. A pseudocount cannot distinguish structural from sampling zeros by itself. If the zero mechanism is unknown, report that uncertainty and examine more than one plausible analysis rather than presenting one arbitrary replacement as fact.

Common pitfall: “The logarithm requires a positive number, so replace every zero by a small constant.” This reasoning addresses only the arithmetic, not the measurement process. The correction is to identify whether the zero denotes absence, non-observation, or censoring, then choose a method whose assumptions match that interpretation and assess sensitivity where the choice is uncertain.

Check Your Understanding

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

  1. A feature has zero reads in a finite sequencing library but is known to occur in the source population. Which zero type is most plausible, and does the observation prove absence?
  2. A measured value is recorded as zero because it is below a known limit \(L\). State the information this observation provides and one model-based way to use it.
  3. For counts \((0,4)\), calculate the first-to-second log-ratio after adding \(\delta=1\) to each count.
  4. Why can replacing every censored value by \(L/2\) distort an analysis?

Solutions. (1) It is a sampling zero: finite sampling missed the feature, and the observation does not prove that its underlying abundance is zero. (2) It indicates \(Y<L\), not an exact value. Under a specified measurement distribution, use the probability \(P(Y<L)\) as the censored likelihood contribution. (3) The adjusted counts are \((1,5)\), so the log-ratio is \(\ln(1/5)\approx -1.609\). (4) It assigns all censored values the same exact value, ignores their uncertainty below \(L\), and can create ties or distort variability and associations.

Clinical Biostats