576 Who Makes the Peak

A ChIP-, CUT&Tag- or DiMeLo-style “peak” is reported as a place on the genome where something is bound. It is the output of a procedure:

\[ \text {peak} \;=\; (\text {counting unit}) \times (\text {coordinate system}) \times (\text {bin}) \times (\text {background}) \times (\text {threshold}). \]
This subsection feeds a source that is flat by construction into every layer of that product, and records where peaks appear.
576.0.1 A source with nothing in it

Reads were drawn uniformly from T2T-CHM13 chromosome 22, which contains no gaps, with \(10\%\) nanopore-like substitution and indel noise; a second, independent uniform draw served as the control. Of the read origins, \(18.5\%\) have no corresponding coordinate in hg38 under the UCSC CHM13\(\to \)hg38 chain — they come from sequence that hg38 records as N (\(22.94\%\) of hg38 chr22) or does not contain.

Below the reads, a further system was built with no reads, no sequence and no aligner at all: \(5{,}000\) points placed uniformly on the non-N positions of hg38 chr22.

Every system was passed through the same \(272\) peak procedures: bin width \(1, 5, 10, 50, 100\) kb with up to four bin origins each; background from the global mean, a local window of \(\pm 2\) or \(\pm 5\) bins, or the control sample; and a Poisson threshold at \(p<10^{-3}\) or \(p<10^{-5}\), Benjamini–Hochberg \(q<0.05\), or a fold change \(\geq 2\).

576.0.2 The threshold decides whether a flat source has peaks

On the uniform points — no biology, no reads, no reference sequence — \(29\%\) of the \(272\) procedures return at least one peak, up to \(45\). The split is entirely by threshold rule:

Threshold Procedures with \(\ge 1\) peak Median peaks
fold \(\ge 2\) \(0.735\) \(3\)
\(p < 10^{-3}\) \(0.426\) \(0\)
\(p < 10^{-5}\) \(0.000\) \(0\)
BH \(q < 0.05\) \(0.000\) \(0\)

The default procedure (\(10\) kb, global background, \(p<10^{-3}\)) returns \(2\) peaks against \(3.9\) expected by chance across the \(3{,}900\) bins. Whether a source with no structure “has peaks” is answered by the choice between a corrected and an uncorrected rule, not by the source. Bin width and origin move the fraction from \(0.03\) to \(0.44\) without changing a single point.

576.0.3 The counting unit decides what counts as independent

The same uniform reads, aligned to hg38 chr22, were counted five ways. The Poisson test assumes each count is an independent event; the unit decides whether that holds.

Counting unit Counts Procedures with peaks Default peaks
read start \(4{,}688\) \(0.919\) \(29\)
read midpoint \(4{,}688\) \(0.938\) \(30\)
read cut into \(2\) \(9{,}049\) \(0.978\) \(56\)
read cut into \(4\) \(16{,}750\) \(0.996\) \(134\)
read cut into \(8\) \(26{,}859\) \(0.993\) \(337\)
bases covered \(13{,}798\) \(1.000\) \(104\)
read length \(500\) bp \(4{,}138\) \(0.824\) \(23\)
read length \(10\) kb \(983\) \(0.886\) \(15\)

Cutting each read into \(m\) pieces — what a different segmentation of the same current would have produced — multiplies the peak count by more than ten at \(m=8\). The pieces of one molecule land together, and a test that treats them as independent reports their adjacency as enrichment.

576.0.4 The coordinate system decides where reads go

The same CHM13-origin reads were aligned to five references:

Reference Correct Misplaced Unplaced Off chr22 Placed, no true coordinate
CHM13 chr22 \(0.946\) \(0.053\) \(0.001\) — —
hg38 chr22 soft-mask \(0.699\) \(0.085\) \(0.062\) — \(0.154\)
hg38 chr22 hard-mask \(0.609\) \(0.050\) \(0.299\) — \(0.042\)
hg38 primary (25) \(0.709\) \(0.104\) \(0.003\) \(0.248\) \(0.183\)
hg38 full (455) \(0.688\) \(0.127\) \(0.002\) \(0.281\) \(0.183\)

When only hg38 chr22 is offered, \(15.4\%\) of reads are placed on it although their origin has no hg38 coordinate: sequence missing from the reference is deposited onto whatever in the reference resembles it. Of the reads placed on chr22 when chr22 alone is offered, \(939\) (\(18.8\%\)) go to another chromosome when the whole genome is offered — chr21 (\(258\)), chr4 (\(200\)), chr14 (\(104\)), chr13 (\(86\)), chr10 (\(69\)), chrY (\(67\)). Their median MAPQ on the chr22-only reference is \(1\), but \(16.7\%\) are reported at MAPQ \(60\).

The consequence for peaks is direct. With the default procedure:

Reference Default peaks Expected by chance Ratio
uniform points (no reference) \(2\) \(3.9\) \(0.5\)
CHM13 chr22 (the true origin) \(4\) \(5.1\) \(0.8\)
hg38 chr22 hard-mask \(13\) \(3.7\) \(3.5\)
hg38 chr22, MAPQ \(\ge 30\) \(17\) \(3.9\) \(4.4\)
hg38 chr22 soft-mask \(29\) \(3.9\) \(7.4\)

The same reads, placed on the reference they came from, give the number of peaks expected from a flat source. Placed on hg38, they give seven times as many. The excess is made by the mismatch between the coordinate system of the source and the coordinate system of the analysis.

576.0.5 The extent of the coordinate system decides the background

Offered the whole genome, the same chr22-origin reads give \(1{,}165\) default peaks, and on chr22 itself \(9{,}730\) peak cells against \(290\) under the chr22-only reference (Jaccard \(0.015\)). Nothing about the reads changed. The global background is the total count divided by the genome length, and enlarging the denominator from one chromosome to twenty-five makes the whole of chr22 exceed it. Which contigs are in the reference is a choice about what the background is.

576.0.6 Peaks do not survive a change of coordinates

The \(40\) default peak cells called on CHM13 chr22 were lifted to hg38. Nineteen (\(47.5\%\)) have an hg38 coordinate at all; of those, none falls inside an hg38 peak. Across the \(272\) procedures on any one system, the median Jaccard overlap between two procedures’ peak sets is \(0.00\)–\(0.08\): different procedures applied to the same counts select almost disjoint bins.

576.0.7 Summary

Layer Varied Effect on a flat source
threshold four rules peaks present or absent
bin width \(\times \) origin fraction with peaks \(0.03\)–\(0.44\)
counting unit start, midpoint, pieces, cover default peaks \(23\) to \(337\)
reference version CHM13 vs hg38 default peaks \(4\) vs \(29\)
reference extent chr22 vs genome background diluted; \(290\) vs \(9{,}730\) cells
reference masking soft vs hard \(29.9\%\) of reads unplaced
coordinate change CHM13 \(\to \) hg38 liftover \(0\) of \(19\) peaks retained

Every input here is flat. The peaks that appear are made by the threshold, the counting unit, the reference and its extent — and when the reference matches the source and the threshold is corrected, none appear.

pict

Figure 746: Peaks from a source with no structure. (a) Fraction of \(272\) peak procedures that return at least one peak, for \(18\) systems built from uniform input: points with no reads or reference (top), reads counted by different units, and reads aligned to five references at two MAPQ cutoffs. (b) Peak count on the uniform points for each bin width and origin (rows) and each background and threshold (columns). Only uncorrected rules return peaks. (c) Fate of CHM13-origin reads under each reference: correct, misplaced and unplaced, with the fraction placed although their origin has no coordinate in that reference. (d) Overlap of default-procedure peak cells on hg38 chr22 between systems.
Data and code

hg38 (hg38.fa.gz, UCSC) and T2T-CHM13 chr22 (hs1.fa.gz, UCSC) with the UCSC hs1ToHg38.over.chain.gz. Reads were simulated uniformly from CHM13 chr22 with \(10\%\) error (\(50\%\) substitutions, \(25\%\) deletions, \(25\%\) insertions) and aligned with mappy (minimap2, map-ont). Liftover by pyliftover. Script peaks_unbuild.py; per-procedure counts in peaks_unbuild.csv.

576.1 Positions Without Integers

The preceding subsection varied the reference while keeping one assumption fixed: that a position on a genome is an integer, that the distance between two positions is the difference of their integers, and that the size of a region is its number of bases. This subsection removes that assumption in stages. The input is again flat by construction — \(6{,}000\) read origins drawn uniformly from T2T-CHM13 chromosome 22, of which \(18.2\%\) have no coordinate in hg38.

576.1.1 Read model and aligner

The same \(6{,}000\) origins were given three error models — uniform \(10\%\), a nanopore-like model in which homopolymer runs shorten in proportion to their length on a \(6\%\) background, and no error — and aligned to hg38 chr22 by seven aligner configurations. Peaks were called with the default procedure (\(10\) kb, global background, Poisson \(p<10^{-3}\)) and compared with the \(3.9\) expected by chance.

Read model Aligner Correct Misplaced Unplaced Placed, no coordinate Peaks / chance
error-free minimap2 map-ont \(0.705\) \(0.098\) \(0.016\) \(0.182\) \(\mathbf {12.7}\)
ONT-like minimap2 map-ont \(0.704\) \(0.082\) \(0.058\) \(0.156\) \(11.4\)
ONT-like minimap2 map-pb \(0.704\) \(0.084\) \(0.059\) \(0.152\) \(10.7\)
uniform 10% minimap2 map-ont \(0.704\) \(0.083\) \(0.062\) \(0.151\) \(10.4\)
ONT-like bwa mem ont2d \(0.704\) \(0.106\) \(0.008\) \(0.182\) \(10.4\)
ONT-like winnowmap \(0.702\) \(0.058\) \(0.134\) \(0.106\) \(7.4\)
ONT-like lra \(0.705\) \(0.064\) \(0.148\) \(0.083\) \(7.1\)
ONT-like minimap2 map-hifi \(0.703\) \(0.042\) \(0.181\) \(0.074\) \(5.8\)
ONT-like minimap2 asm20 \(0.704\) \(0.041\) \(0.178\) \(0.077\) \(5.6\)

The fraction placed correctly is \(0.70\) in every row; it is set by the reference, not by the aligner or the read. What varies is what happens to the remainder. Aligners that place every read — bwa ont2d leaves \(0.8\%\) unplaced — deposit the reads that have no hg38 coordinate onto sequence that resembles their origin, and those deposits are the peaks. Aligners that refuse — map-hifi, asm20 — leave \(18\%\) unplaced and return half as many peaks.

The read model runs the other way from intuition. Error-free reads give the most peaks: a read with no errors is placed with full confidence, including when the place it is put does not exist in its source. Improving the reads makes the artefact larger.

576.1.2 What a position is

The placements from one configuration (ONT-like reads, map-ont) were held fixed and only the mathematical structure of “position” was changed:

Structure A position is Size of a region is
\(\mathbb {Z}\), non-N measure an integer bases that are not N
\(\mathbb {Z}\), Lebesgue measure an integer all bases, N included
\(\mathbb {Z}\), repeat-excluded measure an integer bases not soft-masked as repeat
gap-compressed \(\mathbb {Z}\) an integer after deleting N bases
set-valued a set of loci, weight \(1/n\) each bases
CHM13 \(\mathbb {Z}\) an integer in the source assembly bases
counting measure the rank of the read number of reads
ultrametric tree a leaf of a dyadic tree a node; background is its sibling
graph a pair (segment, offset) bases along a segment

Structure Procedures with peaks Default peaks Peaks / chance
\(\mathbb {Z}\), repeat-excluded measure \(1.000\) \(66\) \(17.8\)
\(\mathbb {Z}\), non-N measure (standard) \(1.000\) \(45\) \(11.4\)
gap-compressed \(\mathbb {Z}\) \(1.000\) \(43\) \(11.0\)
\(\mathbb {Z}\), Lebesgue measure \(1.000\) \(45\) \(8.9\)
set-valued \(1.000\) \(29\) \(7.4\)
graph (segment, offset) \(0.917\) \(13\) \(2.8\)
ultrametric tree \(1.000\) \(4\) \(1.7\)
CHM13 \(\mathbb {Z}\) \(0.312\) \(0\) \(0.0\)
counting measure \(0.000\) \(0\) \(0.0\)

The reads and their placements are identical in every row. Declaring repeats to have no length concentrates the same counts into fewer bases and raises the excess to \(17.8\); counting N as length raises the expectation and lowers it to \(8.9\); distributing each ambiguous read over its candidate loci lowers it to \(7.4\). In the source assembly’s own integers there are no peaks at all. Under the counting measure — in which the size of a region is the number of reads in it — there cannot be any: every region has exactly the density it has, and enrichment is undefined.

A peak is an excess of reads over the size of a region. The size of a region is a measure, and the measure is chosen.

576.1.3 A position with no integer

A pangenome graph of chromosome 22 was built from hg38 and CHM13 with minigraph. It has \(866\) segments; \(282\) of them, totalling \(489{,}353\) bp, have no hg38 coordinate — a read placed there has a position that is a pair (segment, offset) and no integer.

Fraction
reads mapped to the graph \(0.783\)
reads starting on a non-hg38 segment \(0.014\)
reads passing through a non-hg38 segment \(0.020\)

The graph does not rescue the reads that hg38 could not place. Of the \(18.2\%\) of origins without an hg38 coordinate, most lie in sequence that minigraph does not add to the graph, because it admits new sequence only where both ends anchor to the existing backbone. The graph is itself the output of an aligner, and it inherits that aligner’s decision about what counts as placeable.

On the graph the default procedure returns \(13\) peaks against \(4.7\) expected. One of them lies on a non-hg38 segment, at a position that has no integer. The peak cells on hg38 segments overlap the linear hg38 peaks with Jaccard \(0.161\).

576.1.4 Two points, two distances

On the line, the distance between two positions is the difference of their integers. On the graph, two positions flanking a bubble are joined by two paths:

Value
bubbles \(372\)
bubbles with \(\ell _{\rm ref} \neq \ell _{\rm alt}\) \(372\) (\(100\%\))
median \(|\ell _{\rm ref} - \ell _{\rm alt}|\) \(172\) bp
90th percentile \(1{,}361\) bp
maximum \(101{,}588\) bp

In every bubble, the distance between the two flanking points depends on the path. “How far apart are two loci” has no answer until a haplotype is chosen; a bin of “\(10\) kb” has no fixed extent across a bubble; and a local background computed over “neighbouring” bins presupposes a neighbourhood the graph does not supply. The integer coordinate is not a property of the chromosome. It is a property of one path through it.

576.1.5 Summary

Layer Varied Peaks / chance on a flat source
read model uniform, ONT-like, error-free \(10.4\) – \(12.7\)
aligner seven configurations \(5.6\) – \(12.7\)
measure on \(\mathbb {Z}\) non-N, Lebesgue, repeat-excluded \(8.9\) – \(17.8\)
point vs. set best hit vs. \(1/n\) \(11.4\) vs. \(7.4\)
frame hg38 vs. CHM13 integers \(11.4\) vs. \(0.0\)
topology line, tree, graph \(11.4\), \(1.7\), \(2.8\)
measure itself bases vs. reads \(11.4\) vs. undefined

Nothing in the input varies across these rows. Every peak that appears is assigned by a choice of what a position is, what a distance is, and how large a region is — and in the frame the reads came from, there are none.

pict

Figure 747: Peaks from a flat source under changes of read model, aligner and the definition of position. (a) Default peaks divided by the number expected by chance, for three error models and seven aligner configurations on the same \(6{,}000\) origins. (b) The same placements under nine definitions of position and measure. (c) Reads and peaks on graph segments that have no hg38 coordinate. (d) For each of \(372\) bubbles in the chr22 pangenome graph, the difference between the reference and alternative path lengths joining the same two flanking points.
Data

hg38 chr22 and T2T-CHM13 chr22 (UCSC); CHM13\(\to \)hg38 chain hs1ToHg38.over.chain.gz. Aligners: minimap2 via mappy, bwa mem, winnowmap with a \(k=15\) meryl repeat list, lra; graph built and queried with minigraph (-cxggs; -cx lr –vc). The nanopore-like model shortens each homopolymer run of length \(L\ge 2\) by \(\mathrm {Binomial}(L-1, \min (0.06(L-1),0.5))\) bases and lengthens it by one with probability \(0.02\min (L,6)\), before \(6\%\) background substitution and indel error. Script graph_unbuild.py; results in graph_unbuild.csv.