Calculate the GC content of a DNA or RNA sequence, with base counts and a sliding window.
GC% is the number of G and C bases divided by the number of A, C, G, T and U bases, multiplied by 100. Ambiguity codes such as N, R and Y are left out of that total and counted separately.
Whitespace, digits and FASTA header lines are ignored. A sliding window shows how GC% changes along the sequence, which is useful when a gene is not uniform.
Does N count toward GC content? No. Only A, C, G, T and U are in the denominator. Other letters are reported as ambiguous or invalid so they do not quietly change the percentage.
How is RNA treated? U is counted with A and T in the AT%, not in the GC%. A sequence that mixes T and U is still scored, and both counts are shown.