634 Sanger Sequencing

A Sanger chromatogram is distributed as an .ab1 file. The file contains a raw four-channel trace (DATA1–4), an analysed four-channel trace (DATA9–12), a list of peak positions (PLOC), a string of letters (PBAS) and a quality value per letter (PCON). This subsection asks what in that file is measured.

634.0.1 What is not in the file

The instrument does not measure four quantities. Fluorescence at the detection window is dispersed by a grating onto a CCD array and read as spectral bins; those bins are binned into four virtual filters, and a multicomponent matrix maps the result onto four dye coordinates. The spectral bins are not written to the .ab1; the four virtual-filter channels formed from them are written as DATA1–4 before the multicomponent matrix, and the matrix itself, a run-specific calibration file, is distributed with the instrument software rather than with the data. The lowest layer present is already a projection, and the matrix that produced it is a run-specific calibration file distributed with the instrument software rather than with the data. The mobility-shift correction is a second such file, .mob, also undistributed.

Four files were examined: three instrument generations from the Biopython test corpus (310.ab1, 3100.ab1, 3730.ab1) and one further sample (A6_1-DB3.ab1). All four carry both raw and analysed traces.

File raw scans analysed scans peaks filter order
310.ab1 \(10\,200\) \(9\,826\) \(867\) GATC
3100.ab1 \(10\,674\) \(10\,303\) \(794\) GATC
3730.ab1 \(16\,961\) \(16\,302\) \(1\,163\) GATC
A6_1-DB3.ab1 \(16\,627\) \(10\,014\) \(838\) GATC
634.0.2 The base call is an argmax; the basecaller supplies a threshold

Taking the analysed trace at the shipped peak positions and calling the channel with the largest value reproduces the shipped string as follows.

File non-ACGT calls all positions ACGT positions codes
310.ab1 \(265/867\)  (\(30.6\%\)) \(32.99\%\) \(3.49\%\) N
3100.ab1 \(0/794\)  (\(0.0\%\)) \(2.64\%\) \(2.64\%\) —
3730.ab1 \(7/1163\)  (\(0.6\%\)) \(1.29\%\) \(0.69\%\) K, R, Y
A6_1-DB3.ab1 \(20/838\)  (\(2.4\%\)) \(2.39\%\) \(\mathbf {0.00\%}\) N

For A6_1-DB3.ab1 the agreement on unambiguous positions is exact: a plain argmax reproduces every called letter, and the entire difference between the shipped output and the argmax is the decision to emit N. For 310.ab1 that decision covers \(30.6\%\) of the read.

What the basecaller adds to the argmax is therefore a threshold, and the threshold is where the output changes. The letter itself is \(\arg \max _k A_k(t)\), and the string is that index sequence composed with the lookup \(k \mapsto \texttt {FWO}[k]\). Relabelling the alphabet carries one index sequence to \(4! = 24\) distinct strings, all carrying identical information, since every downstream operation — alignment, assembly, variant calling — uses only the \(\mathbb {F}_2\)-valued relation \([\,x = y\,]\).

634.0.3 Four is in the analysed trace, not in the raw

At each peak the four channel values form a vector; dividing by their sum removes intensity and leaves a chromaticity on a \(3\)-simplex, where four well-separated dyes would span three dimensions. The effective rank is the participation ratio \((\sum \lambda _i)^2/\sum \lambda _i^2\) of the covariance eigenvalues.

File analysed rank raw rank raw eigenvalue fractions raw peaks
310.ab1 \(3.013\) \(\mathbf {1.524}\) \((0.793,\,0.156,\,0.051,\,0)\) \(60\)
3100.ab1 \(2.977\) \(2.701\) \((0.482,\,0.302,\,0.216,\,0)\) \(250\)
3730.ab1 \(2.823\) \(2.145\) \((0.593,\,0.330,\,0.077,\,0)\) \(570\)
A6_1-DB3.ab1 \(2.972\) \(2.458\) \((0.500,\,0.376,\,0.124,\,0)\) \(497\)

Every analysed trace sits close to \(3\); every raw trace sits below it, and 310.ab1 sits at \(1.524\), with \(79\%\) of the variance in a single direction. The four-way structure is largely supplied by the matrix rather than recovered by it.

Clustering the raw chromaticities and selecting \(k\) by two internal criteria:

File \(\arg \max \) silhouette \(\arg \min \) BIC
310.ab1 \(2\) \(2\)
3100.ab1 \(4\) \(7\)
3730.ab1 \(4\) \(7\)
A6_1-DB3.ab1 \(4\) \(7\)

The silhouette selects four in three of the four files; BIC selects four in none, decreasing monotonically to the largest \(k\) tested. For 310.ab1 neither criterion selects four, though that file yields only \(60\) raw peaks and the result is correspondingly weak. Four is the number the pipeline is built around; it is not the number an unsupervised criterion returns.

634.0.4 The mobility correction is not distributed

The per-dye mobility shift is applied from a binary .mob file shipped with the analysis software. Since no value of the shift is available, none is privileged, and the relevant quantity is the disagreement among settings rather than the disagreement with any one of them. Recalling the raw trace under every shift vector in \(\{-3,\dots ,3\}^4\) and comparing settings pairwise:

File peaks median \(95\)th pct. maximum
310.ab1 \(61\) \(1.64\%\) \(4.92\%\) \(8.20\%\)
3100.ab1 \(256\) \(1.17\%\) \(3.91\%\) \(6.25\%\)
3730.ab1 \(581\) \(0.69\%\) \(2.41\%\) \(3.61\%\)
A6_1-DB3.ab1 \(502\) \(1.00\%\) \(2.39\%\) \(3.59\%\)

Two admissible settings can disagree on \(8.2\%\) of the letters, and the file that fixes which is not published alongside the data.

634.0.5 The length is not reproducible

The number of letters is the number of detected peaks, and peak detection has two free parameters: a smoothing width and a prominence threshold. Sweeping \(1320\) combinations (\(\sigma \in [0,8]\) in steps of \(0.25\); prominence log-spaced over \([0.002,\,0.4]\) of the trace range):

File shipped grid range ratio settings reproducing shipped
310.ab1 \(867\) \(31\)–\(693\) \(22\times \) \(\mathbf {0/1320}\)
3100.ab1 \(794\) \(1\)–\(723\) \(723\times \) \(\mathbf {0/1320}\)
3730.ab1 \(1\,163\) \(25\)–\(1\,153\) \(46\times \) \(\mathbf {0/1320}\)
A6_1-DB3.ab1 \(838\) \(21\)–\(813\) \(39\times \) \(\mathbf {0/1320}\)

No setting in the grid returns the shipped length for any file, and in every case the closest approach occurs at the most permissive corner (\(\sigma = 0\), prominence \(= 0.002\)) while still undercounting. The length of the sequence is not a count of anything recoverable from the trace by the standard criterion; it is the output of a peak model that is not distributed with the file.

Imposing a minimum spacing instead reproduces the shipped length no better. With the spacing estimated from the shipped peak positions and scaled by a factor:

File shipped spacing-grid range fraction of shipped
310.ab1 \(867\) \(175\)–\(194\) \(0.20\)–\(0.22\)
3100.ab1 \(794\) \(278\)–\(514\) \(0.35\)–\(0.65\)
3730.ab1 \(1\,163\) \(523\)–\(1\,121\) \(0.45\)–\(0.96\)
A6_1-DB3.ab1 \(838\) \(327\)–\(650\) \(0.39\)–\(0.78\)
634.0.6 Summary

Layer Fixed by Measured range
spectral bins — not written to the file
four channels multicomponent matrix, per run not distributed
which letter .mob, undistributed \(8.2\%\) pairwise
how many letters peak model, undistributed \(0/1320\) reproduce it
letter vs. N ambiguity threshold \(0\)–\(30.6\%\) of the read
the letters themselves FWO lookup \(24\) strings, one index sequence

What the file distributes as a sequence is an argmax over four numbers, at positions chosen by an undistributed peak model, after a rotation by an undistributed matrix and a shift by an undistributed table, with ambiguity declared by an undistributed threshold. The raw trace is present; none of the four operations that turn it into letters is.

pict

Figure 830: What an .ab1 file measures. (a) Effective rank of the chromaticity covariance at peak positions. Four well-separated dyes span a \(3\)-simplex and would give rank \(3\). Every analysed trace sits at \(2.82\)–\(3.01\); every raw trace sits below, and 310.ab1 at \(1.524\). The four-way structure is largely supplied by the multicomponent matrix, which is a run-specific file not distributed with the data. (b) Silhouette score against cluster number for the raw chromaticities. Circled points mark the maximum. Three of four files prefer \(k=4\); 310.ab1 prefers \(k=2\). BIC decreases monotonically to \(k=7\) in every file and selects four in none. (c) Peak count over \(1320\) combinations of smoothing width and prominence threshold for 3730.ab1. The red contour marks the shipped length of \(1163\); no cell attains it. (d) Reachable sequence lengths across the same grid, against the shipped length (star). The shipped value lies outside the reachable range for all four files, and the closest approach in each case occurs at the most permissive corner of the grid while still undercounting. (e) Empirical distribution of pairwise letter disagreement between two mobility shift settings drawn from \(\{-3,\dots ,3\}^4\) applied to the raw trace. Since the .mob correction table is not distributed, no setting is privileged; two admissible settings differ on up to \(8.2\%\) of the letters. (f) Disagreement between a plain argmax on the analysed trace and the shipped PBAS. Grey: all positions. Green: positions where the shipped call is an unambiguous base. For A6_1-DB3.ab1 the agreement is exact, and the whole difference is the decision to emit N; for 310.ab1 that decision covers \(30.6\%\) of the read.
photons at the detection window
  |  grating dispersion -> CCD, ~20 spectral bins    <- NOT STORED
  |  binning into 4 virtual filters                  <- NOT STORED
  v
DATA1-4   (raw, 4 channels)                          <- floor of the .ab1
  |  multicomponent matrix (spectral deconvolution)  <- matrix file, per run
  |  baseline subtraction
  |  mobility shift correction                       <- .mob, NOT DISTRIBUTED
  v
DATA9-12  (analyzed)
  |  peak detection (spacing model + threshold)
  v
PLOC      (peak locations)
  |  argmax over the 4 channels
  v
PBAS      "the base"
  |  trained lookup table
  v
PCON      quality value Q