Lesson 11

A

Locked — confirm your name above to begin.

Being heterozygous at a locus means having two distinct genetic ancestors for that locus, or having acquired a new mutation. Inbreeding reduces the number of ancestors you have, and so makes having two distinct ancestors for a given locus less likely.

You are given a starting population, with some frequency of a purple allele and some frequency of a yellow allele. Your goal is to set the inbreeding (the probability a mate is a sibling) and the starting frequency of the purple allele, such that the ending heterozygosity after 15 generations is within the target. You can watch how the F statistic changes value over time, below the panel describing the homozygotes and heterozygotes. Pick the practice run option, and practice a few times before trying to hit each target. There's a stochastic element, but you're going to get five attempts. Hit as many targets as you can.

  • 400 diploid individuals, focusing on one biallelic locus.
  • No selection is present in this simulation.
  • Only two options: the probability a mate is a sibling, and the starting frequency of the purple allele.
  • F: how far the heterozygote count falls short of what random pairing would give.

R code

# 400 individuals, two copies each, at one locusp <- 0.5          # how common the purple allele isf <- 0            # probability a mate is a full siblingHo <- mean(a != b)   # heterozygotes, countedp  <- mean(c(a, b))   # the frequency they implyHe <- 2 * p * (1 - p)  # what random pairing would giveF  <- 1 - Ho / He

Predict

Controls

0.00
0.50

To open Stage B

  • Hit the target F three times out of five. 0 of 5 attempts
An F of 1 — no heterozygotes at all — means two populations, not one: a yellow one and a purple one that aren't interbreeding. Stage B is open.

B

Solve Stage A to unlock this section.

The effects of extinction last forever — once an allele is gone, it's gone (absent mutation restoring it). This means that when a population shrinks down, drift speeds up, and many alleles are lost. When the population recovers, those lost alleles don't return. The genetic diversity will take a long time to build back up, as even while a population is growing, alleles are drifting to extinction.

For this activity, you're going to change the population size (top plot) through time. Then you're going to simulate genes drifting within that population. We'll be looking at F (the inbreeding coefficient). F is measured as 1 − (observed heterozygotes / expected heterozygotes). So an F = 1 happens when there are zero heterozygotes (all individuals are homozygous — usually means all but one allele has gone extinct if you're looking at a single population).

F changes over time as the number of heterozygotes changes. You'll try and create a population history that is likely to produce a given trend in homozygosity (F) over time. Use the practice toggle to get a feel for it, and then try to hit each target.

Notice whether or not F ever goes down through time!

  • Top plot: how many individuals breed in each of 60 generations. Drag across it to redraw it.
  • Bottom plot: F — how much of the starting heterozygosity is gone.
  • Nothing is selected, and nobody picks a relative. Only the headcount changes.

R code

# a population size you draw, and 100 loci drifting in itN    <- c(500, 500, 500, ...)   # breeders, generation by generationloci <- 100p <- rep(0.5, loci)H <- mean(2 * p * (1 - p))for (n in N) {  p <- rbinom(loci, 2 * n, p) / (2 * n)   # the next generation's copies  H <- c(H, mean(2 * p * (1 - p)))}F <- 1 - H / H[1]

Predict

Controls

Drag across the top plot to set the headcount.

To open Stage C

  • Match the target F curve three times out of five. 0 of 5 attempts
F is not about how many are there at the end. It is about how few there ever were. Stage C is open.

C

Solve Stage B to unlock this section.

You inherit alleles, not genotypes. A genotype is a pairing of alleles, made fresh each generation from what has been passed on from the parents, and taken apart again when a given individual breeds. Which allele a parent passes on is usually completely random. There is no selection process here for most scenarios. Instead, it's a 50-50 shot, regardless of the effects of the allele. So bad alleles are passed on as frequently as good alleles, and both are passed on as frequently as neutral alleles during meiosis. So, parent to child, transmission of an allele is random. However, the frequency of an allele in a population does not necessarily need to be so.

Here we still don't have selection — that will be in Lesson 12. Rather, we are looking at a pedigree with a given topology, a given shape of connections. You can control that to a certain extent by manipulating the inbreeding in your controls. And you can manipulate the starting gene frequencies by clicking on founders and editing their genotypes. You can then run a simulation that will randomly select which allele gets passed on from each parent to their offspring, and track the frequency of the alleles over time as they change — not due to selection, but due to the random noise of meiosis, combined with the random noise of minor differences in actual reproductive success.

In this simulation, every individual has the same expected number of offspring, and no allele has any effect on that whatsoever. The only thing you're varying is the amount of inbreeding, and as you vary it, you will see different levels of heterozygosity at the end.

  • Click a founder in the top row, then pick its two alleles. Two of the same colour is a homozygote.
  • Pass it on: every offspring takes one copy from each parent, picked by a coin.
  • The slider rebuilds the tree with more or fewer matings between relatives.
  • New tree: other families, same inbreeding. A hollow dot is a couple with no offspring.
  • Bottom plot: how common each founder allele is in each generation, and F in each generation. Faint lines are single runs.
  • Tick practice for a run that does not count.

Predict

The founder you clicked

Click a founder in the top row.

Controls

0.0

To open Stage D

  • Hit the target bottom row three times out of five. 0 of 5 attempts
Inbreeding never made a new allele. It only ever found the same one twice. Stage D is open.

D

Solve Stage C to unlock this section.

For Part D, now we're going to reuse the moose that we messed around with in Lesson 10. We're going to simulate 200 different genetic states for the moose, and let these genes drift across the population. We're not going to see the moose population trajectory in this. Instead, we're going to look at the heterozygosity over time.

You're going to manipulate how many alleles for the locus we're talking about there are at the beginning, the number of individuals in our population, and the inbreeding — how inbred are they? These are going to give you different values of the effective population size, Ne. Your goal is going to be to try and predict when the alleles will go extinct in the different population runs.

  • The plot: 200 populations, one locus each, each run until it is down to one allele. A faint line is one population's heterozygosity: the share of its individuals that are heterozygotes.
  • Dots: the generation each population was down to one allele. The red line is the target: make your dots take its shape.
  • F is held where you set it, every generation.
  • You found the moose's effective population size in Lesson 10.
  • Tick practice for a run that does not count.

R code

# 200 populations, one locus, each run until one allele is leftk <- 20          # alleles at the start, equally commonN <- 150          # individualsF <- 0.00         # held there every generations <- 2 * F / (1 + F)  # chance an offspring's two parents are one individualgens <- replicate(200, {  g <- matrix(sample(rep_len(1:k, 2 * N)), 2)   # two copies each  t <- 0  while (length(unique(c(g))) > 1) {    p1 <- sample(N, N, TRUE)    p2 <- ifelse(runif(N) < s, p1, sample(N, N, TRUE))    g  <- rbind(g[cbind(sample(2, N, TRUE), p1)],                g[cbind(sample(2, N, TRUE), p2)])    t  <- t + 1  }  t})mean(gens); sd(gens)   # the shape the target judges: average and spreadNe <- N / (1 + F)4 * Ne

Predict

Controls

20
150
0.00

To open Stage E

  • Match the target shape three times out of five. 0 of 5 attempts
Stage E is open.

E

Solve Stage D to unlock this section.

One factor that we saw in an earlier lesson, and you should remember from Cell & Molec, is recombination. We have, so far this lesson, ignored recombination. But you should never forget recombination is happening in sexually reproducing populations, because individual alleles are not passed on individually. Alleles are passed on in chromosomal fragments (haplotypes), and the specific fragments that get passed on result from recombination. So you get a chromosome from your mother that is a mishmash of pieces from your maternal grandfather and grandmother. The existence and size of these chromosomal chunks is driven by the recombination rate relative to the rate of other forces.

This interactive will follow a pedigree where you're going to track individual single nucleotide polymorphisms, SNPs, in a founding pair. They're going to produce some number of offspring, and you're going to control how many individuals each generation has, the number of generations, and the level of inbreeding — that is, how often are they breeding outside? How often are the descendants of the founders breeding with each other versus outbreeding with other individuals? Your goal will be to understand how genetic diversity changes — how the number of alleles present in the population varies. You can trace any individual allele through the whole tree, and you can see when they do and do not go extinct.

  • One pair founds the tree. A dashed box is a mate from outside: it carries none of the founders' SNPs.
  • Each individual is two bars: one genome from each parent, four chromosomes end to end.
  • Dots are the founders' twelve SNPs, coloured by the founder allele they came in on. Hover one to follow it through the tree.
  • Shaded: where an individual's two alleles trace back to the same founder allele. The share shaded is F.
  • Hover an individual to trace its ancestors. Click one, then hover another, to compare them.
  • Bottom plots: how many of the twelve founder SNPs are left, and π — the average number of dots two genomes from that generation differ at. Faint lines are earlier runs.
  • Tick practice for a run that does not count.
founder 1, allele a founder 1, allele b founder 2, allele a founder 2, allele b both alleles from the same founder allele mate from outside (no founder SNPs)

Predict

Controls

4
2
0.0

To finish

  • Hit the target number of founder SNPs three times out of five. 0 of 5 attempts
That is the whole of Lesson 11.

Good job!

That is the whole of Lesson 11. Your completion code is below — copy it and hand it in.