671 Rebuilding the Sequence Layer

The released products of a sequencing run are strings over four letters, partitioned into named intervals, each interval carrying a type and a function. This subsection removes all of those — the letters, the partition, the names, the types, and the distinction between the two kinds of molecule — and reconstructs what remains from instrument output alone.

Two instruments are used, and nothing else. No reference sequence, no annotation file, no database, no synthetic data.

Table 1161: Sources. Every number in this subsection derives from these files.
layer file provenance
channel intensities image 15179941 IDR idr0170, Rose et al.
37 isotope channels, \(771\times 527\) MIBI-TOF, small-cell lung tumour
ionic current duplex_reads.pod5 nanoporetech/remora
mod_reads.pod5 nanoporetech/remora
can_reads.pod5 nanoporetech/remora
filtered.pod5 nanoporetech/dorado
duplex.pod5 nanoporetech/dorado
split_read.pod5 nanoporetech/dorado
comparison only gencode.v44.transcripts.fa.gz GENCODE release 44
671.0.1 Why the distributed file cannot be used

A FASTA file cannot serve as the starting point. Its symbols have already been quantised to four classes by the basecaller, so re-encoding it over a larger alphabet returns the same four.

Table 1162: Re-encoding a distributed four-letter file. Source gencode.v44.transcripts.fa.gz, first \(2{,}000{,}000\) symbols; \(w\) is the number of consecutive symbols grouped before clustering.
\(k\) \(w\) length entropy (bits) distinct 6-grams
2 1 2 000 000 1.000 64
3 1 2 000 000 1.496 729
4 1 2 000 000 1.981 3 800
5 1 2 000 000 1.981 3 800
8 1 2 000 000 1.981 3 800
16 1 2 000 000 1.981 3 800
4 2 1 000 000 1.981 4 027
8 2 1 000 000 2.946 21 716
16 2 1 000 000 3.922 23 447

Entropy is identical for every \(k \geq 4\): there are only four distinct input values. The apparent stability of the four-letter alphabet is a property of the file format. Grouping symbols into pairs restores the ability to distinguish more classes, confirming the diagnosis.

671.0.2 The adjacency table an instrument returns

An imaging instrument records intensities. It does not record a distance, an angle or a dimension; those appear when the record is embedded.

From the MIBI image, all \(37\) channels were retained, tissue pixels selected by total intensity (\(60{,}859\) of \(406{,}317\)), and \(300\) sampled. Adjacency was defined as mutual \(6\)-nearest-neighbour status in channel space, with pixel coordinates never used: \(280\) mutual pairs, degree \(0\) to \(6\), median \(1\), graph diameter \(20\) hops.

Table 1163: One measured adjacency table under seven geometries. Stress is the normalised residual between embedded and graph distances; the angle sum is the mean over \(400\) random triangles.
embedding dim stress angle sum
Euclidean \(\mathbb {R}^{2}\) 2 0.3281 \(180.0^{\circ }\)
Euclidean \(\mathbb {R}^{3}\) 3 0.2423 \(180.0^{\circ }\)
Euclidean \(\mathbb {R}^{5}\) 5 0.1648 \(180.0^{\circ }\)
Euclidean \(\mathbb {R}^{10}\) 10 0.0990 \(180.0^{\circ }\)
Euclidean \(\mathbb {R}^{20}\) 20 0.0594 \(180.0^{\circ }\)
Hyperbolic \(\mathbb {H}^{2}\) 2 0.3315 \(< 180^{\circ }\)
Spherical \(\mathbb {S}^{2}\) 3 0.9979 \(> 180^{\circ }\)
non-metric (order only) 2 0.9514 undefined

The plane and the hyperbolic disc fit the same \(280\) records to within \(1\%\) in stress, \(0.3281\) against \(0.3315\). Whether the angles of a triangle sum to \(180^{\circ }\) is fixed by the space chosen to hold the table, before any comparison with measurement. Euclidean stress falls monotonically with dimension and has no distinguished stopping point.

Table 1164: Intrinsic dimension of the same table, by estimator.
estimator dimension
maximum likelihood, \(k = 6\) 2.58
maximum likelihood, \(k = 12\) 2.30
maximum likelihood, \(k = 30\) 2.82
principal components, \(90\%\) variance 9
principal components, \(95\%\) variance 10
principal components, \(99\%\) variance 10

The two families disagree by a factor of four on the same records.

671.0.3 How many classes the current asks for

The \(65\) nanopore reads supply \(8.9\) million current samples, \(-914.2\) to \(916.6\) pA. Each read was normalised by its own median and scaled deviation, divided at change points of a windowed \(t\) statistic, and each interval reduced to its mean level: \(768{,}518\) events, levels \(-5.05\) to \(3.60\).

Table 1165: Classes selected from pooled event levels by Gaussian mixture. \(\Delta \)BIC is relative to the minimum.
\(k\) BIC \(\Delta \)BIC   \(k\) BIC \(\Delta \)BIC
1 483 250 38 656   9 447 131 2 537
2 447 853 3 259   10 446 670 2 076
3 448 723 4 129   11 446 208 1 614
4 448 965 4 371   12 445 218 623
5 448 727 4 132   13 444 976 381
6 448 428 3 834   14 444 866 272
7 448 160 3 566   15 444 594 0
8 447 594 2 999   16 444 599 5

The minimum is at \(k = 15\). Four is the worst of the sixteen values tested, \(4371\) units above the minimum and worse than \(k = 2\), \(k = 3\) and every value from \(5\) upward. The current does not separate into four levels.

671.0.4 The same read over eight alphabets

One read of \(65{,}542\) events was encoded over alphabets of several sizes, classes ordered by current level and otherwise unnamed.

Table 1166: One read re-encoded from current. Compression is the deflate ratio on the symbol stream.
\(k\) entropy (bits) compression distinct 6-grams
2 0.975 0.1548 64
3 1.584 0.2335 729
4 1.951 0.2841 3 834
5 2.280 0.3259 11 059
6 2.504 0.3564 20 288
8 2.889 0.4067 39 919
12 3.362 0.4680 57 796
16 3.634 0.5052 62 431

Every quantity rises smoothly and nothing marks \(k = 4\). Compare Table 1162, where the same quantities were flat above \(k = 4\) because the input had already been quantised.

Within a fixed \(k\) the names remain free. For \(k = 4\) there are \(24\) assignments of four labels to four level-ordered classes, all equally consistent with the current. In a trained basecaller the assignment is fixed by reads whose strings were known in advance.

671.0.5 Intervals without an annotation

Encoding the full stream at \(k = 4\) gives \(768{,}518\) symbols over four unlabelled classes. Composition was computed in windows of \(400\) symbols (\(1921\) windows), and intervals defined by change points in that composition. No database, no gene list, no type vocabulary.

Table 1167: Partitioning the symbol stream. Left: mixture models on window composition. Right: a percentile threshold on the composition change statistic.
\(k\) BIC intervals median len.   threshold intervals median len.
2 \(-37\,362\) 273 800   50th pct 960 400
3 \(-38\,091\) 275 800   70th pct 574 800
4 \(-37\,915\) 668 400   80th pct 382 1 200
6 \(-38\,114\) 772 400   90th pct 192 2 200
8 \(-38\,164\) 911 400   95th pct 95 3 200
12 \(-37\,895\) 1 192 400   99th pct 20 2 600
16 \(-37\,503\) 1 351 400  
24 \(-36\,964\) 1 461 400  

The mixture criterion selects \(k = 8\) and \(911\) intervals. Moving the change-point threshold from the median to the \(99\)th percentile takes the count from \(960\) to \(20\), a factor of \(48\). There is no threshold at which the partition stabilises.

671.0.6 Counting the reads against each partition

Each of the \(65\) reads occupies a definite span of the concatenated stream, given by its own event count. Reads were counted against each partition at their own offsets; no positions were generated.

Table 1168: The same \(65\) reads counted against six partitions of the same stream.
partition intervals reads/interval CV of abundance
50th percentile 960 1.07 0.481
70th percentile 574 1.11 0.656
80th percentile 382 1.16 0.778
90th percentile 192 1.33 0.966
95th percentile 95 1.67 1.094
99th percentile 20 4.20 0.757

The read set is identical throughout. The dispersion of abundance more than doubles across partitions, from \(0.481\) to \(1.094\), and is not monotone in the threshold.

671.0.7 Provenance of every quantity

Table 1169: What was recorded and what was added.
quantity status determined by
channel intensities observed 37 isotope channels, MIBI 15179941
ionic current observed picoamperes per sample, pod5 records
distance supplied a metric imposed on the neighbour table
dimension supplied embedding target, or choice of estimator
curvature supplied flat, negative and positive all fit
angle supplied defined only after an inner product
event boundary supplied a change-point threshold
alphabet size supplied a clustering parameter
symbol names supplied training on strings already known
interval boundary supplied a change-point threshold
interval name supplied a separately maintained file
interval type supplied a vocabulary of about forty categories
the two kinds of molecule supplied a library protocol, not a signal property
interval count emergent 20 to 960 across thresholds
abundance computed counts over a supplied partition

Two quantities were recorded: intensity per channel, and current per sample. Everything named in the released products — the four letters, the intervals, their boundaries, their names, their types, and the division of the material into two kinds — enters at a later stage. At the two stages where letters and intervals are fixed, what enters is a table fitted to results already in hand.

Data and code

MIBI-TOF image 15179941, IDR project idr0170 (Rose et al.), retrieved through the OMERO web gateway, \(37\) channels rendered individually at each channel’s own display window. Nanopore pod5 records from the test data of nanoporetech/remora and nanoporetech/dorado, \(65\) reads of at least \(3000\) samples. GENCODE release 44 transcript file used only for Table 1162. Analysis script rebuild_all.py; figure fig_rebuild.pdf. The only random draws are the selection of \(300\) pixels from \(60{,}859\), the selection of \(400\) triangles for the angle sum, and subsampling of \(200{,}000\) events for the mixture fits; no values are generated.

pict

Figure 871: Reconstruction from two instruments. Top: the MIBI neighbour table under seven geometries, and its embedding in the Euclidean plane and the Poincaré disc. Middle: classes selected from pooled nanopore event levels with \(k=4\) marked, entropy and compressibility against alphabet size, and window composition with interval boundaries. Bottom: interval count and median length against change-point threshold, and the resulting dispersion of abundance.

671.1 Intensity Is an Integral

Every layer above rests on a number called an intensity, and an intensity is not a reading. It is an integral of a signal over a domain — a time window, a band of wavelengths, an area of detector — and the domain is chosen. This subsection varies the domain and measures what the choice decides.

671.1.1 The domain is not in the file

Two of the three integration domains are fixed before storage and are not recorded. The instrument disperses the emission onto a detector array, integrates each bin, and writes four numbers. The bin count, the bin edges, the efficiency curve and the per-channel scale are all applied upstream of the file.

quantity fixed by recorded
number of spectral bins detector and binning mode no
where the bin edges fall grating alignment no
efficiency as a function of wavelength detector type no
per-channel scale dye brightness, unequal no
the spectrum itself — no
the four integrated values — yes

Since none of it is distributed, the forward map was built. Four overlapping emitters were defined on a \(0.1\) nm grid, a known assignment was drawn for \(6000\) sites, the spectrum was integrated over a bin grid under an efficiency curve with shot and read noise, and the four integrated values were deconvolved and reduced by argmax. The truth is therefore known and the error can be measured, not merely the disagreement.

671.1.2 The number of bins

bins \(K\) error against truth letters differing from \(K=20\)
\(4\) \(\mathbf {7.82\%}\) \(\mathbf {8.43\%}\)
\(6\) \(0.82\%\) \(1.65\%\)
\(8\) \(0.75\%\) \(1.48\%\)
\(12\) \(\mathbf {0.45\%}\) \(1.32\%\)
\(16\) \(0.78\%\) \(1.62\%\)
\(20\) \(1.07\%\) —
\(24\) \(1.00\%\) \(1.80\%\)
\(32\) \(1.58\%\) \(2.40\%\)
\(48\) \(2.68\%\) \(3.42\%\)

The curve has an interior optimum: wide bins lose spectral resolution, narrow bins lose signal to read noise, and the minimum sits near twelve. Four bins — the number the file keeps — is seventeen times worse than the optimum and seven percentage points above it.

cost of storing four instead of twenty \(7.03\) percentage points
positions the discarded bins would have decided differently \(8.67\%\)
671.1.3 Where the edges fall, and what the detector is

Holding the bin count fixed and moving only the grid, or only the efficiency curve, or only the per-channel scale:

domain varied setting error letters changed
bin edges offset \(0.10\) \(0.87\%\) \(2.18\%\)
bin edges offset \(0.25\) \(1.25\%\) \(2.48\%\)
bin edges offset \(0.50\) \(0.83\%\) \(2.15\%\)
efficiency flat \(0.47\%\) \(1.45\%\)
efficiency linear tilt \(0.60\%\) \(1.53\%\)
efficiency photomultiplier \(1.70\%\) \(2.60\%\)
channel scale unit maximum \(1.10\%\) \(1.87\%\)
channel scale unit \(\ell _2\) \(0.83\%\) \(1.63\%\)
channel scale unit median \(0.95\%\) \(1.73\%\)

Each domain moves about two percent of the assignments while leaving the error rate almost unchanged. They are not better or worse; they are different, and nothing in the record selects one.

The third block is the sharpest. Reduction by argmax requires the four numbers to lie on one scale, and they do not: the signal-to-noise ratio per emitter was measured earlier to differ by factors of \(1.67\) to \(2.58\) across instruments, with a different emitter dimmest on each. No scale is supplied with the data, and three defensible normalisations disagree on two percent of assignments.

671.1.4 The whole grid

Every combination of bin count, edge offset, efficiency curve and channel scale was run.

forward maps \(180\)
error against truth \(0.17\%\) to \(72.10\%\)
median error \(1.05\%\)
mean fraction of maps returning the truth at a site \(0.9232\)
sites receiving one answer across all maps \(\mathbf {0.0000}\)

No site among six thousand receives the same assignment under every forward map. The extreme of the error range is contributed by pathological combinations; the median map is accurate to one percent. The finding is not that the reduction is unreliable — most maps are accurate — but that no site is invariant, and the record does not say which map was used.

671.1.5 The same variation in the distributed traces

The four deposited traces of §635 were re-read under \(63\) definitions of the peak intensity: point value, maximum, mean, sum and moment-normalised amplitude, over windows of one to eight samples, after three baseline treatments.

trace definitions disagreement with the deposited call reproducing it exactly
310 \(63\) \(32.6\%\) to \(40.5\%\) \(0\)
3100 \(63\) \(2.6\%\) to \(17.8\%\) \(0\)
3730 \(63\) \(1.2\%\) to \(7.3\%\) \(0\)
A6_1-DB3 \(63\) \(2.4\%\) to \(17.7\%\) \(0\)

Not one of the sixty-three definitions reproduces the deposited call in any trace. The elevated floor for the first trace is largely the deposited ambiguity calls, which an argmax cannot return. Five of the sixty-three definitions are ill-posed after baseline subtraction and are excluded from the ranges above.

671.1.6 What the layer rests on

statement what it presupposes
“the intensity in channel \(k\)” a window in time, wavelength and area
“the four channels” a bin count, chosen; edges, chosen
“channel \(k\) is the largest” a common scale, not supplied
“the base is \(k\)” all of the above, none recorded

what the file contains four integrated numbers per position
what the detector produced of order twenty
cost of that reduction \(7.03\) percentage points of error
assignments the discarded values would have changed \(8.67\%\)
sites invariant under the choice of domain \(0.0000\)

An intensity is an integral. The integrand is not recorded, the domain is not recorded, and the reduction that turns four integrals into one symbol assumes a comparison the instrument does not license. Every layer examined in the preceding subsections — the sequence, the interval, the object, the count — is a function of that symbol.

Method

Emitters: four skew-Gaussian profiles centred at \(548\), \(572\), \(596\) and \(622\) nm with widths \(24\)–\(27\) nm on a \(0.1\) nm grid over \(500\)–\(720\) nm, area-normalised. Sites: \(6000\), one emitter dominant with log-normal amplitude, plus uniform cross-contribution of \(2\)–\(10\%\). Detector: rectangular bins, efficiency curves flat, linearly tilted, silicon-like and photomultiplier-like; shot noise \(\sqrt {S}\) plus read noise \(\sigma = 8\). Deconvolution by pseudo-inverse of the \(4 \times K\) response, reduction by argmax. Seed fixed at zero. The deposited traces are those of §635, read through the same peak positions.

pict

Figure 872: Intensity is an integral over a domain, and the domain is not recorded. (a) Four overlapping emitters; grey lines mark twenty detector bins, red lines the four values the file retains. (b) Error against the known assignment as a function of bin count; the optimum is near twelve and four bins sit seven percentage points above it. (c) Assignments differing from the twenty-bin result; the discarded bins would have decided \(8.67\%\). (d) Three further domains — bin edges, efficiency curve, per-channel scale — each moving about two percent of assignments while leaving the error rate unchanged. (e) Error over \(180\) forward maps, median \(1.05\%\). (f) Distinct answers received by each site; no site among six thousand is invariant under the choice of domain.
THE MEASUREMENT IS AN INTEGRAL, AND THE DOMAIN IS CHOSEN


  signal            integrated over              what is chosen
  ------------------------------------------------------------------
  fluorescence      time x waveband              exposure time,
  intensity         x pixel area                 channel boundaries,
                                                 pixel binning

  ion current       time                         low-pass cutoff
                                                 (5-10 kHz),
                                                 sampling rate,
                                                 dwell boundaries


  I = INT INT INT  S(t, lambda, x) dt d(lambda) dA
       T  L  A

  The number reported is not S. It is S integrated over T x L x A,
  and T, L, A are settings. Change any one and the number changes
  while the sample does not.

  What must be swept:

     T        exposure time, dwell boundaries, sampling rate
     L        channel edges, filter passband
     A        pixel area, binning
     f_c      low-pass cutoff -- sets what counts as one event

  And the integral itself: Riemann? Lebesgue? counting measure?
  A sum over discrete detections is not an integral over a
  continuum, and the two disagree wherever occupancy is sparse.

“God made the integers; all else is the work of man.”

— Leopold Kronecker

671.2 Replacing the Integral with Order: Invariance to Unrecorded Parameters

Any integral-based reduction of the trace presupposes a measure space, a measure on the domain, additivity over disjoint subdomains, and a real-valued result. The three instrument parameters we perturb—channel gain, the quantum-efficiency (QE) curve, and channel scale—are all per-channel monotone maps. An integral is not invariant under monotone maps; order is. Discarding the integral in favour of order therefore removes all of these unrecorded parameters at once.

Reductions. Let \(T \in \mathbb {R}^{4 \times N}\) be the four-channel trace and \(\{p_m\}\) the peak locations. We compare four reductions, only one of which uses an integral:

The base call at each position is \(\arg \max _k v_{k,m}\).






Invariance (% change / distinct)
Reduction Instrument gain gamma distinct





Unrecorded parameters. We apply four per-channel monotone nuisances, none of which is recorded in the ABIF file: multiplicative gain \(X\mapsto g_k X\), detector nonlinearity \(X\mapsto (X/\max X)^{\gamma _k}\), baseline offset \(X\mapsto X + c_k\), and the affine combination \(X\mapsto g_k X + c_k\), with \(\log g_k, \log \gamma _k \sim \mathcal {U}(-0.6, 0.6)\) and \(c_k \sim \mathcal {U}(0, 0.6\max X)\). Each nuisance is drawn 24 times, giving 96 perturbations per file. We report the number of distinct base-call sequences each reduction returns across the 96 perturbations; \(1\) means invariant.

Results. Table 1171 summarises four ABIF files (ABI 310, 3100, 3730, and A6_1-DB3).

Table 1170: Disagreement with the shipped base calls and number of distinct outputs over 96 unrecorded perturbations (gain, gamma, offset, affine; 24 each).









310
3100
3730
A6_1-DB3
Reduction vs. shipped distinct vs. shipped distinct vs. shipped distinct vs. shipped distinct









A integral (sum, \(w{=}3\)) 33.22% 96 2.64% 96 1.29% 90 2.51% 94
A integral (point) 32.99% 96 2.64% 96 1.29% 92 2.39% 93
B order (quantile) 32.87% 1 3.02% 1 1.38% 1 2.74% 1
C persistence (rank) 72.78% 30 70.03% 25 27.69% 28 71.60% 28
D tropical \((\max ,+)\) 34.37% 74 3.27% 74 1.46% 65 2.63% 72









The integral reductions (A) change under every nuisance and return 90–96 distinct answers, with offset and affine perturbations altering 17–50% of calls. The order reduction (B) returns exactly one answer on all four instruments, with 0.00% change under gain, gamma, offset, and affine perturbations, while matching the shipped calls to within 0.1–0.4 percentage points of the integral. The tropical reduction (D) is invariant to offset (0.00–0.02%) but not to gain. Persistence (C) is nearly invariant to gain, offset, and affine perturbations (\(\le 0.17\%\)) and moves only under gamma.

Label independence. None of the reductions uses the alphabet or the dye order: the channel labels (here FWO_1 \(=\) GATC) enter only at the final \(\arg \max \). Any relabelling or permutation of the four channels, or any symbol set in place of \(\{\mathrm {A,C,G,T}\}\), leaves the invariance results unchanged.

Remaining assumption. Order removes the unrecorded parameters but retains one assumption: that the four per-channel distributions are comparable. The observed per-channel S/N ranges from 1.67 to 2.58, so this assumption is not satisfied exactly and is stated here explicitly.

pict

Figure 873: Order versus integral under unrecorded per-channel monotone parameters. (a) Raw traces, the same traces under an affine perturbation, and their per-channel quantile transforms (solid = raw, dashed = perturbed; the curves coincide). (b) Percentage of calls changed under gain, gamma, offset, and affine perturbations. (c) Number of distinct outputs over 96 perturbations (log scale; dashed line = 1, invariant). (d) Disagreement with the shipped base calls.

pict

Figure 874: The full verbatim chain from molecule to file for Sanger and nanopore sequencing. Molecular state (A/B/Z conformation, nuclear or mitochondrial origin, DNA or RNA, base modifications) enters at the top; red steps carry parameters that are not recorded in the output file; orange steps are the integral (measure-based) reductions; green marks the order-based replacement, which is invariant to every per-channel monotone map, and the final alphabet, which acts only as a label.