# GC skew and cumulative GC skew in adjacent windows along a sequence, version 1.0.2

genome-gc-skew\@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; Biopython 1.88; Lu and Salzberg 2020 re-read; a composition statistic, no origin or terminus call. Reference kind: an outside program, Biopython, 1.88; 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/genome-gc-skew) · [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; Biopython 1.88; Lu and Salzberg 2020 re-read; a composition statistic, no origin or terminus call. Reference kind: an outside program, Biopython, 1.88; our own exact-arithmetic script and a hand-worked case.** `genome-gc-skew@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:** GC skew (G − C)/(G + C) in adjacent windows and its cumulative sum, as Lu and Salzberg 2020 define them (PMC7717575, re-read at source 14 November 2026); otherLetterCount counts the letters other than A, C, G, T and U. Compared with Biopython 1.88 on windows with G or C, and with a second implementation in Python by a separate agent of the same model family (112 cases, 25 of its own at the edges), summed in exact fractions. A composition statistic on a linear sequence; no origin or terminus call.

(G - C)/(G + C) per adjacent window from the first base; cumulative skew at each window's end; the cumulative extremes by window, with ties.

- **How results are reported:** none: full double precision; ties of the cumulative extremes decided in exact fractions
- **Uncertainty:** Exact composition arithmetic.
- **Reference, as its record states it:** Biopython 1.88 GC skew
- **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

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

Run through the tool at build against an outside program, Biopython, 1.88; our own exact-arithmetic script and a hand-worked case: 127 agree within the tolerance the file states, 77 refuse as the case expects, 0 differ, 0 were not run.

- **File 1, 21 cases**
  - **Where the expected values came from:** an outside program, Biopython 1.88
  - **Recorded on:** 2026-11-10
  - **Reference:** Biopython, 1.88; licence LicenseRef-Biopython-License-Agreement
  - **Tolerance as the file states it:** skews absolute 1e-12; cumulative skews absolute 1e-9; counts, positions, flags, withheld rules, statuses and codes exact

- **File 2, 29 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, standard library), 2026-11-14; licence PSF-2.0
  - **Tolerance as the file states it:** skews absolute 1e-12; cumulative skews absolute 1e-9; counts, positions, flags, withheld rules, statuses and codes exact

- **File 3, 42 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, standard library), 2026-11-14; licence PSF-2.0
  - **Tolerance as the file states it:** skews absolute 1e-12; cumulative skews absolute 1e-9; counts, positions, flags, withheld rules, statuses and codes exact

- **File 4, 112 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:** skews absolute 1e-12; cumulative skews absolute 1e-9; counts, positions, flags, withheld rules, 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

Overlapping or sliding windows; circular sequences (the windows start at the first base); any origin or terminus call (the reading Lu and Salzberg describe is not made); Grigoriev 1998 itself (abstract only).

### Definition or model

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

### Equations

```equation
skew_w = (G_w - C_w)/(G_w + C_w), undefined when G_w + C_w = 0
cumulative_w = Σ_{v<=w, defined} skew_v, so 0 before the first defined window and carried unchanged through an undefined one
windows are 1-based closed [start, end]
each extreme is reported at the first window holding it, with the count of windows tied at that value, undefined windows included
otherLetterCount_w = the number of letters in window w other than A, C, G, T and U, read without regard to case (IUPAC ambiguity codes such as N, R or S are counted there, and count as neither G nor C), so G_w + C_w + otherLetterCount_w + (A, T and U letters) = the window's length
windows are linear, adjacent and non-overlapping from the first base, the record's choice: SkewIT circularizes the genome and allows adjacent or overlapping windows (Lu and Salzberg 2020, Materials and methods, The SkewIT algorithm), so on a circular genome values near the sequence ends differ from SkewIT's
a window in kb is 10^3 bp (decimal), and whether it is a whole number of bp is decided on the exact value of its shortest decimal (0.004 kb is 4 bp), else NOT_AN_INTEGER
```

| Symbol | Meaning and unit |
| --- | --- |
| G\_w, C\_w | counts of G and C in window w |
| otherLetterCount\_w | letters in window w other than A, C, G, T and U, case ignored |

Source: Lu J, Salzberg SL (2020), SkewIT: The Skew Index Test for large-scale GC Skew analysis of bacterial genomes, PLoS Computational Biology 16:e1008439, section Materials and methods, The SkewIT algorithm, Eq (1): GC skew (G - C)/(G + C) in adjacent windows; Introduction, Quantitative measurements of GC skew: the cumulative skew, the sum of the skews of adjacent windows, version of record, Europe PMC full-text XML (PMC7717575); a preprint exists (PPR115049) and was not used; 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 35f8d5cabf4c. Free to read (CC BY), checked 2026-11-11. No erratum found (searched Europe PMC commentCorrectionList for PMC7717575 (lists only the preprint)), 2026-11-11.

### Constants

Constants: none used.

### Worked example

Worked example: one case of genome-gc-skew\@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**

- sequence = GGGCCAAAATTTT
- windowSize = 4 bp

**Steps**

1. w1 = 0.5, from sequence, windowSize; by the equation above; gives result.windows\[0\].skew.
2. w2 = -1, from sequence, windowSize; by the equation above; gives result.windows\[1\].skew.
3. cum2 = -0.5, from w1, w2; by the equation above; gives result.windows\[1\].cumulativeSkew.

The working, as the case writes it:

```equation
skew = (G - C)/(G + C) per adjacent window from the first base
cumulative = sum of the defined skews up to and including each window, at its end
extremes over every window's cumulative value: the first window reaching it, and how many tie
```

**Answer**

- `result.windows[0].skew` = **0.5**
- `result.windows[1].skew` = **-1**
- `result.windows[1].cumulativeSkew` = **-0.5**

Where these values came from: an outside program, Biopython 1.88; Biopython 1.88 Bio.SeqUtils.GC\_skew on windows with G or C (it returns 0 where G + C = 0; this method withholds); exact fractions; the definition from Lou et al. 2020 (SkewIT).

At build the tool returned this answer within the tolerance the file states: skews absolute 1e-12; cumulative skews absolute 1e-9; counts, positions, flags, withheld rules, statuses and codes exact.

Who worked this case: not recorded.

### What it refuses, and its input ranges

- `WINDOW_LONGER_THAN_SEQUENCE`: the window is longer than the sequence Next: Use a window no longer than the sequence.
- `TOO_MANY_WINDOWS`: the sequence makes more than two hundred windows at this size Next: Use a larger window.

### Changes

No correction is logged for genome-gc-skew\@1.0.2.

## Tools that use it

- [`genome_gc_skew`](https://www.drybench.com/methods/tools/genome-gc-skew)

## Cite this version

GC skew and cumulative GC skew in adjacent windows along a sequence. Drybench; genome-gc-skew\@1.0.2; [https://www.drybench.com/methods/m/genome-gc-skew/1.0.2](https://www.drybench.com/methods/m/genome-gc-skew/1.0.2) (accessed \[date\]).
