GC skew profile along a sequence
genome_gc_skew
Works out GC skew in adjacent windows along a sequence, and where its cumulative extremes fall.
- Runs
- On the server
- Level
- Checked against a reference: Biopython 1.88 GC skew
What it is
Returns GC skew (G - C)/(G + C) in adjacent windows, its cumulative sum, and where the cumulative extremes fall. Use when profiling strand composition along a sequence; a window with no G or C has no skew. Not for overall GC content: use `seq_gc_content`. Window size in bp is required; refuses a window longer than the sequence and more than 200 windows.
Field: Sequencing and genomics.
What it does
You give
sequence(required): The sequence, letters only (IUPAC codes count as neither G nor C); no header line or spaces. Leading and trailing white space is removed before the pattern is checked.windowSize(required): Window size, whole bp. Must be above 0 bp.
No request is recorded for this tool.
Limits
- Research arithmetic for planning sequencing libraries and runs and for genomic coordinate bookkeeping; it does arithmetic on the inputs it receives, and does not measure the library, the instrument or the data.
- A composition statistic on a linear sequence from its first base: windows do not wrap, so the extremes move with the chosen start; every window adds equal weight to the cumulative skew, a short last window included.
- In many bacterial genomes the cumulative extremes lie near the replication origin and terminus (Lu and Salzberg 2020); this tool identifies neither.
- Every computed number a reply returns, other than an integer or an exact decimal, is rounded once to 12 significant figures: to the nearest, a change of at most 5 × 10⁻¹² of its value, except that a lower bound is rounded down and an upper bound up, a change of less than 1 × 10⁻¹¹; the method computes, and decides any pass or fail, on the unrounded value.
It will not answer when
- the window is longer than the sequence.
- the sequence makes more than two hundred windows at this size.
Every input, with its units2 inputs
sequence(required): The sequence, letters only (IUPAC codes count as neither G nor C); no header line or spaces. Leading and trailing white space is removed before the pattern is checked.windowSize(required): Window size, whole bp. Must be above 0 bp.
Every refusal, with its code2 refusals
| Code | When |
|---|---|
WINDOW_LONGER_THAN_SEQUENCE | the window is longer than the sequence. |
TOO_MANY_WINDOWS | the sequence makes more than two hundred windows at this size. |
The calculation
The method's equations, constants and worked example.
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 |
|---|---|
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 1.
A definition, not a model: the equation states what the quantity means. A different convention gives a different number.
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
- w1 = 0.5, from sequence, windowSize; by the equation above; gives result.windows[0].skew.
- w2 = -1, from sequence, windowSize; by the equation above; gives result.windows[1].skew.
- cum2 = -0.5, from w1, w2; by the equation above; gives result.windows[1].cumulativeSkew.
The working, as the case writes it:
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.
Sources
Lu J, Salzberg SL (2020), SkewIT: The Skew Index Test for large-scale GC Skew analysis of bacterial genomes, PLoS Computational Biology 16:e1008439
Used for: GC skew and cumulative GC skew in adjacent windows along a sequence. At: 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.
Read in full, 11 November 2026
How it is checked
- Level
Checked against a reference.
- Checked against
An outside program, Biopython, 1.88; our own exact-arithmetic script and a hand-worked case.
- Cases
No case set is linked to this version.
- 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).
Changes to its methods0 changes
No change is logged for these method versions.