Genes, DNA and Chromosomes
Genetics and Heredity Fundamentals
Course 1 ยท Chapter 2 ยท Genes, DNA and Chromosomes
Genetics and Heredity Fundamentals 1 treated Mendel's "factors" as letters: A and a. This chapter asks what those letters physically are. The short answer is that an allele is a stretch of DNA, DNA is packaged into chromosomes, and the whole collection in a cell is its genome. As before, the code is Python 3, run before it is shown, and facts written from general knowledge are marked (check).
What DNA Is
DNA (deoxyribonucleic acid) is a long molecule built from a chain of small units called nucleotides. Each nucleotide has a sugar, a phosphate group and one of four bases: adenine (A), thymine (T), guanine (G) and cytosine (C). The sugar and phosphate form a backbone; the bases stick out sideways. The order of the bases is the information.
That makes DNA convenient for programmers: to a good approximation a piece of DNA is just a string over a four-letter alphabet.
The Double Helix and Base Pairing
DNA normally exists as two strands wound around each other in a double helix, a structure worked out in 1953 by James Watson and Francis Crick, building on X-ray data from Rosalind Franklin and Maurice Wilkins (check the details of who contributed what). The strands are held together by bonds between bases, and the pairing is strict:
| Base | Pairs with | Bonds between them (check) |
|---|---|---|
| A (adenine) | T (thymine) | 2 hydrogen bonds |
| G (guanine) | C (cytosine) | 3 hydrogen bonds |
Because of this rule, one strand completely determines the other. The two strands also run in opposite directions: each strand has a start (called the 5' end) and a finish (the 3' end), and the partner strand is read the other way round. So the partner of ATGC, written in the usual 5' to 3' direction, is GCAT, the reverse complement.
Output:
str.translate swaps every letter at once using the table from str.maketrans. The plain complement lines up letter for letter under the original; the reverse complement is the partner strand as it would be written in its own 5' to 3' direction. Taking the reverse complement twice gives back the original, which is the check on the last line.
Counting Bases and GC Content
Pairing has a consequence: in double-stranded DNA the number of A bases equals the number of T bases, and G equals C. This was noticed by Erwin Chargaff in the late 1940s (check), before the structure was known, and is called Chargaff's rule. It holds for the two strands taken together, not for a single strand.
The share of bases that are G or C is the GC content. It varies between species and between regions of a genome, and because a G–C pair has three bonds against two for A–T, GC-rich DNA is a little harder to pull apart (check).
This particular strand happens to have equal numbers of all four bases, which is a coincidence of the example, so the final line is only a real test because we build the partner strand and count both together. Try it on a lopsided strand such as AAAAGC: the single strand fails the A = T test, but the pair of strands passes.
Genes, Chromosomes and the Genome
A gene is a stretch of DNA that carries the instructions for making a product, usually a protein (chapter 3 follows how). The gene is where an allele lives: two alleles of the same gene are two versions of the same stretch of DNA, differing in some of their bases. Genes are not evenly packed; in humans most of the DNA lies between genes or inside them in non-coding regions, and the exact share that does something useful is debated (check).
A cell's DNA is divided among several long pieces, the chromosomes, each one a single enormous DNA molecule wrapped around proteins so that it fits inside the cell. The complete set of DNA in a cell is its genome. A chromosome holds many genes, and each gene sits at a fixed position on a particular chromosome, called its locus.
Mendel's rule that every plant has two copies of each factor now has a physical meaning: most cells of a plant or animal are diploid, holding chromosomes in matching pairs, one of each pair from each parent. The sex cells (eggs and pollen or sperm) are haploid, with one of each pair. The numbers differ by species:
All four numbers are from general knowledge (check). The count says nothing about complexity: it is a fact about how the DNA happens to be packaged. A pea has seven pairs, and Mendel studied seven traits; this is a well-known coincidence, and the question of whether his traits sat on different chromosomes comes back in chapter 5 (check the details there).
How Big Is a Genome?
The human haploid genome is usually quoted as about 3.1 billion base pairs (check). If each base needs two bits (four choices), a quick calculation gives the raw information content:
So a haploid human genome would fit in under a gigabyte, and the DNA of one set of chromosomes, laid end to end, is about a metre long (using 0.34 nanometres per base, check). All of that sits inside a cell nucleus a few micrometres across, which is why DNA is so tightly wound and packaged.
Challenges
Write reverse_complement(s). For ATGC, GGGATTT and AAAACCCGGT, print each sequence, its reverse complement, and whether applying the function twice returns the original. Then test whether GAATTC and GGATCC equal their own reverse complement.
Given four sequences, print them in order of increasing GC content with the value to two decimals, and then name the one with the highest GC content.
๐ View solutionWrite dna_bytes(bases, bits_per_base) and use it to estimate, in megabytes, the raw storage for the haploid genomes of three organisms, then the human figure in gigabytes if each base were stored as one 8-bit character instead.
Quick Reference
- DNA: a chain of nucleotides with bases A, T, G, C; the base order is the information
- Pairing: A with T, G with C; one strand fixes the other
- Reverse complement: the partner strand written 5' to 3'
- GC content: the fraction of bases that are G or C
- Gene: a region of DNA; allele: a version of it; chromosome: a whole DNA package
- Diploid cells have pairs of chromosomes; haploid sex cells have one of each
- Check: the chromosome numbers, genome size, bond counts, and who contributed what to 1953