635 Nanopore: the State Is Not in the Signal

The preceding subsection found that a Sanger trace leaves most of its sequence undetermined because the files that would fix the transformation are not distributed. Nanopore sequencing admits a stronger statement, and one that does not depend on any file being withheld: the signal is one-dimensional, the state space it is taken to index is not, and the deficit is structural.

635.0.1 What the file contains

A fast5 record stores one integer per sample. There is no channel axis.

Quantity Value
stored form int16 ADC codes, \(-4096\) to \(4095\)
distinct codes used \(669\) of \(8192\) available
samples in the read \(561\,664\)
sampling rate \(4000\) Hz
duration \(140.42\) s

Conversion to picoamperes is a declaration, not a measurement:

\begin{equation} \mathrm {pA} = (\mathrm {ADC} + \text {offset}) \times \frac {\text {range}}{\text {digitisation}}, \tag{24445}\end{equation}
with offset \(=8.0000\), range \(=1392.8787\) and digitisation \(=8192\) read from the file’s attributes. None of the three can be recovered from the signal.
635.0.2 How many bases

Bases are produced by segmenting the current into dwells. The segmentation carries a change-point penalty, and that penalty is not in the file. Sweeping it on the unchanged read:

Penalty \([\times \sigma ^2]\) Segments Fraction of declared
\(0.5\) \(48\,235\) \(0.859\)
\(1\) \(42\,395\) \(0.755\)
\(5\) \(29\,797\) \(0.531\)
\(20\) \(22\,680\) \(0.404\)
\(100\) \(15\,157\) \(0.270\)
\(500\) \(5\,864\) \(0.104\)

The declared base count is \(56\,166\), obtained by dividing the sample count by \(4000\,/\,400 = 10\) samples per base — a translocation speed of \(400\) bases per second, which is a stated operating parameter rather than something measured from this read. No penalty reproduces it: the finest segmentation reaches \(85.9\%\) of the declared count, and coarser settings fall by more than two orders of magnitude. The length of the sequence is set by a threshold, as it was in the Sanger case.

635.0.3 One scalar cannot index a \(k\)-mer

The noise is estimated from first differences by the median absolute deviation, which is insensitive to the segmentation: \(\sigma = 1.604\) pA. The current range carrying the translocating strand spans \(36.73\) to \(81.78\) pA, or \(45.06\) pA. At a two-sigma separation criterion this gives

\begin{equation} N_{\mathrm {levels}} = \frac {45.06}{2 \times 1.604} = 14.0 . \tag{24446}\end{equation}

A pore model asserts a current for every \(k\)-mer context. The map is therefore many-to-one by construction, and the ratio is not marginal:

Model States Resolvable levels \(k\)-mers per level
\(5\)-mer \(1024\) \(14.0\) \(72.9\)
\(6\)-mer \(4096\) \(14.0\) \(291.7\)
\(9\)-mer \(262\,144\) \(14.0\) \(18\,666.8\)

This is confirmed against the data rather than asserted. Counting modes in the histogram of segment levels:

Peak prominence Modes found
\(0.02\) of maximum \(51\)
\(0.05\) \(33\)
\(0.10\) \(14\)
\(0.20\) \(2\)

Between two and fifty-one levels are present in the measurement, depending on where the mode-detection threshold is placed. A \(5\)-mer model asserts \(1024\).

635.0.4 Where the state comes from

A \(k\)-mer state carries \(2k\) bits. A segment level carries \(\log _2 14.0 = 3.812\) bits. The remainder is supplied by the decoder — by the transition structure of the model, not by the pore.

Model State needs Signal supplies Decoder supplies Fraction
\(5\)-mer \(10.0\) \(3.812\) \(6.188\) \(61.9\%\)
\(6\)-mer \(12.0\) \(3.812\) \(8.188\) \(68.2\%\)
\(9\)-mer \(18.0\) \(3.812\) \(14.188\) \(78.8\%\)

On the \(9\)-mer models used by current basecallers, close to four fifths of the state that determines each letter is contributed by the model. That is not a defect of the implementation; it is what a one-dimensional readout of a \(262\,144\)-state system requires.

The reverse accounting gives the discard. The raw signal carries \(3.970\) bits per sample, or \(39.7\) bits per declared base. A letter retains two.

\begin{equation} \frac {39.7 - 2.0}{39.7} = 95.0\% \quad \text {of the recorded signal is removed by writing a letter.} \tag{24447}\end{equation}
635.0.5 The contrast with Sanger

Sanger .ab1 Nanopore fast5
signal dimension \(4\) channels \(1\) scalar
state space \(4\) letters \(4^k\) contexts
raw distributed yes (DATA1–4) yes
transformation distributed no (.mtx, .mob, .bcp) no
number of valid transformations unstated several, shipped concurrently
source of indeterminacy withheld files the readout itself
determined by the raw \(6.6\)–\(46.0\%\) \(21\)–\(38\%\) of the state
discarded by a letter \(73.7\)–\(88.6\%\) \(95.0\%\)

For Sanger the indeterminacy could in principle be removed by distributing three files. For nanopore it cannot. A scalar measured \(14\) ways cannot select among \(262\,144\) states, and the basecaller is not recovering a sequence from the signal so much as choosing, among the sequences the signal permits, the one its training makes most probable.

Data

The nanopore analysis uses a single fast5 file from the Oxford Nanopore Technologies Open Data collection, hosted without credentials in the Registry of Open Data on AWS:

Field Value
bucket s3://ont-open-data/
dataset rrms_2022.07
sample COLO829BL_2
run 20211123_1709_X2_FAR58230_e24aee17
file FAR58230_pass_79fbdf94_5533.fast5
size \(10.46\) MB, \(214\) reads
read analysed read_3aa2d996-d119-457f-… (the longest)

The file is VBZ-compressed and requires the vbz_h5py_plugin HDF5 filter to read. Signals were taken from Raw/Signal and calibration constants from the channel_id attributes; no basecall, alignment or methylation call distributed with the run was consulted at any point.

Segmentation is binary change-point detection on the \(L^2\) cost with an explicit penalty, swept over four orders of magnitude. Noise is the median-absolute-deviation estimate on first differences, \(\sigma = \mathrm {MAD}(\Delta x) / (0.6745\sqrt {2})\), which does not depend on the segmentation. Resolvable levels are the span between the first and ninety-ninth percentiles divided by \(2\sigma \).

pict

TWO DEFICITS, ONE FILLER
========================================================================

SANGER                              NANOPORE
  4 channels                          1 scalar
  4 letters                           4^9 = 262,144 states
       |                                   |
  raw determines 6.6-46.0%            level supplies 3.812 of 18 bits
       |                                   |     = 21.2%
  the rest comes from                 the rest comes from
       |                                   |     = 78.8%
  .mtx  unmixing matrix               the decoder's learned prior
  .mob  mobility shift                     |
  .bcp  peak model                    trained on reads aligned to
       |                                   v
  NOT DISTRIBUTED                     a REFERENCE GENOME
                                           |
                                      T2T-CHM13 (2022)
                                           |  polished with Illumina
                                           v
                                      Illumina quality table
                                           |  calibrated on mismatches vs
                                           v
                                      GRCh38
                                           |  backbone = BAC clones
                                           v
                                      HGP 1990-2003
                                           |
                                           v
                                      S A N G E R
                                           |
                                      whose own raw determined
                                      6.6-46.0% of its own call
                                           |
                                      the rest from .mtx/.mob/.bcp
                                           |
                                      NOT DISTRIBUTED


  and separately, in every Illumina run used to polish:
       PhiX174 spike-in control
            |
       PhiX174 reference sequence
            |
       Sanger, Air, Barrell et al., Nature 1977
            |
       autoradiograph, read by eye

========================================================================
  nanopore's structural deficit is filled by Sanger's output,
  and Sanger's output was not determined by Sanger's measurement.
========================================================================