# Assembly contiguity: Nx, Lx, NGx, LGx and auN from sequence lengths, version 1.0.1

genome-assembly-contiguity\@1.0.1: 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; QUAST manual and Li 2020 read; seqkit 2.14.0 and QUAST's N50 code agree; describes lengths, not assembly. Reference kind: our own exact-arithmetic script and a hand-worked case.**

Not fully recorded, and not independently reviewed. Items marked "Not recorded" are missing from this project's records for the version named. Apart from any worked example shown, the cases and their values are not printed, so a reader cannot re-run these checks. No independent scientist has yet reviewed these methods or checks.

[Every version of this method](https://www.drybench.com/methods/m/genome-assembly-contiguity) · [Every method](https://www.drybench.com/methods/m) · [What the levels mean](https://www.drybench.com/methods/levels)

## Version 1.0.1

**Level: Checked against a reference; QUAST manual and Li 2020 read; seqkit 2.14.0 and QUAST's N50 code agree; describes lengths, not assembly. Reference kind: our own exact-arithmetic script and a hand-worked case.** `genome-assembly-contiguity@1.0.1`

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:** Nx, Lx, NGx and LGx as the QUAST 5.3.0 manual §3.1.1 defines them and auN as Li 2020 prints it, both re-read at source 24 November 2026 (hashes unchanged). The manual gives L50 two readings at a tie (the number of contigs at least N50 long; the minimal number that cover half): the tool returns the minimal number as Lx and the other beside it, and seqkit 2.14.0 and QUAST 5.2.0's N50 code both compute the minimal number. Checked by an integer script of our own with hand-worked cases at the exact boundary, odd totals, ties, the length filter and the NG boundary, and against seqkit 2.14.0 (N50, L50, Nx) and QUAST 5.2.0's N50 module (Nx, Lx, NGx, LGx, auN) on 26 cases, 323 values, all agreeing. Describes the lengths supplied, not assembly correctness.

Sorted longest first, Nx is the length at the smallest k whose k longest lengths reach x percent of the total (100 C\_k >= x T, in integers), Lx is that k, and the count of lengths at least Nx is given beside it; N50 always, other whole x from 1 to 100 on request; NGx and LGx against a stated genome size; auN = sum L^2 / T.

- **How results are reported:** none: every length and count exact; auN the correctly rounded double of the exact quotient
- **Uncertainty:** Exact arithmetic on the lengths supplied; descriptive, not a model.
- **Reference, as its record states it:** exact integer arithmetic in a script of our own, with hand-worked cases; seqkit 2.14.0 (N50, L50, Nx) and GenomeTools 1.6.5 (NG50, NG80) independent; QUAST 5.2.0's N50 module a transcription check
- **Level confirmed by this project's ruling of** 24 November 2026

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

### What was checked

73 cases in 2 files, linked by this exact version.

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

- **File 1, 41 cases**
  - **Where the expected values came from:** our own exact-arithmetic script and a hand-worked case
  - **Recorded on:** 2026-11-11
  - **Reference:** CPython standard library (integers, fractions), 3.13.18; licence PSF-2.0
  - **Tolerance as the file states it:** every figure exact: lengths, counts and levels as integers; auN equal to the correctly rounded double of the exact fraction; texts, statuses, codes and withheld rules exact

- **File 2, 32 cases**
  - **Where the expected values came from:** our own exact-arithmetic script and a hand-worked case
  - **Recorded on:** 2026-11-24
  - **Reference:** second implementation (Python 3.13), 2026-11-24; licence PSF-2.0
  - **Tolerance as the file states it:** every number relative 1e-12 (absolute 1e-15 below 1e-3, in each value's unit); counts, labels, strings, flags, statuses and codes exact

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

QUAST's N50 code is from the project whose manual is the source, so it checks transcription only (Nx, Lx, NGx, LGx); seqkit is the independent check for N50, L50 and Nx and GenomeTools for NG50 and NG80, at levels 50 and 80 only, and both count L at a tie as the lengths at least N, so the tool's minimal Lx and LGx at a tie have QUAST's code alone, and its LGx at levels other than 50 and 80 no independent program; seqkit on lists above 5 × 10^7 bp; QUAST's whole pipeline (only its N50 module was run); Earl et al. 2011, Assemblathon 1 (not read: the publisher's page loops through logins and no full text was served); auNG; decimal levels; splitting scaffolds at gap runs.

### Definition or model

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

### Equations

**Equation 1**

```equation
T = sum of the lengths kept
a length is kept when no minimum is stated or when it is at least the stated minimum m (inclusive)
sequencesKept = the number kept
sequencesExcluded and basesExcluded = the number and summed length of those dropped (0 with no filter)
longestSequenceLength and shortestSequenceLength are of the lengths kept
lengths are whole bp of at least 1, in any order
sequenceKind (contigs, scaffolds or unknown) is echoed and changes no figure
```

| Symbol | Meaning and unit |
| --- | --- |
| T | total length of the sequences kept, bp |
| m | the stated minimum length, bp |

Source: QUAST 5.3.0 manual, section 3.1.1 (Metrics description: Summary report), section 3.1.1 Summary report: N50, NG50, Nx and NGx, L50 (Lx, LG50, LGx), auN, --min-contig, manual.html at the tag quast\_5.3.0 (QUAST 5.3.0, released under GPL v2 on 9 November 2024); read as documentation only, no QUAST code read or run; 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 45c1e9b8ae36. Free to read (QUAST is GPL v2; the manual states no separate licence, so it is cited only), checked 2026-11-11. No erratum found (searched the manual's own text at the tag), 2026-11-11.

**Equation 2**

```equation
sort the kept lengths longest first, L(1) >= L(2) >= ...
C_k = L(1) + ... + L(k)
Lx = the smallest k with 100 C_k >= x T, compared in integers
Nx = L(Lx)
countAtOrAboveNx = the number of kept lengths >= Nx, which exceeds Lx exactly when lengths tie at Nx
equal to the largest kept length l whose lengths >= l total at least x percent of T
```

| Symbol | Meaning and unit |
| --- | --- |
| x | the level, a whole number from 1 to 100, % |
| C\_k | sum of the k longest kept lengths, bp |

Source: QUAST 5.3.0 manual, section 3.1.1 (Metrics description: Summary report), section 3.1.1 Summary report: N50, NG50, Nx and NGx, L50 (Lx, LG50, LGx), auN, --min-contig, manual.html at the tag quast\_5.3.0 (QUAST 5.3.0, released under GPL v2 on 9 November 2024); read as documentation only, no QUAST code read or run; 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 45c1e9b8ae36. Free to read (QUAST is GPL v2; the manual states no separate licence, so it is cited only), checked 2026-11-11. No erratum found (searched the manual's own text at the tag), 2026-11-11.

**Equation 3**

```equation
NGx and LGx: the same rule with the stated genome size G in place of T, 100 C_k >= x G
withheld when 100 T < x G, since then no k reaches it
```

| Symbol | Meaning and unit |
| --- | --- |
| G | the stated genome size, never the assembly total, bp |

Source: QUAST 5.3.0 manual, section 3.1.1 (Metrics description: Summary report), section 3.1.1 Summary report: N50, NG50, Nx and NGx, L50 (Lx, LG50, LGx), auN, --min-contig, manual.html at the tag quast\_5.3.0 (QUAST 5.3.0, released under GPL v2 on 9 November 2024); read as documentation only, no QUAST code read or run; 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 45c1e9b8ae36. Free to read (QUAST is GPL v2; the manual states no separate licence, so it is cited only), checked 2026-11-11. No erratum found (searched the manual's own text at the tag), 2026-11-11.

**Equation 4**

```equation
auN = sum of L_i^2 / T over the kept lengths, computed as an exact integer quotient and rounded once to the nearest double
```

| Symbol | Meaning and unit |
| --- | --- |
| L\_i | a kept length, bp |

Source: Li H (2020), auN: a new metric to measure assembly contiguity, blog post of 8 April 2020, section the formula auN = sum\_i L\_i^2 / sum\_j L\_j, the post as served on 11 November 2026; 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 938d23394400. Free to read (© Heng Li; no licence stated, so cited only), checked 2026-11-11. No erratum found (searched the post's own update note), 2026-11-11.

**Equation 5**

```equation
Lx is the smallest count (QUAST's 'minimal number of contigs that cover' sentence), the count at least Nx is returned beside it
x is a whole number from 1 to 100 (0 has no finite Nx)
N50 and L50 are always returned as the first entry of levels, then each requested x in the order sent
auNG is not in 1.0.0
```

| Symbol | Meaning and unit |
| --- | --- |
| Lx | the smallest number of sequences reaching x percent |

Ruling of this project: 11 November 2026, section "2. Reasoning (rulings)". Not yet published; its effect is stated on this page. A choice this project made, not a value from the literature.

### Conventions

What each mode computes:

- `lengthFilter = none`: every length sent is kept
- `lengthFilter = at-least`: lengths shorter than the stated minimum length are dropped before every figure; a length equal to it is kept

### Constants

Constants: none used.

### Worked example

Worked example: one case of genome-assembly-contiguity\@1.0.1, 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**

- lengths.values\[0\] = 80
- lengths.values\[1\] = 70
- lengths.values\[2\] = 50
- lengths.values\[3\] = 40
- lengths.values\[4\] = 30
- lengths.values\[5\] = 20
- lengths.values\[6\] = 10
- lengths.unit = bp
- sequenceKind = contigs
- lengthFilter = none
- levels\[0\] = 90 %

**Steps**

1. T = 300 bp, from lengths; by equation 1; gives result.totalLength.
2. n50 = 70 bp, from lengths; by equation 2; gives result.levels\[0\].nx.
3. l50 = 2, from lengths; by equation 2; gives result.levels\[0\].lx.
4. n90 = 30 bp, from lengths, levels; by equation 2; gives result.levels\[1\].nx.
5. l90 = 5, from lengths, levels; by equation 2; gives result.levels\[1\].lx.
6. auN = 56 bp, from lengths; by equation 4; gives result.auN.

The working, as the case writes it:

```equation
x = 50: smallest k with 100 C_k >= 50 x 300 is 2 (C_2 = 150), N50 = 70, lengths >= N50: 2
x = 90: smallest k with 100 C_k >= 90 x 300 is 5 (C_5 = 270), N90 = 30, lengths >= N90: 5
auN = sum L^2 / T = 16800 / 300 = 56 = 56.0
```

**Answer**

- `result.totalLength` = **300 bp**
- `result.levels[0].nx` = **70 bp**
- `result.levels[0].lx` = **2**
- `result.levels[1].nx` = **30 bp**
- `result.levels[1].lx` = **5**
- `result.auN` = **56 bp**

Where these values came from: our own exact-arithmetic script and a hand-worked case; Worked by hand by Drybench on 11 November 2026 (Drybench ruling, 11 November 2026, cases). This is not an independent check.

At build the tool returned this answer within the tolerance the file states: every figure exact: lengths, counts and levels as integers; auN equal to the correctly rounded double of the exact fraction; texts, statuses, codes and withheld rules exact.

Who worked this case: not recorded.

### What it refuses, and its input ranges

- `NO_SEQUENCES_KEPT`: no length is at least the stated minimum length, so no figure exists Next: Lower the minimum length, or send the lengths with lengthFilter none.
- `DUPLICATE_LEVEL` (invalid input): a level is sent twice, or 50 is sent although N50 is always returned

### Flags and notes a reply may carry

A note a reply may carry:

- `LX_TIES`: Lengths tie at Nx at one or more levels, so Lx (the smallest number of sequences reaching the share) and countAtOrAboveNx (the number of sequences at least Nx long) differ; a tool that reports the second as L50 gives a larger figure.

### Changes

No correction is logged for genome-assembly-contiguity\@1.0.1.

## Tools that use it

- [`genome_assembly_contiguity`](https://www.drybench.com/methods/tools/genome-assembly-contiguity)

## Cite this version

Assembly contiguity: Nx, Lx, NGx, LGx and auN from sequence lengths. Drybench; genome-assembly-contiguity\@1.0.1; [https://www.drybench.com/methods/m/genome-assembly-contiguity/1.0.1](https://www.drybench.com/methods/m/genome-assembly-contiguity/1.0.1) (accessed \[date\]).
