SCAv6.4
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
This is a model of the Hardy-Weinberg (HW) equilibrium. The HW principle predicts the genotypic frequencies that will be observed in a population over the course of generations given particular allele frequencies, and given that five assumptions (discussed below) hold true in the population.
Given two alleles, A and a, and the frequencies of each allele in the population, freq(A)=p and freq(a)=q, the HW principle predicts:
1) p + q = 1. That is, since A and a are the only alleles at this locus in the model population, the allelic frequencies of A and a must add up to 1.
2) The genotypic frequency of AA homozygotes in the population is p^2. The frequency of aa homozygotes is q^2. The probability that any given member of the population will inherit two A alleles is p x p. The frequency of heterozygotes is 2pq. The probability that any given member of the population will inherit one A and one a allele is p x q x 2, since a heterozygote can inherit allele A from its mother and allele a from its father, OR allele a from its mother and A from its father. p^2 + 2pq + q^2 = 1. That is, the frequencies of both types of homozygotes and the frequency of heterozygotes must add up to 1, since these are the only possible combinations.
These predictions hold true given that five assumptions about the population all hold true.
1) Large (infinite) population size. In small populations, chance differences in reproductive success and mating choices can produce deviations from the predictions of HW.
2) No selection. There is no systematic difference in the survival or reproductive success of organisms with different genotypes.
3) No mutation. The alleles are inherited from one generation to the next without being changed by mutation.
4) No migration. No organisms leave the population, and no new ones come in.
5) Random mating. Organisms choose mates at random with respect to the alleles of interest in the model.
If any of these assumptions do not hold true in a population, the observed genotypic frequencies will deviate from the predictions of HW in particular ways depending on the assumption(s) that is (are) violated.
HOW IT WORKS
The model is initialized with a randomly distributed population of blue (the dominant trait) and yellow (the recessive trait) organisms. Organisms are randomly assigned alleles according to the selected frequency of the A allele (the frequency of the a allele is determined as q = p - 1.)
As the model runs, organisms move around the world in a correlated random walk at a dispersal rate determined by the user. On each tick, organisms select a mate, either by mating with another organism chosen at random anywhere in the world, or by choosing a nearby organism to mate with. An offspring is produced adjacent to the reproducing organism, which randomly inherits either the a or A alleles from each of its parents. The organisms are diploid, but are essentially hermaphroditic, as every organism is capable of producing offspring and may mate with any other organism without the need to locate a mate of the opposite sex.
Following reproduction, the population is culled to bring the population size back down to the carrying capacity determined by the user. During each culling, each organism is subject to a probability of death determined by the degree to which the current population size exceeds the carrying capacity. As a result, an organism may live for several generations, or it may not survive to first reproduction. There is no maturation time, so that any organism that survives the first culling following its birth can reproduce during the next reproduction cycle.
The model ends when it reaches a specified number of generations ("ticks"), or when one allele becomes fixed in the population (that is, the other allele goes extinct), or when the entire population of organisms goes extinct (e.g. due to high selection against both phenotypes).
HOW TO USE IT
The "proportion-allele-A" slider bar determines the initial frequency of the allele A. The frequency of allele a is determined by calculating freq(a) = 1 - freq(A). The "population-size" slider determines the carrying capacity of the system. The "species" chooser allows the user to select from a list of possible icons to represent the organism as they move around the world.
Clicking the "setup" button initializes the world with a population of organisms of the selected species, with the specified allele frequencies. The "go" button starts the model.
The "Population size" monitor displays the current population size. Note that this population size will not always match exactly the value selected by the "population-size" slider. In fact, during each reproduction cycle, the population size will rise well above this value, and then fall back roughly to the specified population size at the end of the culling cycle. However because mortality for each organism is determined by a certain probability, the final population size will not be exactly the specified value, although it will be close.
Graphs track the genotypic frequencies, phenotypic frequencies, and allele frequencies over time as the model runs. Monitors display the current values for each of these.
As the model runs, the user may change the settings of any slider, chooser or input -- with the exception of the "proportion-allele-A" slider -- and the model will reflect these newly selected values. The value of the "proportion-allele-A" slider is used only at model setup; allele frequencies are determined only by the behavior of the organisms after the model begins running.
THINGS TO NOTICE
Note that the genotypic and phenotypic frequencies approximate the values predicted by the HW formulas. Try calculating the predicted values based on the allele frequencies you have specified (or the current allele frequencies obtained by the current A and a alleles preent in the population) and compare these to the actual values produced by the model as it runs. The model itself does not make use of the HW formulas, but produces values similar to those predicted by HW by the interactions of the model organisms.
Note the random changes in the genotypic, phenotypic, and allelic frequencies over time. These changes are more apparent with smaller population sizes, but can still be observed even with populations in the thousands. These random changes result from random differences in the survival and reproductive success of individuals each generation, and are called genetic drift. Genetic drift has a bigger effect on the makeup of small populations than larger ones. Theoretically, the HW assumption of "large population" actually requires an infinitely large population in order to completely eliminate the effect of drift.
THINGS TO TRY
Experiment with the settings of the model to create violations of the five assumptions described above. The Hardy-Weinberg equilibrium describes a theoretical population that cannot exist in the real world; perhaps its greatest value is in describing a population where no evolution is occurring, in order to better understand real populations where one or more of the five assumptions are violated, and evolution is occurring.
1) Large (infinite) population size. Try running the model with populations of different sizes in order to observe differences in the strength of genetic drift. 2) No selection. Try experimenting with different degrees of selection against (increased mortality of) the blue and yellow phenotypes. You will observe that selection against the recessive phenotype (yellow color) takes much longer to completely remove the a allele from the population, even with heavy selection against the yellow phenotype. Why is this? What does this tell us about the persistence of recessive genetic disorders in the population? 3) No mutation. Experiment with different mutation rates from dominant to recessive, or recessive to dominant. What happens if there is a large rate of mutation in both directions? 4) No migration. Experiment with different rates of immigration of blue and yellow individuals. How does immigration of individuals of a particular color effect the overall genetic makeup of the population? 5) Random mating. The "mate-with" chooser can cause the organisms in the model to choose mates completely at random, selecting any other organism in the world as a mate. You can also cause organisms to mate with a neighbor, so that organisms must be adjacent in order to mate with each other. Note what happens to the frequency of heterozygotes when organisms are mating with their neighbors. Also note that increasing the dispersal rate (the distance the organisms move each time step) decreases the effect of mating with neighbors on the phenotypic makeup of the population. Why does this happen?
EXTENDING THE MODEL
Other methods for violating the assumptions of the HW equilibrium could be added. For example, selection in this model is caused by increasing the mortality rate of one or both of the phenotypes. Selection could also result from differential reproductive output, or from differential success in finding mates (sexual selection).
The model could also be extended to multiple genes to, for example, examine the effect of linkage on inheritance.
RELATED MODELS
NetLogo Library Models: -GenDrift (T reproduce) -Simple Birth Rates NetLogo Community Models: -PopGen Fishbowl 1 -Genetics and Cellular Automata
CREDITS AND REFERENCES
Hardy-Weinberg Classroom Model (2009) Kenneth Letendre Departments of Biology and Computer Science University of New Mexico kletendr@unm.edu
Council-Garcia, C.L., S. Ligon, B. Milne, R. Thornhill and D. Swenton. 2004. Biology 203L: Evolution and Ecology Lab Manual. Hardy, G. H. (1908). "Mendelian proportions in a mixed population". Science 28: 49 � 50. Stern, C. (1943). "The Hardy�Weinberg law". Science 97: 137�138. Weinberg, W. (1908). "�ber den Nachweis der Vererbung beim Menschen". Jahreshefte des Vereins f�r vaterl�ndische Naturkunde in W�rttemberg 64: 368�382.
Comments and Questions
extensions [profiler] breed [ humans human ] breed [ mosquitos mosquito ] humans-own [ mat-chrom pat-chrom age phenotype ] mosquitos-own [ age ] globals [ max-percent ;; percent of the total population that is in the population-to-cull ;; global population size for culling procedure deaths scd-total born-carrier born-normal tally ] to setup clear-all ask patches [set pcolor 121 ] setup-humans setup-mosquitos setup-my-plots update-my-plots set tally tally + population-size reset-ticks end to setup-humans create-humans population-size [ ifelse random 100 < (proportion-HbA-allele * 100) [ set mat-chrom 1 ] [ set mat-chrom 2 ] ifelse random 100 < (proportion-HbA-allele * 100) [ set pat-chrom 1 ] [ set pat-chrom 2 ] if (mat-chrom = 1 and pat-chrom = 1) [ set color blue set phenotype "normal" set born-normal born-normal + 1 ] if (mat-chrom = 2 and pat-chrom = 2) [ set color red set phenotype "anemic" set scd-total scd-total + 1 ] if (mat-chrom = 1 and pat-chrom = 2) or (mat-chrom = 2 and pat-chrom = 1) [ set color green set phenotype "carrier" set born-carrier born-carrier + 1 ] set age 1 setxy random-xcor random-ycor set shape "person" ] end to setup-mosquitos ;; these mosquitos are only hear for the visualization factor they do not actually interact with model create-mosquitos selection-against-normal * 3 ;; selection against the normal humans would represent selective pressure due to malaria [ set shape "mosquito" set size 1 set color yellow setxy random-xcor random-ycor ] end to go if ((max-generations > 0 and ticks = max-generations) or ( not any? humans)) [ stop ] move-age-die set population-to-cull count humans ask humans [ mutate mate cull ] setup-mosquitos update-my-plots tick end to introduce-scd create-humans number-mutated [ set mat-chrom 1 set pat-chrom 2 set color green setxy random-xcor random-ycor set shape "person" ] end to move-age-die ask humans [ rt random 50 - random 50 fd dispersal-rate set age age + 1 ] ask mosquitos [ set age age + 1 rt random 50 - random 50 fd .5 if random 5 < age [ die ] ] end to mate ;; human procedure - when two humans are adjacent, reproduce (but no self-fertilization!) ;; SD - this procedure needs to be revisited and discussed let mom self let partner nobody set partner one-of other humans in-radius 1 if partner != nobody and age > reproductive-age [ ;;;human reproduction can be limited by age hatch 1 [ set age 1 fd 1 ifelse random 100 < 50 [ set mat-chrom [mat-chrom] of mom ] [ set mat-chrom [pat-chrom] of mom ] ifelse random 100 < 50 [ set pat-chrom [mat-chrom] of partner ] [ set pat-chrom [pat-chrom] of partner ] if (mat-chrom = 1 and pat-chrom = 1) [ set color blue set phenotype "normal" set born-normal born-normal + 1 ] if (mat-chrom = 2 and pat-chrom = 2) [ set color red set phenotype "anemic" set scd-total scd-total + 1 ] if (mat-chrom = 1 and pat-chrom = 2) or (mat-chrom = 2 and pat-chrom = 1) [ set color green set phenotype "carrier" set born-carrier born-carrier + 1 ] set tally tally + 1 set shape "person" ] ] end to cull let death-chance ((population-to-cull - population-size) / population-to-cull) * 100 if (selection-against-normal > 0 and phenotype = "normal") [ set death-chance death-chance + ((100 - death-chance) * selection-against-normal * .01) ] if (selection-against-normal > 0 and phenotype = "carrier") [ set death-chance death-chance + ((100 - death-chance) * selection-against-carrier * .01) ] if (selection-against-SCD > 0 and phenotype = "anemic") [ set death-chance death-chance + ((100 - death-chance) * selection-against-SCD * .01) ] if random 200 < death-chance [ set deaths deaths + 1 die ] end to mutate ifelse mat-chrom = 1 [ if random-float 100000 < HbA-to-HbS-mutation-rate [ set mat-chrom 2] ] [ if random-float 100000 < HbS-to-HbA-mutation-rate [ set mat-chrom 1] ] ifelse pat-chrom = 1 [ if random-float 100000 < HbA-to-HbS-mutation-rate [ set pat-chrom 2] ] [ if random-float 100000 < HbS-to-HbA-mutation-rate [ set pat-chrom 1] ] end ;;Code for setting up the graphs to setup-my-plots set-current-plot "Phenotypic Percentage" set-plot-y-range 0 100 set-current-plot "Allele Percentage" set-plot-y-range 0 100 end to update-my-plots set-current-plot "Phenotypic Percentage" set-current-plot-pen "Normal" ifelse count humans = 0 [ plot 0 ] [ plot (count humans with [phenotype = "normal"] / count humans) * 100 ] set-current-plot-pen "SCD" ifelse count humans = 0 [ plot 0 ] [ plot (count humans with [phenotype = "anemic"] / count humans ) * 100 ] set-current-plot-pen "Carrier" ifelse count humans = 0 [ plot 0 ] [ plot (count humans with [phenotype = "carrier"] / count humans) * 100 ] set-current-plot "Allele Percentage" set-current-plot-pen "HbA" ifelse count humans = 0 [ plot 0 ] [ plot ((count humans with [mat-chrom = 1] + count humans with [pat-chrom = 1]) / (count humans * 2)) * 100 ] set-current-plot-pen "HbS" ifelse count humans = 0 [ plot 0 ] [ plot ((count humans with [mat-chrom = 2] + count humans with [pat-chrom = 2]) / (count humans * 2 )) * 100 ] end
There are 12 versions of this model.
Attached files
No files