AlphaSimR is built upon the basics of genetics for the stochastic simulation of crop and animal breeding programs. This vignette will provide an overview of the genome, its inheritance, and the tools used to read it with supporting examples and code.
What is a genome?
The genome is the complete set of genetic information within an organism. It is made up of deoxyribonucleic acid (DNA), consisting of sequences of four types of nucleotide bases: adenine (A), cytosine (C), guanine (G), and thymine (T). Within one DNA molecule, there are two strands joined by base-pairs: A binds with T and C binds with G. This forms a double helix structure which can be visualized as a spiral ladder. These DNA molecules are condensed around supporting protein to form a thread-like structure known as chromosomes. Due to the different evolutionary history across species, how the DNA is packaged can vary substantially, including the number of chromosomes and the number of chromosome copies (ploidy). For example, humans have 23 pairs of chromosomes (22 autosomal, one non-autosomal) for ~three billion base-pairs. Whereas cattle have 30 pairs of chromosomes for fewer base-pairs at ~2.8 billion. As these species are both diploid, in each chromosome pair, one has been inherited from the father (paternal) and one has been inherited from the mother (maternal).
Genes, alleles, loci, genotypes, and haplotypes.
Although similar, there are essential differences in the terminology used. This next section will provide a short glossary for genes, alleles, loci, genotypes, and haplotypes.
Genes are segments of DNA that are transcribed to RNA, which for protein-coding genes is then translated to protein. Typically they will contain a few hundred to more than two million base-pairs with a codon (triplet base-pair) coding for either an amino acid or to start/stop.
An allele in a gene is a gene variant. More generally, an allele
represents a possible sequence of bases at a particular site on a genome
(known as a locus). When biallelic (two variants per locus) the allele
is either ancestral (denoted 0) or a mutant (denoted 1). Per the name,
new alleles arise from mutation. It is common to not have information
about the ancestral state, in which case the more frequent allele is
coded as 0 and the less frequent allele as 1. Founder haplotypes
simulated with runMacs or runMacs2 use
ancestral state information, with 0 for the ancestral allele and 1 for
the derived allele. quickHaplo generates alleles at random,
and imported haplotypes or genotypes keep the coding supplied by the
user.
A genotype is the combination of alleles across chromosome copies that an organism has at a specified locus or across loci. For instance, there are three possible genotypes for a diploid at a biallelic locus with ancestral allele A and mutant allele a: ancestral homozygous (AA) with allele dosage 0, heterozygous (Aa or aA) with allele dosage 1, and mutant homozygous (aa) with allele dosage 2. Genotypes can differ between individuals due to random segregation in inheritance.
A haplotype (haploid genotype) describes the physical grouping of alleles along the same chromosome. This means that these groups of alleles tend to be inherited together. New haplotypes are created through recombination.
What does this look like in AlphaSimR?
Let’s start with creating the founding genome using
runMacs. As mentioned, cattle have 30 pairs of chromosomes,
but for the purpose of this simulation we are only interested in three.
When we inspect the founderGenome we see that it has a ploidy of two
with 12 loci across three chromosomes (with four segregating sites on
each).
founderGenomes = runMacs(nInd = 10,
nChr = 3,
segSites = 4,
species = "CATTLE")
# Set simulation parameters
SP = SimParam$new(founderGenomes)
SP$setTrackRec(TRUE)
# Inspect the founder genomes
founderGenomes
#> An object of class "MapPop"
#> Ploidy: 2
#> Individuals: 10
#> Chromosomes: 3
#> Loci: 12Then we can observe the genotypes with pullSegSiteGeno.
Each row represents one of the ten individuals and each column
represents a defined locus labeled as the Chromosome_Locus. All will
have a value of zero to two equivalent to the allele dosage. Commonly,
this would be homozygous ancestral (0), heterozygous (1), and homozygous
mutant (2). Since this is a diploid, we are observing these genotypes
across the pair of chromosomes.
pullSegSiteGeno(founderGenomes)
#> 1_1 1_2 1_3 1_4 2_1 2_2 2_3 2_4 3_1 3_2 3_3 3_4
#> 1 2 0 0 0 0 1 1 0 1 0 2 0
#> 2 1 1 0 1 0 2 2 0 0 0 1 1
#> 3 2 2 1 0 0 2 2 0 1 0 1 1
#> 4 2 2 0 1 1 2 1 0 0 0 1 1
#> 5 1 1 0 0 1 2 1 0 0 1 0 0
#> 6 2 1 0 2 0 2 2 0 2 0 2 0
#> 7 1 1 0 1 1 2 1 1 0 2 0 0
#> 8 2 1 0 1 0 0 2 0 0 1 1 0
#> 9 1 0 0 0 0 2 1 0 0 1 1 0
#> 10 2 1 0 2 0 2 0 1 1 0 1 2The haplotypes can be observed with pullSegSiteHaplo.
Each row represents the sequence of alleles on each chromosome per
individual. Since this is diploid, we observe two for each individual:
one maternal (id_1) and the other paternal (id_2). All will have a value
of 0 or 1 respectively for ancestral or mutant allele. As before, each
column represents a defined locus.
pullSegSiteHaplo(founderGenomes)
#> 1_1 1_2 1_3 1_4 2_1 2_2 2_3 2_4 3_1 3_2 3_3 3_4
#> 1_1 1 0 0 0 0 1 0 0 0 0 1 0
#> 1_2 1 0 0 0 0 0 1 0 1 0 1 0
#> 2_1 0 1 0 0 0 1 1 0 0 0 0 0
#> 2_2 1 0 0 1 0 1 1 0 0 0 1 1
#> 3_1 1 1 1 0 0 1 1 0 0 0 0 1
#> 3_2 1 1 0 0 0 1 1 0 1 0 1 0
#> 4_1 1 1 0 0 1 1 0 0 0 0 1 1
#> 4_2 1 1 0 1 0 1 1 0 0 0 0 0
#> 5_1 0 0 0 0 0 1 1 0 0 0 0 0
#> 5_2 1 1 0 0 1 1 0 0 0 1 0 0
#> 6_1 1 0 0 1 0 1 1 0 1 0 1 0
#> 6_2 1 1 0 1 0 1 1 0 1 0 1 0
#> 7_1 1 0 0 1 1 1 0 1 0 1 0 0
#> 7_2 0 1 0 0 0 1 1 0 0 1 0 0
#> 8_1 1 1 0 1 0 0 1 0 0 1 1 0
#> 8_2 1 0 0 0 0 0 1 0 0 0 0 0
#> 9_1 1 0 0 0 0 1 0 0 0 0 1 0
#> 9_2 0 0 0 0 0 1 1 0 0 1 0 0
#> 10_1 1 1 0 1 0 1 0 1 0 0 0 1
#> 10_2 1 0 0 1 0 1 0 0 1 0 1 1How are genomes inherited?
Genetic code is inherited from an individual’s mother and father. This involves cells known as gametes, for example, eggs (from mother) and sperm (from father). These cells have half the number of chromosomes as other cells in the species. For example, in diploid species like humans gametes are haploid cells. These have been developed through interphase (DNA replication) and meiosis (cell division). The mechanisms of interphase and meiosis are outside the scope of this vignette, however they are important due to their contribution to genetic variation. See the Genetic Recombination in AlphaSimR article on the AlphaSimR website for more details.
Genetic Variation: the DNA lottery
Broadly speaking, there are three contributions to genetic variation: mutation, crossing over (recombination), and independent assortment (segregation).
Mutation occurs during DNA replication in interphase. Although the rate is small (commonly on the order of 10-8 mutations per nucleotide per generation (Kong et al. 2012)), when considering the whole genome and the number of individuals in a population over a longer time period mutation is not negligible.
Both crossing over and independent assortment occur in the first part of meiosis known as the reductional division. Crossing over refers to the swapping of genetic material at random between non-sister chromatids resulting in variation. Independent Assortment refers to the random orientation of homologous chromosome pairs resulting in gametes with many different assortments of chromosomes. (Recall there are 23 pairs in a human).
Within genetics, whether quantitative or population, we are interested in how one individual’s genome differs from the next. Thus, it is this variation we wish to capture to understand how genetics influences desired (or undesired) traits in crop and animal breeding.
In AlphaSimR:
- Random mutations can be added to individuals in populations with
mutate. It does not add new sites: each mutation flips the allele at one of the existing segregating sites, and the rate is per site per haplotype. For the purpose of demonstration, the mutation is at a much higher rate than would be expected.
basePop = newPop(founderGenomes)
mutatedBasePop = mutate(basePop, mutRate = 0.1, simParam = SP)
pullSegSiteGeno(basePop)
#> 1_1 1_2 1_3 1_4 2_1 2_2 2_3 2_4 3_1 3_2 3_3 3_4
#> 1 2 0 0 0 0 1 1 0 1 0 2 0
#> 2 1 1 0 1 0 2 2 0 0 0 1 1
#> 3 2 2 1 0 0 2 2 0 1 0 1 1
#> 4 2 2 0 1 1 2 1 0 0 0 1 1
#> 5 1 1 0 0 1 2 1 0 0 1 0 0
#> 6 2 1 0 2 0 2 2 0 2 0 2 0
#> 7 1 1 0 1 1 2 1 1 0 2 0 0
#> 8 2 1 0 1 0 0 2 0 0 1 1 0
#> 9 1 0 0 0 0 2 1 0 0 1 1 0
#> 10 2 1 0 2 0 2 0 1 1 0 1 2
pullSegSiteGeno(mutatedBasePop)
#> 1_1 1_2 1_3 1_4 2_1 2_2 2_3 2_4 3_1 3_2 3_3 3_4
#> 1 2 1 0 0 0 1 1 0 1 0 2 1
#> 2 1 2 1 2 0 1 2 0 0 0 1 1
#> 3 2 2 1 0 0 1 2 0 2 0 1 1
#> 4 2 2 0 1 1 2 1 0 0 0 2 1
#> 5 1 1 0 0 1 2 0 0 0 1 0 0
#> 6 2 1 0 2 1 2 2 0 2 0 2 0
#> 7 1 1 0 1 2 0 1 1 1 1 0 0
#> 8 1 0 0 2 0 0 2 0 0 1 1 0
#> 9 1 0 0 0 0 1 1 1 0 1 1 0
#> 10 0 0 1 2 0 1 0 1 0 0 1 2- Independent assortment and recombination can be observed across generations.
The first step is to make the cross in the base population to produce
the second generation. For this, randCross can be used to
create one cross, producing a pair of full siblings.
secondGenPop = randCross(pop = basePop, nCrosses = 1, nProgeny = 2, simParam = SP)
secondGenPop
#> An object of class "Pop"
#> Ploidy: 2
#> Individuals: 2
#> Chromosomes: 3
#> Loci: 12
#> Traits: 0
# Collect the IDs of the mother and father
mother = secondGenPop@mother[1]
father = secondGenPop@father[1]Then, the haplotypes can be extracted for the mother, father, and two progeny to observe the inheritance. Recall that id_1 is the maternal haplotype (inherited from mother) and id_2 is the paternal haplotype (inherited from father). For clarity, no mutation is included in this example. All variation observed is due to crossing over and independent assortment.
pullSegSiteHaplo(basePop[mother])
#> 1_1 1_2 1_3 1_4 2_1 2_2 2_3 2_4 3_1 3_2 3_3 3_4
#> 3_1 1 1 1 0 0 1 1 0 0 0 0 1
#> 3_2 1 1 0 0 0 1 1 0 1 0 1 0
pullSegSiteHaplo(basePop[father])
#> 1_1 1_2 1_3 1_4 2_1 2_2 2_3 2_4 3_1 3_2 3_3 3_4
#> 5_1 0 0 0 0 0 1 1 0 0 0 0 0
#> 5_2 1 1 0 0 1 1 0 0 0 1 0 0
pullSegSiteHaplo(secondGenPop)
#> 1_1 1_2 1_3 1_4 2_1 2_2 2_3 2_4 3_1 3_2 3_3 3_4
#> 11_1 1 1 1 0 0 1 1 0 1 0 1 0
#> 11_2 1 1 0 0 1 1 0 0 0 0 0 0
#> 12_1 1 1 1 0 0 1 1 0 1 0 1 0
#> 12_2 0 0 0 0 1 1 1 0 0 1 0 0In the above, independent assortment will usually be observed. This
is clear since despite being full siblings they usually inherit a
different arrangement of haplotypes from the mother and the father,
although by chance two siblings can inherit the same one. We may observe
changes to the haplotypes via recombination between the four sites
across a chromosome (either chromosome one, two, and/or three). However,
this depends on the rate of recombination. Nevertheless, even if present
it can be hard or even impossible to observe through the haplotypes
alone, even in this small sample size. Instead we can use the
pullIbdHaplo to observe this. For further details on
recombination, please see the Genetic
Recombination in AlphaSimR article.
pullIbdHaplo(basePop[mother])
#> 1_1 1_2 1_3 1_4 2_1 2_2 2_3 2_4 3_1 3_2 3_3 3_4
#> 3_1 5 5 5 5 5 5 5 5 5 5 5 5
#> 3_2 6 6 6 6 6 6 6 6 6 6 6 6
pullIbdHaplo(basePop[father])
#> 1_1 1_2 1_3 1_4 2_1 2_2 2_3 2_4 3_1 3_2 3_3 3_4
#> 5_1 9 9 9 9 9 9 9 9 9 9 9 9
#> 5_2 10 10 10 10 10 10 10 10 10 10 10 10
pullIbdHaplo(secondGenPop)
#> 1_1 1_2 1_3 1_4 2_1 2_2 2_3 2_4 3_1 3_2 3_3 3_4
#> 11_1 5 5 5 5 6 6 6 6 6 6 6 6
#> 11_2 10 10 10 10 10 10 10 10 10 9 9 9
#> 12_1 5 5 5 5 6 6 6 5 6 6 6 6
#> 12_2 9 9 9 9 10 10 9 9 10 10 10 9How are genomes read?
For a genome to be read, first it needs to be sequenced. The techniques for this include Sanger sequencing or next-generation sequencing. These are then used to identify single nucleotide polymorphisms (SNPs). SNPs highlight variation at specific loci and are often neutral markers of the variation in the genome. Other terminology includes traits and QTL (Quantitative Trait Loci). Traits are characteristics of interest such as milk yield or grain yield that are affected by an individual’s genotype and environment. QTL are positions in the genome that affect specific traits. These could be identifiable by a marker (such as a SNP) or could only be correlated with nearby markers.
In AlphaSimR:
Let’s start a new population.
founderGenomes = runMacs(nInd = 10,
nChr = 3,
segSites = 4,
species = "CATTLE")
# Set simulation parameters
SP = SimParam$new(founderGenomes)Then, add an additive trait with three QTLs per chromosome using
SP$addTraitA and one SNP per chromosome with
SP$addSnpChip.
SP$addTraitA(nQtlPerChr = 3)
SP$addSnpChip(nSnpPerChr = 1)After, create a base population.
basePop = newPop(founderGenomes, simParam = SP)
# Inspect basePop
basePop
#> An object of class "Pop"
#> Ploidy: 2
#> Individuals: 10
#> Chromosomes: 3
#> Loci: 12
#> Traits: 1The SNPs can be read with pullSnpGeno or, if the marker
names are known, pullMarkerGeno can be used.
# From SNP
SNP = pullSnpGeno(pop = basePop, snpChip =1)
print(SNP)
#> 1_3 2_1 3_4
#> 1 1 1 0
#> 2 2 1 2
#> 3 0 1 2
#> 4 0 0 2
#> 5 1 1 1
#> 6 2 0 1
#> 7 1 1 2
#> 8 0 0 1
#> 9 1 1 2
#> 10 0 0 2
# From marker
location = colnames(SNP)
pullMarkerGeno(basePop, markers = location)
#> 1_3 2_1 3_4
#> 1 1 1 0
#> 2 2 1 2
#> 3 0 1 2
#> 4 0 0 2
#> 5 1 1 1
#> 6 2 0 1
#> 7 1 1 2
#> 8 0 0 1
#> 9 1 1 2
#> 10 0 0 2The defined trait (Trait 1) can be inspected via the genetic values calculated for each individual.
basePop@gv
#> Trait1
#> [1,] -1.3694888
#> [2,] -0.1182769
#> [3,] 1.6157039
#> [4,] 0.5419663
#> [5,] -0.4139145
#> [6,] 1.2167704
#> [7,] -0.9043814
#> [8,] -1.0315341
#> [9,] -0.6530706
#> [10,] 1.1162257The genetic map for the QTLs can be retrieved via
getQtlMap. Here the site of each QTL is identified per
chromosome. The pos notes the position of the QTL on each chromosome in
Morgans.
getQtlMap(trait = 1, simParam = SP)
#> id chr site pos
#> 1_1 1_1 1 1 0.1882948
#> 1_2 1_2 1 2 0.2336273
#> 1_4 1_4 1 4 0.3095455
#> 2_2 2_2 2 2 0.2400704
#> 2_3 2_3 2 3 0.6478069
#> 2_4 2_4 2 4 0.6877035
#> 3_1 3_1 3 1 0.1917014
#> 3_2 3_2 3 2 0.5577779
#> 3_3 3_3 3 3 0.6694188What is a genetic map?
A genetic map (also known as linkage map) provides the genetic
distance in Morgans between genetic markers, QTLs, and/or segregating
sites on a chromosome. This differs from a physical map, which gives the
physical distance in the DNA sequence by the number of nucleotides and
so reflects the actual structure of the genetic material.
AlphaSimR stores and reports genetic maps only, in
Morgans, for segregating sites, QTLs, SNPs, and all defined loci. The
map is the one supplied with the founder population, by
runMacs, quickHaplo or an import, and meiosis
uses it to place crossovers, so it determines how genetic information is
shuffled in chromosomes and how markers are inherited. See the Genetic
Recombination in AlphaSimR article for more details.
For a genetic map of all defined loci (or segregating sites),
getGenMap is used. getSnpMap can be used for
the genetic map of the SNP(s) on each chromosome. As hinted previously,
getQtlMap can be used for the genetic map of the
QTL(s).
getGenMap(SP)
#> id chr pos
#> 1 1_1 1 0.18829484
#> 2 1_2 1 0.23362734
#> 3 1_3 1 0.30206833
#> 4 1_4 1 0.30954547
#> 5 2_1 2 0.03050111
#> 6 2_2 2 0.24007043
#> 7 2_3 2 0.64780695
#> 8 2_4 2 0.68770350
#> 9 3_1 3 0.19170138
#> 10 3_2 3 0.55777791
#> 11 3_3 3 0.66941883
#> 12 3_4 3 0.68624919
getSnpMap(snpChip = 1, simParam = SP)
#> id chr site pos
#> 1_3 1_3 1 3 0.30206833
#> 2_1 2_1 2 1 0.03050111
#> 3_4 3_4 3 4 0.68624919How is this used in plant and animal breeding?
By understanding the genome, breeders can produce crops and livestock with desirable traits for use in specific production systems. For example, a breeder may desire to have polled cattle to increase animal welfare and human safety. When considering the breeding design for a species, breed, and/or system, there are many factors to consider with potential to introduce unintended consequences. These include balancing the trade-off between short-term genetic gain and long-term loss in genetic variation as well as antagonistic relationships between desired traits commonly observed between production and functional traits in animals. AlphaSimR provides a fast and inexpensive way to explore and test a wide range of breeding designs for long-term genetic improvement across plants and animals through forward-in-time stochastic simulations.
For a more detailed overview of AlphaSimR in plant and animal breeding with exercises, please see the edX course: Breeding Programme Modelling with AlphaSimR. Available at: https://www.edx.org/learn/animal-breeding/the-university-of-edinburgh-breeding-programme-modelling-with-alphasimr