# Read-through and mate overlap for an insert length and two read lengths, version 1.0.2

ngs-insert-read-overlap\@1.0.2: this version's equations with their symbols, each constant's value, their sources and whether each was read, a worked example where the record holds one, its level and what it was checked against, the number of cases, and what was not checked. This version's record is not rewritten; a correction is added under Changes.

## What this page can and cannot show

**Level: Checked against a reference; integer geometry from Turner 2014's figures; lengths only; insert excludes adapters; no outside program used. Reference kind: our own exact-arithmetic script and a hand-worked case.**

Checked by this project, not independently reviewed. Every method on this page has its equations, constants, sources and cases on record, and its cases agree with the stated reference within the stated tolerance. A reader can follow each method's worked example by hand; that shows the stated method gives the stated answer for one set of inputs, and does not test the code. The other cases and their values are not printed, so a reader cannot re-run these checks. No independent scientist has yet reviewed them.

[Every version of this method](https://www.drybench.com/methods/m/ngs-insert-read-overlap) · [Every method](https://www.drybench.com/methods/m) · [What the levels mean](https://www.drybench.com/methods/levels)

## Version 1.0.2

**Level: Checked against a reference; integer geometry from Turner 2014's figures; lengths only; insert excludes adapters; no outside program used. Reference kind: our own exact-arithmetic script and a hand-worked case.** `ngs-insert-read-overlap@1.0.2`

Built, not hosted. Generated from a snapshot of the library's records taken on 2026-11-25, as committed on 2026-11-25. A later snapshot replaces this one, so these records and this page can change.

**Verification statement:** Mate overlap, read-through and the clipped inner distance from an insert length and two read lengths: the record's derivation from Turner 2014 Figs 1 and 2 (PMC3906532, re-read at source 14 November 2026); merged length = i as the source states for overlapping mates, and the record's reading (the span after adapter trimming) for read-through. Compared with a second implementation in Python by a separate agent of the same model family (117 cases, 20 of its own at the edges), in integer arithmetic. None was used outside: integer geometry on the stated lengths with no published constant; programs that merge mates work on sequences, not lengths. Lengths only; the insert excludes adapters.

Mate overlap max(0, min(r1, i) + min(r2, i) - i), read-through max(0, r - i), the unsequenced middle max(0, i - r1 - r2), and the relation.

- **How results are reported:** none: integers, exact
- **Uncertainty:** Exact integer geometry.
- **Reference, as its record states it:** integer geometry from Turner 2014's figures, by formula and by position sets, with hand-worked cases
- **Level confirmed by this project's ruling of** 14 November 2026

[What this page can and cannot show](#what-this-page-can-and-cannot-show)

### What was checked

216 cases in 4 files, linked by this exact version.

Run through the tool at build against our own exact-arithmetic script and a hand-worked case: 140 agree within the tolerance the file states, 76 refuse as the case expects, 0 differ, 0 were not run.

- **File 1, 18 cases**
  - **Where the expected values came from:** our own exact-arithmetic script and a hand-worked case
  - **Recorded on:** 2026-11-10
  - **Reference:** CPython standard library (decimal, fractions), 3.13.18; licence PSF-2.0
  - **Tolerance as the file states it:** exact: lengths, relations, withheld rules, statuses and codes

- **File 2, 40 cases**
  - **Where the expected values came from:** our own exact-arithmetic script and a hand-worked case
  - **Recorded on:** 2026-11-14
  - **Reference:** second implementation (Python 3.13), 2026-11-14; licence BSD-3-Clause
  - **Tolerance as the file states it:** exact: lengths, relations, withheld rules, statuses and codes

- **File 3, 41 cases**
  - **Where the expected values came from:** our own exact-arithmetic script and a hand-worked case
  - **Recorded on:** 2026-11-14
  - **Reference:** second implementation (Python 3.13), 2026-11-14; licence BSD-3-Clause
  - **Tolerance as the file states it:** exact: lengths, relations, withheld rules, statuses and codes

- **File 4, 117 cases**
  - **Where the expected values came from:** our own exact-arithmetic script and a hand-worked case
  - **Recorded on:** 2026-11-14
  - **Reference:** second implementation (Python 3.13), 2026-11-14; licence BSD-3-Clause
  - **Tolerance as the file states it:** exact: lengths, relations, withheld rules, statuses and codes

Apart from the worked example, the cases and their values are not printed here. This shows agreement with this project's recorded cases. It does not show that a method suits your work, and it is not a qualification.

### What was not checked

Whether a merger joins the mates (its minimum overlap and mismatch settings); adapter sequences; trimmed read lengths; library sizes that include the adapters.

### Definition or model

A closed form: the result follows from the inputs by the equations alone.

### Equations

```equation
overlap = max(0, min(r1, i) + min(r2, i) - i)
read-through_k = max(0, r_k - i)
middle = max(0, i - r1 - r2), the source's inner distance clipped at 0 (programs that report a signed inner distance give i - r1 - r2, negative when the mates overlap): these three are the record's derivation from Turner 2014 Figs 1 and 2 (drawn, not printed)
merged length = i when overlap > 0: for overlapping mates (Turner 2014 Fig. 2A) as the source states
for read-through (Fig. 2B) the source measures i = (r1 + r2) - c, with c the contig built from the untrimmed reads, so c = r1 + r2 - i, and the record reports i, the span of the mates after adapter trimming, as its own reading (Results, Measurement of insert size)
relation: read-through when either read-through is above 0, else mates-overlap when overlap > 0, else mates-meet when i = r1 + r2, else gap-between-mates
order of checks: the kit's checks of each length in the order insert, read 1, read 2 (a length of 0 or below is the kit's OUT_OF_RANGE), then each length's cap of 100,000 bp (LENGTH_ABOVE_RANGE), then the whole-number test of all three (NOT_AN_INTEGER), so 100000.5 bp is refused LENGTH_ABOVE_RANGE
```

| Symbol | Meaning and unit |
| --- | --- |
| i | insert length between the adapters, bp |
| r1 | read 1 length, sequenced cycles, bp |
| r2 | read 2 length, bp |

Source: Turner FS (2014), Assessment of insert sizes and adapter content in fastq data from NexteraXT libraries, Frontiers in Genetics 5:5, section Introduction, Figures 1 and 2 (drawn: overlapping mates, the inner distance, adapter read-through by insert length); Results, Measurement of insert size (i = (r1 + r2) − c, c the length of the contig FLASH produces), version of record, Europe PMC full-text XML (PMC3906532); the figures are images in it; read in full on 2026-11-11 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning 5281a6706332. Free to read (CC BY), checked 2026-11-11. No erratum found (searched Europe PMC commentCorrectionList for PMC3906532), 2026-11-11.

### Constants

Constants: none used.

### Worked example

Worked example: one case of ngs-insert-read-overlap\@1.0.2, from its inputs through each step to the answer. Values are written as a person writes them; the working carries more digits, so your own figure may differ in the last digit shown.

**Inputs**

- insertLength = 250 bp
- read1Length = 150 bp
- read2Length = 150 bp

**Steps**

1. ov = 50 bp, from read1Length, read2Length, insertLength; by the equation above; gives result.mateOverlap.

The working, as the case writes it:

```equation
overlap = max(0, min(150,250) + min(150,250) - 250) = 50, equal to |[1, 150] ∩ [101, 250]|
read-through = max(0, r - i) = 0, 0
middle = 0
```

**Answer**

- `result.mateOverlap` = **50 bp**

Where these values came from: our own exact-arithmetic script and a hand-worked case; Turner 2014 (Front Genet 5:5, PMC3906532); exact integers by the formula and by enumerating the positions each read covers.

At build the tool returned this answer within the tolerance the file states: exact: lengths, relations, withheld rules, statuses and codes.

Who worked this case: not recorded.

### What it refuses, and its input ranges

- `LENGTH_ABOVE_RANGE`: a length is above the method's length cap Next: Check the insert and read lengths are in bp.

**Input ranges:** insertLength: at most 100000 bp; outside it, refused (LENGTH\_ABOVE\_RANGE). read1Length: at most 100000 bp; outside it, refused (LENGTH\_ABOVE\_RANGE). read2Length: at most 100000 bp; outside it, refused (LENGTH\_ABOVE\_RANGE).

### Changes

No correction is logged for ngs-insert-read-overlap\@1.0.2.

## Tools that use it

- [`ngs_insert_read_overlap`](https://www.drybench.com/methods/tools/ngs-insert-read-overlap)

## Cite this version

Read-through and mate overlap for an insert length and two read lengths. Drybench; ngs-insert-read-overlap\@1.0.2; [https://www.drybench.com/methods/m/ngs-insert-read-overlap/1.0.2](https://www.drybench.com/methods/m/ngs-insert-read-overlap/1.0.2) (accessed \[date\]).
