Oncofusion

start / graph / concept-q114-a-ratio-gate-whose-denominator-is-zero-reports-inf-and-passes

Explainerstrong confidence 4 of 5: Replicated in peer-reviewed work by more than one group.Q114-suv39h1-at-the-locus

A pre-registered gate of the form 'signal at the top sites / median of random tiles >= 5' returns inf and PASSES on any sparse track, because the median of random 147 bp tiles in a CUT&RUN file is exactly 0.0 - the control was degenerate in three of four tracks and nothing in the output said so

also called the inf gate · a control that divides by zero · sparse tracks break ratio controls

A safety check was written as a ratio: strong signal divided by typical background. In these files the typical background is exactly zero, so the ratio came out as infinity, which is larger than any threshold - the check reported a pass while measuring nothing at all.

The same thing, for a scientist

**The defect, measured.** The Q114 pre-registration fixed a dynamic-range gate before any data were read [E1]: > **C1.** `mean(top 0.1% of the track's own class-matched anchor windows) / median(N2 random 147 bp tiles) >= 5` In the GSE225028 CUT&RUN tracks, **57.7% to 71.1% of random 147 bp tiles are uncovered**, so the median is **exactly 0.0** in three of the four files [E2]. `top / 0` is `inf` in IEEE-754 floating point, `inf >= 5` is `True`, and the gate wrote `"passes": true` into `results_bigwig.json` beside a ratio of `Infinity`. **A reader skimming the control column sees a pass.** **Recomputed against a denominator that exists** - the *mean* of the same tiles - the tracks do have dynamic range: **22.2x, 21.3x, 16.5x, 18.2x**. So the conclusion the gate was protecting survives. **That is the point: the failure was silent and it happened to be harmless, which is the combination that lets it recur.** **Why the median was chosen and why that was wrong here.** A median is the right centre for a skewed signal distribution and is what a fold-over-background statistic normally uses. It is wrong the moment the distribution is **zero-inflated**, which sparse-assay tracks routinely are: CUT&RUN, low-input ChIP, single-cell pseudobulk, and any track whose producer wrote only covered intervals. The pre-registration required a per-file NaN probe and a per-file modal-run-length check and did not require a per-file check that **the denominator of its own gate is non-zero**. **The general form, which is the part worth keeping.** *Any* threshold expressed as a ratio needs the denominator's distribution checked before the threshold is fixed. Three failure modes, all silent: | denominator | ratio | what the gate reports | |---|---|---| | exactly 0 | `inf` | **passes**, always | | very small | enormous | **passes**, and looks like a strong result | | 0 with a 0 numerator | `nan` | `nan >= 5` is `False` - **fails**, always | The first and third are opposite errors from the same cause. This graph has already recorded three instruments that reported a property of themselves rather than of the data - a coverage metric that counted a link near the thing, a fallback that constructed the accession it was looking for, a bounded query that could not return a one. **A ratio gate on a zero-inflated denominator is the fourth.**

Go deeper
What to do instead
  1. Print the denominator next to the ratio, always. results_bigwig.json records median_N2: 0.0 beside ratio: Infinity, which is how this was caught at all. A gate that reports only its verdict is unauditable.
  2. Assert the denominator before fixing the threshold. One line: if the pre-registered denominator is zero or within an order of magnitude of zero for the track class you are about to use, choose a different centre in the pre-registration, not afterwards.
  3. Report the fraction of zeros in the null. 57.7-71.1% here. That number alone tells a reader which centre statistics are usable.
  4. When it does fire, do not silently re-tune. Record the degenerate value, recompute against a stated alternative, label the alternative post-hoc, and leave both numbers in the output. The original inf is still in results_bigwig.json.
The related trap in the same run, which ran the other way

The same pre-registration's Question A scored occupancy as mean >= 2 x median(N2). With median(N2) = 0, every interval with any signal at all passes - the opposite error, and this one would have produced a FALSE POSITIVE rather than a harmless pass. It was caught for the same reason and scored against the tile mean instead, which is deviation D5.

So one zero denominator produced a vacuous pass in a gate and would have produced a vacuous positive in the primary endpoint. Both from the same unchecked line.

Facts and figures
failure modea ratio-form threshold whose denominator is a median over a zero-inflated distribution
reported by the gateratio = Infinity, passes = true, in three of four tracks
second instance same causeQuestion A's OCCUPIED rule, mean >= 2 x median(N2), would have passed every interval with any signal - a false positive rather than a vacuous pass
rule of thumbprint the denominator beside every ratio; assert it is non-zero before the threshold is fixed; report the fraction of zeros in the null
observed denominators
GSM70375310.000GSM7037531: 0GSM70375320.000GSM7037532: 0GSM70375300.000GSM7037530: 0GSM70375290.742GSM7037529: 0.7415
fraction of random tiles uncovered
GSM70375290.367GSM7037529: 0.3668GSM70375300.577GSM7037530: 0.5766GSM70375310.640GSM7037531: 0.6397GSM70375320.711GSM7037532: 0.7114
repaired ratio over tile mean
GSM703752916.5GSM7037529: 16.5GSM703753018.2GSM7037530: 18.2GSM703753221.3GSM7037532: 21.3GSM703753122.2GSM7037531: 22.2
observed denominators — the numbers behind the chart
{
  "GSM7037531": 0,
  "GSM7037532": 0,
  "GSM7037529": 0.7415,
  "GSM7037530": 0
}
fraction of random tiles uncovered — the numbers behind the chart
{
  "GSM7037531": 0.6397,
  "GSM7037532": 0.7114,
  "GSM7037529": 0.3668,
  "GSM7037530": 0.5766
}
repaired ratio over tile mean — the numbers behind the chart
{
  "GSM7037531": 22.2,
  "GSM7037532": 21.3,
  "GSM7037529": 16.5,
  "GSM7037530": 18.2
}
affected track classes
[
  "CUT&RUN",
  "low-input ChIP",
  "single-cell pseudobulk",
  "any track written with only covered intervals or with explicit zeros"
]
How this could bite us back
  • A control that passes vacuously is more dangerous than one that fails, because a failure gets investigated. Any entry in this corpus quoting a control as passed should be checked for whether the control could have failed at all on the data it was run against.
Still open
  1. How many ratio-form thresholds are already stored in this corpus's analyses with an unchecked denominator? A grep for fold_over, over_median and ratio across analyses/ would give the exposure, and it was not run by this beat.
  2. Should the standard Q-series pre-registration template carry a mandatory denominator assertion? The template already mandates a NaN probe and a modal-run-length check per file; this is the same class of per-file precondition and is one line.
Every source behind this entry (2)
  1. E1strong confidence 4 of 5: Replicated in peer-reviewed work by more than one group.dataset

    The C1 gate and the Question-A fold threshold were both written as ratios over the median of random 147 bp tiles, on disk, before any signal was read.

    What this evidence cannot show

    This is a defect in a control written by the same agent that found it, in the same session. It is recorded because the failure mode generalises, not because the instance was consequential - the conclusion it guarded survived the repair.

    Evidence that argues against this (1)
    • A median is the correct centre for most fold-over-background statistics and the pre-registration was following normal practice. The lesson is not 'never use a median' but 'check the denominator for the track class you are about to apply it to'. source
  2. E2established confidence 5 of 5: Multiple independent lines of evidence; treated as settled in the field.dataset

    In the four GSE225028 CUT&RUN bigWigs, 57.7-71.1% of 200,000 random 147 bp tiles are uncovered and the median is exactly 0.0 in three of the four files; recomputed against the tile mean, the top 0.1% of anchor windows is 22.2x, 21.3x, 16.5x and 18.2x.

    What this evidence cannot show

    The zero fraction is a property of these particular deposits' processing - the producer wrote explicit zero-valued records, so 'uncovered' here means 'covered with value 0', which is why the NaN/fillna probe returned identical values in all three modes. A track that omitted uncovered intervals entirely would give the same median by a different route.

    Evidence that argues against this (1)
    • A 22x dynamic range over the tile MEAN is not the same statement as a 22x range over the tile median, and the two are not interchangeable across track types. The repaired gate is weaker than the one that was pre-registered, not merely different. source
Connected to