Human Genome Analysis Lab 7 : How Many Genetic Ancestors Do I have?

Overview - Genetic vs genealogical ancestors

Learning Objectives

  • Understand the difference between genetic and genealogical ancestors
  • Learn to call R scripts within a R markdown document

Genetic vs genealogical ancestors

The chart below shows a family tree radiating out from one individual. Each successive layer out shows an individual’s ancestors another generation back in time, parents, grandparents, great-grandparents and so on back (magenta for female, blue for male).

Drawing

The number of genealogical ancestors you have in n generations is 2^n: 2 parents, 4 grandparents, 8 great-grandparents, and so forth until you are descended from so many people (e.g. 20 generations back you potentially have 1 million ancestor) that it is quite likely that some people back then are your ancestors multiple times over.

Your number of genetic ancestors will not grow linearly forever. If we go far enough back your number of genetic ancestors will get large enough, on order of the size of the population you are descended from, that it will stop growing as you will be inheriting different chunks of genetic material from the same set of individuals multiple times over. At this point your number of ancestors will begin to plateau. Indeed, once we go back far enough actually your number of genetic ancestors will begin to contract as human populations have grown rapidly over time.

How quickly then does your number of genetic ancestors grow, i.e. those ancestors who contributed genetic material to you? The difference between genealogical ancestors and genetic ancestors is that genetic ancestors are the ones that you actually got some DNA from. They’re a subset of your genealogical ancestors. Humans have about 3 billion base-pairs of DNA, so that limits the number of genetic ancestors to about 3 billion no matter how far back you go. There are around 46,000 recombincation hotspots, places where crossovers usually happen. Each of the 46,000 segments bounded by neighboring hotspots usually has a single line of descent, so you’re limited to about 46,000 genetic ancestors.

The linear growth after that is a bit more complicated. The linear growth is due to having a limited number of crossovers per chromosome per generation. Each generation, you don’t just get one side of one of your parent’s chromosomes. Instead, the parent mixes their pair before splitting it into two (meiosis). The points where the pairs cross are called crossovers. There’s around one or two crossovers per chromosome pair per generation.

However over time you do not inherit an equal amount of DNA from each ancestor. Here is a plot of the number of genetic ancestors compared to genealogical ancestors over generations. After about eight generations back, the number of genetic ancestors only increases linearly with the number of generations, while the number of genealogical ancestors keeps increasing exponentially. Once you go back 20 generations, you have only 1300 or so genetic ancestors despite having over a million genealogical ancestors.

Drawing

The 23rd chromosome is special, it’s the XY chromosome. If you’re a male you have XY, if you’re female you have XX. The male does not mix the XY, daughters get the X directly and sons get the Y directly. If you’re female you have XX, and XX has about as many crossovers as any other chromosome. Other than that, there’s always at least one crossover per chromosome per generation (otherwise meiosis doesn’t work properly), and sometimes more than one. How many more is proportional to the length of the chromosome. If you’re male, you have an average of 26.4 crossovers total when producing sperm, so spread among 22 chromosomes, that’s a little over 1 crossover per chromosome. If you’re female, it’s more like an average of 41.1 crossovers when producing eggs, so given 23 chromosomes total, that’s a little under 2 crossovers per chromosome. If you’re male, you got your Y chromosome from exactly 1 ancestor n generations back. The X chromosome (men have half a pair, women have a whole pair) is also unusual: you’re most likely to get it from your mother’s father’s mother’s father’s mother etc, but it might have come from your mother’s mother’s etc.

This code requires the .R scripts in the R_helper folder to run.

Six Generations

R code
# Run the simulation
k = 7 # number of generations - 1
source("R_helper/family_tree_plotting_functions.R")
recoms<-read.table("R_helper/recombination_events.out",as.is=TRUE,head=TRUE)
source("R_helper/transmission_sims_functions.R")
inds.sex<-unique(recoms$sexind)

family.chunks<-simulate.pedigree(num.meioses=k)
genome.length = 2871008379 # guessed at this number to make the code work
R code
par(mar=c(0,0,0,0))
pie<-lapply(1:2^k,function(x){c(k,k)})
repeat.cols<-c("white","white")
my.cols<-rep(repeat.cols,2^(k-1))
my.pie(pie,sector.colors=my.cols)

for(i in (k-1):1){
    pie<-lapply(1:2^i,function(x){c(i,i+1)})
    repeat.cols<-c("magenta","blue")
    my.cols<-rep(repeat.cols,2^(i-1))
    num.blocks<-sapply(family.chunks[[i]],function(ind){ sum(unlist(lapply(ind,function(x){if(is.null(x)){return(0)}; nrow(x)})))})
    amount.genome<-unlist(lapply(family.chunks[[i]],function(ind){ sum(unlist(lapply(ind,function(x){if(is.null(x)){return(0)}; sum(x[,2]-x[,1])})))}))
    frac.genome<-amount.genome/genome.length

#my.cols<-sapply(1:length(my.cols),function(i){adjustcolor(my.cols[i],0.03+0.97*frac.genome[i])})
my.cols<-sapply(1:length(my.cols),function(i){adjustcolor(my.cols[i],frac.genome[i]/max(frac.genome))})
my.cols[num.blocks==0]<-"white"

my.pie(pie,add=TRUE,sector.colors=my.cols)
# reformat x-scale text here. The first part controls text positioning (-i-0.5,-0.8). cex is text size
    text(-i-0.5,-0.8,paste(format(100*mean(frac.genome)/2,digit=2), format(100*mean(frac.genome==0),digit=2),sep=", "),cex=0.9,srt=90)
    text(i+0.5,-0.8,paste(format(100*min(frac.genome)/2,digit=2),"-",format(100*max(frac.genome)/2,digit=2)),cex=0.9,srt=90)
# reformat x label text here. The first part controls text positioning (-k/2-1,-1.8). cex is text size
    text(-k/2-0.7,-1.6,"Mean % contribution, % with zero",cex=0.9) 
  text(k/2+1,-1.6,"Min-Max % contribution",cex=0.9)
}

Exercises

Excercise 1

Use the above code (which relies on R files in the R_helper folder) to make graphs with 6, 8, 10 and 12 generations. If you are working on your own computer you will need to download the files in R_helper on the course github.

Excercise 2

Discuss the pattern of inheritance you observe. From the perspective of DNA matches in 23andMe and Ancestry, at what point would you have a genealogical cousin that might not be a genetic cousin (e.g. 5th cousin)?

Acknowledgements

The R code is derived code from a blog post by Graham Coop