Counting nucleotides from a sequence
✓ Published0🌍 Public
RRobColeman
Last edited Oct 27, 2015
Created on Oct 27, 2015
This example shows how to calculate the percentage of G and C nucleotides in a DNA sequence, a common metric in genomics. It first counts each nucleotide type (A, C, G, T) using a Python dictionary, then normalizes those counts by the total sequence length to compute percentages. The code defines two functions, `count_nucleotides_by_type` and `normalize_nucleotide_count`, and finally prints the combined G and C percentage for a hardcoded sequence string. No external visualization libraries are used; the output is a single text result.
AI-generated description