jbrowse-plugin-tview 2.1.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -37,9 +37,9 @@ interval, so an array's copies are counted once, over rows from all of them.
37
37
 
38
38
  The ABCA7 VNTR in one PacBio HiFi sample, a copy per block of columns. Every row
39
39
  carries its copy count, and the rows sort by it, so the genotype is the step in
40
- the ladder: two reads at 88 copies, a scatter between, and a group at 20-21.
41
- Laid out base by base this is 2.2kb of sequence with nothing to line it up
42
- against.
40
+ the ladder — the two alleles the table below reports for HG003, with a scatter
41
+ of reads between them. Laid out base by base this is 2.2kb of sequence with
42
+ nothing to line it up against.
43
43
 
44
44
  ### An array is an interval, not an insertion
45
45
 
@@ -54,6 +54,24 @@ inside, minus what it deleted. Everything else follows from that:
54
54
  so an aligner anchors different reads at different positions; measured over an
55
55
  interval those choices cancel. ATXN3 in HG002 reported as four separate arrays
56
56
  when anchored on insertions, splitting one locus's alleles across four counts.
57
+ - **The allele comes to the interval.** Measuring over an interval settles the
58
+ indels an aligner placed _inside_ it. It settles nothing about the ones it
59
+ placed just outside, and an aligner will happily anchor an expansion at the
60
+ base before the array starts: there the insertion belongs to no allele, so it
61
+ becomes a run of columns of its own and the read carrying it is counted as if
62
+ it matched the reference. Each read's insertions are therefore re-filed under
63
+ the array they belong to before anything is measured — within a flank of 25bp
64
+ or one copy, whichever is larger, and only where the array's own unit explains
65
+ the inserted sequence. At ATXN3 that is most of the reads carrying an
66
+ expansion, and it is the difference between HG004 reading as 8/8 with three
67
+ odd reads and reading as 8/21.
68
+
69
+ Re-filing a read's insertions is not the same as moving the interval, and the
70
+ difference is the point. The interval is a property of the reference, so one
71
+ read's misplacement stays that read's; widening it instead made a single
72
+ spurious copy anchored two bases early move the array's left edge for every
73
+ row, and the reference's own copy count with it.
74
+
57
75
  - **Every spanning read is counted**, including the ones that match the
58
76
  reference exactly — usually the commonest allele, and invisible to anything
59
77
  keyed on insertions.
@@ -80,17 +98,38 @@ is sound; reading across two is a hypothesis.
80
98
 
81
99
  ### What the numbers were checked against
82
100
 
83
- `pnpm qc:repeats` runs the plan builder over the GIAB Ashkenazi trio (PacBio
84
- HiFi, GRCh37) at known loci. Reading the per-sample modes as a genotype, every
85
- locus with variation to check is Mendelian:
86
-
87
- | locus | ref | HG003 (father) | HG004 (mother) | HG002 (son) |
88
- | ------------- | --- | -------------- | -------------- | ----------- |
89
- | HTT (CAG) | 33 | 31 / 31 | 31 / 38 | 31 / 38 |
90
- | ATXN3 (CTG) | 8 | 8 / 17 | 8 / 8 | 8 / 17 |
91
- | TCF4 CTG18.1 | 38 | 25 / 46 | 28 / 38 | 28 / 46 |
92
- | DMPK (CTG) | 21 | 12 / 14 | 6 / 12 | 12 / 12 |
93
- | FMR1 (CGG), X | 21 | 30 | 31 / 32 | 32 |
101
+ `pnpm report:repeats` measures the GIAB Ashkenazi trio (PacBio HiFi, GRCh37) at
102
+ known loci with the same plan builder the view runs. **Every number in this
103
+ section is written by `pnpm readme:repeats` and checked by
104
+ `pnpm readme:repeats --check`**, so it is a rendering of a measurement rather
105
+ than a figure typed once that nothing afterwards could contradict. The
106
+ `Measurements` workflow runs that check weekly and whenever the plan builder
107
+ changes; it is kept out of Integration and out of `preversion` because a GIAB
108
+ outage is not a reason a commit cannot land or a release cannot go out.
109
+
110
+ An allele is a copy count carrying at least 15% of a sample's spanning reads,
111
+ and never one read. Reads scatter around an allele, so a count also collects the
112
+ reads in its skirt: those within a tenth of its size that carry less than a
113
+ third of its support. Both halves are needed — no distance separates FMR1's
114
+ mother's two alleles, which are one copy apart, from HTT's single allele with a
115
+ shoulder one copy either side, and relative support does. That is a report of
116
+ what the reads say and not a genotype call — it knows no ploidy, so a homozygote
117
+ and a haploid locus both come back as one number. Read that way, every locus
118
+ with variation to check is Mendelian:
119
+
120
+ <!-- repeat-genotypes -->
121
+
122
+ | locus | ref | HG003 (father) | HG004 (mother) | HG002 (son) |
123
+ | ---------------- | --- | -------------- | -------------- | ----------- |
124
+ | HTT (CAG) | 33 | 31 | 31 / 38 | 31 / 38 |
125
+ | ATXN3 (CTG) | 8 | 15 / 17 | 8 / 21 | 17 / 21 |
126
+ | TCF4 CTG18.1 | 38 | 25 / 46 | 28 / 38 | 28 / 46 |
127
+ | DMPK (CTG) | 21 | 12 / 14 | 6 / 12 | 12 |
128
+ | FMR1 (CGG), X | 21 | 30 | 31 / 32 | 32 |
129
+ | C9orf72 (GGGGCC) | 4 | 3 | 3 | 3 |
130
+ | ABCA7 VNTR | 19 | 20 / 88 | 21 / 25 | 21 |
131
+
132
+ <!-- /repeat-genotypes -->
94
133
 
95
134
  FMR1 is the one that cannot be right by accident: nothing tells the layout which
96
135
  chromosome it is on, and the two males come back with one allele each and the
@@ -102,15 +141,37 @@ mother with two, with the son's allele one of hers.
102
141
  Where a locus runs two related units together — HTT's CAG tract and the CCG
103
142
  tract after it are both period 3 — they are one array, the count spans both,
104
143
  and it will not match a published CAG size.
105
- - **A few reads per locus land off the mode.** HG004 at ATXN3 is 8/8 on 47 of 51
106
- spanning reads, with 3 reads at 21. Read the distribution, not one row.
107
- - **Long VNTR alleles are noisy.** ABCA7's expanded haplotype in HG003 comes
108
- back as 87, 88, 88 on three reads but also 49 and 58 on two more; a 2.2kb
109
- array of a 25bp unit is where slippage in the read and in the aligner both
110
- show up.
111
- - **Coverage thins with array length**, because a row is only counted if it
112
- spans the interval end to end: 123 spanning reads at FMR1's 62bp array, 11 at
113
- ABCA7's 466bp one.
144
+ - **Reads land off the alleles**, from slippage in the read and in the aligner.
145
+ Read the distribution — `pnpm report:repeats` prints every copy count with its
146
+ support — rather than one row.
147
+ - **Long VNTR alleles are the noisy ones**, and thin: a row is only counted if
148
+ it spans the interval end to end, so an array of a 25bp unit running past 2kb
149
+ is measured on a handful of reads, each of which had to get all of it right.
150
+ Both effects are in the last two columns:
151
+
152
+ <!-- repeat-spread -->
153
+
154
+ | locus | array | spanning reads | on an allele | off one |
155
+ | ---------------- | ------------------ | -------------- | ------------ | ------- |
156
+ | HTT (CAG) | 97bp of 3bp unit | 176 | 176 | 0 |
157
+ | ATXN3 (CTG) | 24bp of 3bp unit | 154 | 149 | 5 |
158
+ | TCF4 CTG18.1 | 113bp of 3bp unit | 169 | 141 | 28 |
159
+ | DMPK (CTG) | 62bp of 3bp unit | 129 | 129 | 0 |
160
+ | FMR1 (CGG), X | 62bp of 3bp unit | 123 | 122 | 1 |
161
+ | C9orf72 (GGGGCC) | 23bp of 6bp unit | 210 | 210 | 0 |
162
+ | ABCA7 VNTR | 466bp of 25bp unit | 27 | 20 | 7 |
163
+
164
+ <!-- /repeat-spread -->
165
+
166
+ The off-allele reads at ABCA7 are the same handful the row before it is measured
167
+ on, which is what "noisy" means at that locus rather than a proportion to
168
+ compare with the STRs above.
169
+
170
+ They are still real sequence. HG003's long alleles were read back at base level:
171
+ the 1,207bp and 764bp insertions the aligner anchored 19bp outside the array are
172
+ the VNTR's own 25bp unit, entered at offset 6 — expansions, not a chimeric join
173
+ or a mismapping, which is why re-filing them under the array rather than leaving
174
+ them beside it is what the count depends on.
114
175
 
115
176
  ### Several samples at once
116
177
 
@@ -121,9 +182,36 @@ alignment. Rows are grouped into a clade per sample by a synthetic tree, which
121
182
  turns on react-msaview's collapse and show-only controls for free.
122
183
 
123
184
  The copy numbers are checkable, which is the point of this locus: FMR1 is on the
124
- X, so the two male samples come back with one allele each (HG002 32, HG003 30)
125
- and the mother with two (31 and 32) — and the son's single allele is one of his
126
- mother's, as an X-linked allele has to be.
185
+ X, so the two male samples come back with one allele each and the mother with
186
+ two, and the son's single allele is one of his mother's, as an X-linked allele
187
+ has to be. The counts are in the genotype table above, where they are measured
188
+ rather than typed.
189
+
190
+ Two things about this figure are settings rather than data, and both are there
191
+ because a column costs the same whether 124 rows use it or one does:
192
+
193
+ - **Columns only one row has a base in are hidden** — the toolbar's "hide
194
+ columns w/ N% gaps", set to whatever percent means "one row" for the number of
195
+ rows there are. That is read error, and it is a fifth of the columns at some
196
+ of these loci; the rows that carry one keep an insertion marker where it was.
197
+ What each figure is made of:
198
+
199
+ <!-- repeat-figures -->
200
+
201
+ | figure | rows | columns | columns one row has | hidden |
202
+ | ---------------------------------- | ---- | ------- | ------------------- | ------ |
203
+ | [fmr1](img/repeat-fmr1-trio.png) | 124 | 218 | 24 | 11% |
204
+ | [htt](img/repeat-htt-trio.png) | 182 | 222 | 25 | 11% |
205
+ | [atxn3](img/repeat-atxn3-trio.png) | 157 | 159 | 18 | 11% |
206
+ | [abca7](img/repeat-abca7-vntr.png) | 16 | 3630 | 1253 | 35% |
207
+
208
+ <!-- /repeat-figures -->
209
+
210
+ - **The window is sized to the alignment**, because a JBrowse view taller than
211
+ its window loses its last rows with nothing on screen to say so — and rows are
212
+ ordered longest allele first, so what falls off the bottom is a whole sample.
213
+ `pnpm figures:repeats` now grows the window to the content and warns when it
214
+ cannot.
127
215
 
128
216
  ## Usage
129
217
 
@@ -198,14 +286,35 @@ pnpm lint
198
286
  pnpm build
199
287
 
200
288
  pnpm figures:repeats # the tandem-repeat figures in img/
201
- pnpm qc:repeats # copy numbers at known loci, from live GIAB data
289
+ pnpm report:repeats # copy numbers at known loci, from live GIAB data
202
290
  ```
203
291
 
204
- `qc:repeats` is not a test. It fetches from GIAB and UCSC and prints what the
205
- plan builder measured at each locus, per sample, so the numbers can be read
292
+ `report:repeats` is not a test. It fetches from GIAB and UCSC and prints what
293
+ the plan builder measured at each locus, per sample, so the numbers can be read
206
294
  against what the locus is known to carry — Mendelian consistency across the
207
295
  trio, hemizygosity on the X, published allele ranges. The loci and samples live
208
- in `test/liveRepeatsData.ts`.
296
+ in `scripts/lib/giabTrio.mjs`, which the figures are defined against too, so a
297
+ figure and the numbers beside it cannot be of different windows.
298
+
299
+ It measures whatever it is pointed at, and can photograph it with the same
300
+ harness the figures above use:
301
+
302
+ ```bash
303
+ pnpm report:repeats \
304
+ --bam HG002=https://host/HG002.bam \
305
+ --loc chrX:146,993,530..146,993,670 \
306
+ --genome hg19 --ref-name X \
307
+ --figure img/fmr1.png
308
+ ```
309
+
310
+ `--genome` is a UCSC genome: the reference bases come from the UCSC API and, for
311
+ `--figure`, the browser's assembly is built from UCSC's 2bit and chromAlias, so
312
+ `--ref-name` is only about what the BAM calls the same sequence.
313
+ `--fasta <indexed.fa>` reads them off disk instead, which is what a reference
314
+ UCSC does not host needs — there are no aliases to be had that way, so the locus
315
+ has to be written the way the FASTA names it. A figure can only be taken of
316
+ files the browser can load: a url, or a path under the repo, which is what the
317
+ dev server serves.
209
318
 
210
319
  `pnpm start` serves the repo root, so a JBrowse instance unpacked at
211
320
  `.test-jbrowse` can load the plugin from the same origin via
@@ -39,6 +39,24 @@ export declare function detectPeriod(seq: string): number | undefined;
39
39
  * disagree about where a unit starts.
40
40
  */
41
41
  export declare function consensusUnit(seq: string, period: number): string;
42
+ /**
43
+ * How much of `seq` is explained by `unit` repeated end to end, scored at three
44
+ * places along it and reported as the worst of them.
45
+ *
46
+ * Each window is aligned free at both ends of the tiling, since an inserted run
47
+ * of copies can start and stop mid-copy, and global on the window, since the
48
+ * question is about all of it. That is what separates "more copies of this
49
+ * array" from "something else that landed next to it" without asking the
50
+ * sequence to be in phase with the unit — the ABCA7 read that carries 1207bp of
51
+ * VNTR anchored outside the array begins six bases into a copy, and the FMR1
52
+ * one begins on the wrong base of the unit and carries the locus's own AGG
53
+ * interruptions.
54
+ *
55
+ * Measured against the trio: the repeat alleles the aligner anchored just
56
+ * outside an array score 0.9 and up, and unrelated sequence of the same length
57
+ * scores 0.67 or below.
58
+ */
59
+ export declare function unitIdentity(seq: string, unit: string): number;
42
60
  export interface PeriodicAlignment {
43
61
  /** repeat unit length in bp */
44
62
  period: number;
@@ -260,6 +260,93 @@ function splitIntoUnits(seq, consensus) {
260
260
  }
261
261
  return units;
262
262
  }
263
+ // The tiled alignment below is O(len^2), so it scores windows of the insert
264
+ // rather than all of it.
265
+ const IDENTITY_PROBE_LEN = 300;
266
+ /**
267
+ * Head, middle and tail of `seq`, or the whole of it when it is short enough to
268
+ * score outright.
269
+ *
270
+ * Scoring only the head is how a prefix probe lies: `unit x 12` followed by a
271
+ * kilobase of something else scores 1.00 on its first 300 bases and is not the
272
+ * array's. Three windows cost the same and cannot be fooled that way, because
273
+ * the sequence has to still be the unit where it ends as well as where it
274
+ * starts.
275
+ */
276
+ function probeWindows(seq) {
277
+ if (seq.length <= IDENTITY_PROBE_LEN) {
278
+ return [seq];
279
+ }
280
+ const middle = Math.floor((seq.length - IDENTITY_PROBE_LEN) / 2);
281
+ return [
282
+ seq.slice(0, IDENTITY_PROBE_LEN),
283
+ seq.slice(middle, middle + IDENTITY_PROBE_LEN),
284
+ seq.slice(-IDENTITY_PROBE_LEN),
285
+ ];
286
+ }
287
+ /** the fraction of `probe`'s bases that match `unit` tiled end to end */
288
+ function tiledIdentity(probe, unit) {
289
+ const n = probe.length;
290
+ if (!n || !unit.length) {
291
+ return 0;
292
+ }
293
+ // two spare copies so the alignment can start mid-copy and still run off the
294
+ // end without paying for it
295
+ const tile = unit.repeat(Math.ceil(n / unit.length) + 2);
296
+ const m = tile.length;
297
+ const stride = m + 1;
298
+ const score = new Int32Array((n + 1) * stride);
299
+ const matches = new Int32Array((n + 1) * stride);
300
+ // row 0 stays zero: starting anywhere in the tiling is free
301
+ for (let i = 1; i <= n; i++) {
302
+ score[i * stride] = i * GAP;
303
+ }
304
+ for (let i = 1; i <= n; i++) {
305
+ for (let j = 1; j <= m; j++) {
306
+ const hit = probe[i - 1] === tile[j - 1];
307
+ const diagonal = score[(i - 1) * stride + j - 1] + (hit ? MATCH : MISMATCH);
308
+ const up = score[(i - 1) * stride + j] + GAP;
309
+ const left = score[i * stride + j - 1] + GAP;
310
+ const best = Math.max(diagonal, up, left);
311
+ score[i * stride + j] = best;
312
+ matches[i * stride + j] =
313
+ best === diagonal
314
+ ? matches[(i - 1) * stride + j - 1] + (hit ? 1 : 0)
315
+ : best === up
316
+ ? matches[(i - 1) * stride + j]
317
+ : matches[i * stride + j - 1];
318
+ }
319
+ }
320
+ let best = score[n * stride];
321
+ let bestMatches = matches[n * stride];
322
+ for (let j = 1; j <= m; j++) {
323
+ if (score[n * stride + j] > best) {
324
+ best = score[n * stride + j];
325
+ bestMatches = matches[n * stride + j];
326
+ }
327
+ }
328
+ return bestMatches / n;
329
+ }
330
+ /**
331
+ * How much of `seq` is explained by `unit` repeated end to end, scored at three
332
+ * places along it and reported as the worst of them.
333
+ *
334
+ * Each window is aligned free at both ends of the tiling, since an inserted run
335
+ * of copies can start and stop mid-copy, and global on the window, since the
336
+ * question is about all of it. That is what separates "more copies of this
337
+ * array" from "something else that landed next to it" without asking the
338
+ * sequence to be in phase with the unit — the ABCA7 read that carries 1207bp of
339
+ * VNTR anchored outside the array begins six bases into a copy, and the FMR1
340
+ * one begins on the wrong base of the unit and carries the locus's own AGG
341
+ * interruptions.
342
+ *
343
+ * Measured against the trio: the repeat alleles the aligner anchored just
344
+ * outside an array score 0.9 and up, and unrelated sequence of the same length
345
+ * scores 0.67 or below.
346
+ */
347
+ export function unitIdentity(seq, unit) {
348
+ return Math.min(...probeWindows(seq).map(w => tiledIdentity(w, unit)));
349
+ }
263
350
  /**
264
351
  * Unit-per-block alignment of the sequences inserted at one reference position.
265
352
  *
@@ -1 +1 @@
1
- {"version":3,"file":"align.js","sourceRoot":"","sources":["../../src/LaunchTView/align.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,MAAM,KAAK,GAAG,CAAC,CAAA;AACf,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAA;AACnB,MAAM,GAAG,GAAG,CAAC,CAAC,CAAA;AAEd,+EAA+E;AAC/E,yEAAyE;AACzE,MAAM,OAAO,GAAG,GAAG,CAAA;AACnB,MAAM,YAAY,GAAG,EAAE,CAAA;AAEvB,+EAA+E;AAC/E,gFAAgF;AAChF,2EAA2E;AAC3E,6EAA6E;AAC7E,MAAM,eAAe,GAAG,CAAC,CAAA;AAEz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,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAChE,CAAA;IACD,OAAO;QACL,MAAM,EAAE,IAAI,GAAG,CAAC;YACd,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;YACxC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAoB,EAAE,CAAC;gBAC1C,GAAG;gBACH,IAAI,CAAC,MAAM,CAAC,CAAC,CAAE,EAAE,UAAU,CAAC;aAC7B,CAAC;SACH,CAAC;KACH,CAAA;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,IAAc;IAC5C,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAA;AACxC,CAAC"}
@@ -41,11 +41,75 @@ export interface ArrayBlock {
41
41
  * one is how a truncated read reads as a contracted allele.
42
42
  */
43
43
  export declare function extractAllele(read: ReadLayout, start: number, end: number): string | undefined;
44
- /** Reference positions an array owns, including the insertion slot at its right edge. */
45
- export declare function arrayInsertionKeys(array: {
46
- start: number;
47
- end: number;
48
- }): number[];
44
+ /**
45
+ * `ins`, inserted before reference position `from`, rewritten as an insertion
46
+ * before `to` — or undefined when the read's own bases do not allow it.
47
+ *
48
+ * An insertion has no unique position. `S` before a base `b` and `rotate(S)`
49
+ * after it spell the same read, so an aligner is free to anchor an expansion
50
+ * outside the array it belongs to, and at ATXN3 it did exactly that for most of
51
+ * the reads carrying one. Walking an indel through that equivalence class is
52
+ * the standard normalization for it (Tan, Abecasis & Kang, "Unified
53
+ * representation of genetic variants", Bioinformatics 31, 2015,
54
+ * doi:10.1093/bioinformatics/btv112, which walks left; this walks toward the
55
+ * array, the same operation with the array as the canonical anchor).
56
+ *
57
+ * The step is tested against the **read's** aligned base rather than the
58
+ * reference's, which is what makes the rewrite exact: the row still renders
59
+ * base for base as it did, and the only thing that changes is the reference
60
+ * position the bases are filed under. A step onto a deletion has no base to
61
+ * swap with and stops.
62
+ *
63
+ * Being exact, it is also incomplete, and measurably so. An aligner does not
64
+ * only choose among equivalent placements — it chooses the highest-scoring one,
65
+ * which for a repeat allele carrying an interruption is often not equivalent to
66
+ * any placement inside the array. FMR1's misplaced read is exactly that: 32bp
67
+ * of the locus's own CGG anchored two bases early, starting on a `C` where the
68
+ * read has a `G`, so no rewrite of it exists. Hence `reanchorInsertions` treats
69
+ * this as the preferred spelling and not as the test of whether to move.
70
+ */
71
+ export declare function shiftInsertion(read: ReadLayout, from: number, to: number, ins: string): string | undefined;
72
+ /** an array with the span of reference positions whose insertions it may claim */
73
+ interface FlankWindow {
74
+ array: ReferenceArray;
75
+ from: number;
76
+ to: number;
77
+ }
78
+ /**
79
+ * The window around each array that its insertions may be re-anchored from.
80
+ *
81
+ * Two arrays may not claim one position: `extractAllele` reads the slot at an
82
+ * array's `end`, so a shared slot would be counted into two alleles. Neighbours
83
+ * split the reference between them down the middle — a property of the
84
+ * reference alone, so unlike the interval it replaces, no read can move it.
85
+ */
86
+ export declare function flankWindows(arrays: ReferenceArray[]): FlankWindow[];
87
+ /**
88
+ * Re-file each read's insertions under the array they belong to, one read at a
89
+ * time.
90
+ *
91
+ * Measuring an allele over a reference interval fixes the "one array reports as
92
+ * several sites" problem for indels the aligner placed *inside* the interval.
93
+ * It does not fix the ones placed just outside: there the insertion is part of
94
+ * no allele — it becomes its own run of insertion columns — and the read
95
+ * carrying it is measured as though it had the reference allele. Both halves of
96
+ * that are wrong, and neither is rare: at ATXN3 the aligner anchored 60 of 162
97
+ * reads' expansions one base outside the array.
98
+ *
99
+ * Doing this per read is the whole point. Widening the shared interval instead
100
+ * — which is what this replaces — made one read's misplacement everyone's: a
101
+ * single spurious copy anchored two bases early moved the array's left edge for
102
+ * every row, and the reference's own copy count with it. Re-anchoring touches
103
+ * only the read that carries the insertion, so a read can be wrong on its own.
104
+ *
105
+ * Nothing here consults the other reads, or how many of them agree. A single
106
+ * read's expansion is as real as fifty, which is what measuring over an
107
+ * interval buys and what a vote would give back. What decides an insertion is
108
+ * its own sequence: `unitIdentity` against the array's unit, since the aligner
109
+ * is free to place a repeat allele outside the array but is not free to make
110
+ * unrelated sequence out of the array's unit.
111
+ */
112
+ export declare function reanchorInsertions(reads: ReadLayout[], arrays: ReferenceArray[]): ReadLayout[];
49
113
  /**
50
114
  * Lay every row's allele out unit-per-block, one block per array.
51
115
  *
@@ -55,3 +119,4 @@ export declare function arrayInsertionKeys(array: {
55
119
  * rows disagree.
56
120
  */
57
121
  export declare function buildArrayBlocks(reads: ReadLayout[], arrays: ReferenceArray[]): ArrayBlock[];
122
+ export {};