Two Genes at Once

Genetics and Heredity Fundamentals

Course 1 ยท Chapter 5 ยท Two Genes at Once

Genetics and Heredity Fundamentals 1 followed one gene at a time. Real organisms have thousands, and they are inherited together. This chapter asks what happens when we follow two genes in the same cross. There are two possible answers. If the genes sit on different chromosomes, they are shuffled independently, as Genetics and Heredity Fundamentals 4 described. If they sit close together on the same chromosome, they tend to travel as a block. All the programs here are Python 3.

What was run, and what was not
Every program in this chapter was run and the output shown is what it printed. The biology is written from general knowledge; items marked (check) are the ones to verify first. Where a program uses random numbers it fixes the seed, so the same output appears each time.

Independent Assortment

Take two genes. Gene 1 has alleles A (dominant) and a; gene 2 has alleles B (dominant) and b. A parent of genotype AaBb is heterozygous for both, and is called a dihybrid (check). If the two genes are on different chromosomes, the choice of A or a in a gamete has no effect on the choice of B or b. This is the principle of independent assortment, Mendel's second law (check). So the parent makes four kinds of gamete, all equally likely.

from itertools import product print(list(product("Aa", "Bb")))
[('A', 'B'), ('A', 'b'), ('a', 'B'), ('a', 'b')]

Each gamete takes one allele of each gene, so the four combinations are AB, Ab, aB and ab, each with chance 1/4. Two of these, Ab and aB, are combinations that neither of the parent's own parents necessarily had together; they are made by the shuffle.

The Dihybrid Cross

Now cross two AaBb parents. Each makes four gamete types, so the Punnett square from Genetics and Heredity Fundamentals 1 has 4 x 4 = 16 cells. We can build it by pairing every gamete of one parent with every gamete of the other, and then work out what each child looks like. A child shows the dominant form of a trait if it has at least one dominant allele of that gene.

from itertools import product from collections import Counter def phenotype(alleles): a = "A" if "A" in alleles[:2] else "a" b = "B" if "B" in alleles[2:] else "b" return a + b g = list(product("Aa", "Bb")) counts = Counter() for g1 in g: for g2 in g: child = g1[0] + g2[0] + g1[1] + g2[1] counts[phenotype(child)] += 1 print(len(g) ** 2) print(sorted(counts.items(), reverse=True)) print(9 / 16, 3 / 4 * 3 / 4)
16 [('ab', 1), ('aB', 3), ('Ab', 3), ('AB', 9)] 0.5625 0.5625

Of the 16 equally likely children, 9 show both dominant forms (AB), 3 show only the first (Ab), 3 show only the second (aB) and 1 shows neither (ab). This is the famous 9:3:3:1 ratio (check). Notice where it comes from. For each gene on its own, the chance of the dominant form is 3/4, from Genetics and Heredity Fundamentals 1. Because the genes are independent, the chances multiply: 3/4 x 3/4 = 9/16, which is what the count gave. The same product rule gives 3/4 x 1/4 = 3/16 for each of the middle two classes and 1/4 x 1/4 = 1/16 for the last.

PhenotypeChance (product rule)Out of 16
both dominant (AB)3/4 x 3/49
first dominant only (Ab)3/4 x 1/43
second dominant only (aB)1/4 x 3/43
neither (ab)1/4 x 1/41

Seeing the Ratio by Simulation

The exact count is a statement about chances; real offspring come in whole numbers that wobble around it, as in Genetics and Heredity Fundamentals 1. A simulation of 16,000 children should land near 9, 3, 3 and 1 per 16.

import random from collections import Counter def make_gamete(rng): return rng.choice("Aa") + rng.choice("Bb") def child_pheno(rng): g1, g2 = make_gamete(rng), make_gamete(rng) a = "A" if "A" in (g1[0], g2[0]) else "a" b = "B" if "B" in (g1[1], g2[1]) else "b" return a + b rng = random.Random(5) n = 16000 counts = Counter(child_pheno(rng) for _ in range(n)) for k in ["AB", "Ab", "aB", "ab"]: print(k, counts[k], round(counts[k] / n * 16, 2))
AB 8897 8.9 Ab 3011 3.01 aB 3092 3.09 ab 1000 1.0

The last column rescales each count to "out of 16": 8.9, 3.01, 3.09 and 1.0, close to 9, 3, 3 and 1. With only a few dozen children the ratio would look much rougher.

9:3:3:1 is not a law of nature
The ratio holds only when the genes assort independently, each trait has simple dominance, and the numbers are large. Other ratios mean something else is going on: linked genes (below), or interactions between genes and more complicated dominance, covered in Genetics and Heredity Fundamentals 6 (check).

The Test Cross

How can a breeder tell whether a plant that shows both dominant forms is really AaBb or something else such as AABB? The answer is a test cross: cross it with an individual that is homozygous recessive for both genes, aabb (check). That partner can only give ab gametes, so every offspring shows exactly what the tested parent's gamete carried. The offspring are a direct readout of the gametes.

def linked_gamete(rng, r): # parent is AB / ab: one chromosome carries A and B, the other a and b if rng.random() < r: return rng.choice(["Ab", "aB"]) return rng.choice(["AB", "ab"]) rng = random.Random(8) for r in (0.5, 0.1, 0.0): c = Counter(linked_gamete(rng, r) for _ in range(20000)) print(r, [(k, c[k]) for k in ("AB", "ab", "Ab", "aB")])
0.5 [('AB', 4878), ('ab', 5001), ('Ab', 5053), ('aB', 5068)] 0.1 [('AB', 9159), ('ab', 8855), ('Ab', 999), ('aB', 987)] 0.0 [('AB', 10119), ('ab', 9881), ('Ab', 0), ('aB', 0)]

This block, which reuses random and Counter from the previous program, previews the next section. It shows what a test cross reveals when the genes are on the same chromosome. The number r is explained below; read the three lines as three different situations and compare them.

Linkage

Genes on the same chromosome are said to be linked (check). Picture a parent whose one chromosome carries A and B and whose other chromosome carries a and b, written AB / ab. If the chromosomes were never cut and rejoined, the only gametes would be AB and ab: the alleles on one chromosome would always stay together. Crossing over (Genetics and Heredity Fundamentals 4) breaks the association. A gamete that carries Ab or aB has a chromosome made of parts of both, and is called recombinant; the gametes AB and ab are parental (check).

The fraction of recombinant gametes is the recombination frequency, called r in the code. Read the three lines of output above:

  • r = 0.5: all four classes are about equal, about 5,000 each of 20,000. This is exactly the independent pattern. Genes on different chromosomes behave as if r were 0.5, and so do genes so far apart on one chromosome that a crossover between them is nearly certain to happen in about half of cases (check).
  • r = 0.1: the parental classes AB and ab dominate (about 9,000 each) and the recombinant classes are small (about 1,000 each). The genes tend to stay together.
  • r = 0.0: no recombinants at all. The genes are inherited as if they were a single gene.

The closer two genes lie on a chromosome, the less likely a crossover falls between them, and so the smaller r is. A value of r can never usefully exceed 0.5, because by then the genes look unlinked.

Measuring Distance with r

The relationship runs the other way too: from a test cross we can count the recombinant offspring and estimate r, which tells us how far apart the genes are. In genetics a recombination frequency of 1% is called one map unit, or one centimorgan (check). Arranging genes along a chromosome from such numbers gives a genetic map. This is how maps were first drawn, long before genomes could be read directly (check). The code below imitates a test cross of 5,000 offspring where the true value is 0.12.

rng = random.Random(21) c = Counter(linked_gamete(rng, 0.12) for _ in range(5000)) recomb = c["Ab"] + c["aB"] print(dict(c)) print(recomb, sum(c.values()), round(recomb / sum(c.values()) * 100, 1))
{'ab': 2204, 'AB': 2188, 'Ab': 288, 'aB': 320} 608 5000 12.2

There are 288 + 320 = 608 recombinant offspring out of 5,000, so the estimate is 12.2%, or about 12.2 map units, close to the true 12. With more offspring the estimate gets closer. The genes in this example would be drawn about 12 units apart on a map.

Map units are only approximate
Map distance adds up well over short stretches, but over long ones two crossovers between the same pair of genes cancel each other, so some recombinants are missed and the real distance is underestimated (check). Distances in map units are also not the same as distances in DNA letters; crossing over happens more often in some regions than others (check).

Challenges

Exercise 1

Cross two parents that are heterozygous for n independent genes (n = 1, 2 and 3). For each n, enumerate every pair of gametes with itertools.product, count the children that show the dominant form of every gene, and compare the fraction with (3/4)n using fractions.Fraction.

๐Ÿ“„ View solution
Exercise 2

Simulate a test cross of AaBb with aabb for independent genes. Use random.Random(13) and 40,000 offspring. Print the count and fraction of each of the four classes, and the difference between the largest and the smallest class.

๐Ÿ“„ View solution
Exercise 3

Write estimate(rng, r, n) that simulates n test-cross offspring from an AB / ab parent with true recombination frequency r, and returns the fraction that are recombinant. With random.Random(5) and 100,000 offspring, run it for r = 0.05, 0.2 and 0.5 and print the estimate and its distance from the true value.

๐Ÿ“„ View solution

Quick Reference

  • Independent assortment: genes on different chromosomes are sorted separately, so their chances multiply
  • Dihybrid cross (AaBb x AaBb): 16 equally likely cells; phenotypes 9 : 3 : 3 : 1
  • Test cross: cross with the homozygous recessive; offspring reveal the gametes directly
  • Linkage: genes on the same chromosome tend to be inherited together
  • Recombination frequency r: fraction of recombinant gametes; 0 to 0.5; 1% is one map unit
  • Check: the names and statements of the laws, the map unit definition, and the limits of map distances
Coming next
Genetics and Heredity Fundamentals 6 looks at traits that do not follow the simple dominant and recessive pattern.