# Genetic Inheritance

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)

## WHAT IS IT?

This model is a simplistic simulation of the spread of a genetic disease with an autosomal recessive inheritance pattern in a small, isolated human population. It illustrates how allelic frequencies vary from generation to generation.

Genetic inheritance has risen to prominence as medical professionals have realized the implications of family health knowledge. Genetic diseases, indicators of heart, blood. and addiction problems, and even certain cancers can be predicted and measures can be taken to prevent their onset. Although genetic diseases are considered rare, twenty percent of all infant deaths are due to birth defects and genetic conditions.There are between 6,000 and 18,000 known single-gene disorders, affecting one in every 200 births, and only a small fraction of these have treatments. Additional study in this field could lead to the production of a wider range of more effective treatments and perhaps even cures for genetic diseases.

The model examines the effects of certain variables on the allelic frequencies of the gene pool. The user controls several aspects of the child-bearing relationships modeled. Exploration of these variables can provide insight into the genetic trends scientists have observed in natural populations and show why recessive genes cannot become completely extinct.

## HOW IT WORKS

The model uses "couples" to represent two people in a committed relationship. Individuals wander around the world when they are not in couples. Upon coming into contact with a partner, the two individuals "couple" together. When this happens, the two individuals no longer move about, and instead stand next to each other holding hands as a representation of their child-bearing relationship.

Once in a couple, the two genotypes of the "parents" are considered before a child is born, and the child is then assigned a genotype based on Punnett square predictions of the parents' offspring. It is a 50/50 chance between the child being born a girl or boy.

The genotypes of the individuals in the population are represented by the colors of the individuals. Three colors are used: blue individuals are homozygous dominant (AA), green individuals are heterozygous (Aa), and yellow individuals are homozygous recessive (aa).

## HOW TO USE IT

The SETUP button creates individuals with certain genotypes and randomly distributes them throughout the world. Once the simulation has been setup, it is now ready to run. The GO button starts the simulation and runs it continuously, with a carrying capacity set at 2,000 individuals.

Monitors show the percentage of individuals with each genotype as well as the frequency of each allele in the population. In this model each timestep is considered one month; the number of months that have passed is shown in the toolbar.

Here is a summary of the sliders in the model. They are explained in more detail below.

```
- numpeople
- avg-num-children
- avg-couple-length
- mutation-rate
- avg-num-couples
- mothers-age
```

Numpeople is used to determine the initial population at the start of the simulation. Smaller populations occasionally exhibit genetic drift (tendency towards either homozygous dominant or recessive).

Avg-num-children is used to determine the average number of children a couple will have before splitting up. More children means more variety.

Avg-couple-length is used to determine the amount of time a couple has spent in a relationship.

Mutation rate is used to determine how often a de novo mutation arises in a "healthy" individual, causing them to contract the disease.

Avg-num-couples is used to determine how many child-bearing relationships one person will be in before they die.

Mothers-age is used to determine the risk of chromosomal abnormalities depending on the age of the mother at the time of birth.

The model's plot shows the total number of individuals (color), the number of homozygous dominant individuals (blue), the number of heterozygous individuals (green), and the number of homozygous recessive individuals (yellow).

## THINGS TO NOTICE

If certain variables are set at low values, the population could eventually die out. As in real life, the dominant allele usually becomes more frequent in the gene pool than the recessive allele unless the mutation rate is unnaturally high. However, the recessive allele never truly becomes extinct due to de novo mutations and preservation through heterozygous carriers. One year is considered 20 ticks in the simulation.

## THINGS TO TRY

Run a number of experiments with the GO button to find out the effects of different variable on the dominant and recessive allele frequencies. In addition to changing one variable at a time, try changing multiple variables together to see if those factors interact at all.

Form hypotheses about how allelic frequencies will change with the adjustment of different variables and then test these to see if the results match your expectations.

A few real-world values for some of the variables are included below:

avg-num-children: U.S.A - between 1 and 2 Latin America - between 2 and 3 Middle East - between 3 and 5

avg-num-couples: roughly 1

avg-couple-length (USA): 45 years (1080 ticks)

mutation-rate: 2.22%

## EXTENDING THE MODEL

Like all computer simulations of human behaviors, this model has necessarily simplified its subject area substantially. The model therefore provides numerous opportunities for extension:

The model depicts a very simplistic gene at one locus controlled entirely by two alleles which exhibit complete dominance. In the real world, many genetic diseases are caused by a myriad of different factors.

The model depicts an autosomal genetic disease. To extend the model further, one could model an x-linked disease or a case of genomic imprinting (expression of allele in offspring depends on whether allele is inherited from male or female parent).

## CREDITS AND REFERENCES

All statistics in the Info tab come from the Centers for Disease Control and Prevention. The AIDS model in the NetLogo library was particularly helpful in setting up the coupling procedure: Wilensky, U. (1997). NetLogo AIDS model. http://ccl.northwestern.edu/netlogo/models/AIDS. Center for Connected Learning and Computer-Based Modeling, Northwestern Unversity, Evanston, IL. None of this would have been possible without the internship opportunity provided by the SEAP program and my mentor, Prof. Sanchez.

## Comments and Questions

turtles-own [ homdom? ;; Person is homozygous dominant for the disease. het? ;; Person is heterozygous for the disease. homrec? ;; Person is homozygous recessive for the disease. coupled? ;; Person is in a relationship. partner ;; The person that is our current partner in a couple. num-children ;; Number of children a couple has already had. couple-length ;; How long a couple will stay together before separating. num-couples ;; Number of couples a person has been in. age ;; Created to determine mother's age when giving birth. ] to setup clear-all reset-ticks create-turtles numpeople ask turtles [set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set num-couples 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"] assign-genotypes assign-colors ] ask turtles [if (shape = "girl") [set age 0]] end to assign-genotypes ifelse (who < ( random-near .33 * numpeople)) [set homdom? true] [set homdom? false] ifelse ((homdom? = false) and (who < ( random-near .66 * numpeople))) [set het? true] [set het? false] ifelse ((homdom? = false) and (het? = false) and (who < numpeople)) [set homrec? true] [set homrec? false] if ((homdom? = false) and (het? = false) and (homrec? = false)) [die] end to assign-colors ask self [ if (homdom? = true) [set color blue] if (het? = true) [set color green] if (homrec? = true) [set color yellow] ] end to-report random-near [center] let result 0 repeat 40 [ set result (result + random-float center) ] report result / 20 end to go ask turtles [if not coupled? [move]] ask turtles [if (not coupled? and shape = "girl" and random 100 = 0) [couple]] ask turtles [if coupled? [set couple-length couple-length + 1]] ask turtles [if (coupled? and shape = "girl" and num-children <= avg-num-children and random 75 = 0) [assign-child-genotype]] ask turtles [if (coupled? and shape = "girl" and num-children >= avg-num-children) [uncouple]] ask turtles [ assign-colors ] ask turtles [set age (age + .05 )] mutate if (count turtles > 2000) [ask n-of 50 turtles [if not coupled? [die]]] if %homdom >= 100 [stop] if %homrec >= 100 [stop] tick end to move let dice random 2 let change (dice - 1) forward 2 set heading (heading + change * 2) end to couple let potential-partner one-of (turtles-at -1 0) with [(not coupled?) and shape = "boy"] if potential-partner != nobody [ set partner potential-partner set coupled? true set num-couples num-couples + 1 ask partner [set num-couples num-couples + 1 ] ask partner [ set coupled? true ] ask partner [ set partner myself ] move-to patch-here ask potential-partner [move-to patch-here] set pcolor gray - 3 ask (patch-at -1 0) [ set pcolor gray - 3 ] ] end to assign-child-genotype ask self [ if (homdom? and coupled? and age < mothers-age) [ask partner [if (homdom? and coupled?) ;; BB x BB pairing [hatch 1 [set homdom? true set het? false set homrec? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] if (homdom? and coupled? and age > mothers-age) [ifelse (random 100 = 0) [hatch 1 [set homrec? true set het? false set homdom? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]] [hatch 1 [set homdom? true set het? false set homrec? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] let dice random 4 ask self [ if het? and coupled? and age < mothers-age [ask partner [if (homdom? and coupled? and dice > 2) ;; BB x Bb pairing [hatch 1 [set homdom? true set het? false set homrec? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] if het? and coupled? and age > mothers-age [ifelse (random 100 = 0) [ask partner [if (homdom? and coupled? and dice > 2) [hatch 1 [set homdom? false set het? false set homrec? true set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] [ask partner [if (homdom? and coupled? and dice > 2) [hatch 1 [set homdom? true set het? false set homrec? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]]]] if het? and coupled? and age < mothers-age [ask partner [if (homdom? and coupled? and dice < 2) [hatch 1 [set het? true set homdom? false set homrec? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] if het? and coupled? and age > mothers-age [ifelse (random 100 = 0) [ask partner [if (homdom? and coupled? and dice < 2) [hatch 1 [set het? false set homdom? false set homrec? true set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] [ask partner [if (homdom? and coupled? and dice < 2) [hatch 1 [set het? true set homdom? false set homrec? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]]] if homrec? and coupled? and age < mothers-age [ask partner [if homdom? and coupled? ;; BB x bb pairing [hatch 1 [set het? true set homdom? false set homrec? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] if homrec? and coupled? and age > mothers-age [ifelse (random 100 = 0) [ask partner [if homdom? and coupled? [hatch 1 [set het? false set homdom? false set homrec? true set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] [ask partner [if homdom? and coupled? [hatch 1 [set het? true set homdom? false set homrec? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] let chance random 2 ask self [ if het? and coupled? and age < mothers-age [ask partner [if (het? and coupled? and chance = 0) ;; Bb x Bb pairing [hatch 1 [set homdom? true set het? false set homrec? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] if het? and coupled? and age > mothers-age [ifelse (random 100 = 0) [ask partner [if (het? and coupled? and chance = 0) [hatch 1 [set homdom? false set het? false set homrec? true set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] [ask partner [if (het? and coupled? and chance = 0) [hatch 1 [set homdom? true set het? false set homrec? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]]]] if het? and coupled? and age < mothers-age [ask partner [if (het? and coupled? and chance = 1) [hatch 1 [set het? true set homdom? false set homrec? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] if het? and coupled? and age > mothers-age [ifelse (random 100 = 0) [ask partner [if (het? and coupled? and chance = 1) [hatch 1 [set het? false set homdom? false set homrec? true set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] [ask partner [if (het? and coupled? and chance = 1) [hatch 1 [set het? true set homdom? false set homrec? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]]]] let chance random 2 if het? and coupled? and age < mothers-age [ask partner [if (het? and coupled? and chance = 2) [hatch 1 [set homrec? true set homdom? false set het? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] if het? and coupled? and age > mothers-age [ifelse (random 100 = 0) [ask partner [if (het? and coupled? and chance = 2) [hatch 1 [set homrec? true set homdom? false set het? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] [ask partner [if (het? and coupled? and chance = 2) [hatch 1 [set homrec? true set homdom? false set het? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]]] if het? and coupled? and age < mothers-age [ask partner [if (homrec? and coupled? and chance > 1) ;; Bb x bb pairing [hatch 1 [set het? true set homdom? false set homrec? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] if het? and coupled? and age > mothers-age [ifelse (random 100 = 0) [ask partner [if (homrec? and coupled? and chance > 1) [hatch 1 [set het? false set homdom? false set homrec? true set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] [ask partner [if (homrec? and coupled? and chance > 1) [hatch 1 [set het? true set homdom? false set homrec? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] if het? and coupled? [ask partner [if (homrec? and coupled? and chance < 1) [hatch 1 [set homrec? true set homdom? false set het? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] if homrec? and coupled? [ask partner [if homrec? and coupled? ;; bb x bb pairing [hatch 1 [set homrec? true set homdom? false set het? false set shape "person" setxy random-xcor random-ycor set coupled? false set partner nobody set num-children 0 set couple-length 0 set age 0 ifelse random 2 = 0 [set shape "girl"] [set shape "boy"]]]]] ] set num-children num-children + 1 ask partner [set num-children num-children + 1] end to uncouple if coupled? and (shape = "girl") [if ((num-children >= avg-num-children) or (couple-length >= avg-couple-length)) [ set coupled? false set couple-length 0 ask partner [set couple-length 0] set pcolor black ask (patch-at -1 0) [ set pcolor black ] ask partner [ set partner nobody ] ask partner [ set coupled? false ifelse num-couples >= avg-num-couples [die] [move]] set partner nobody]] ifelse num-couples >= avg-num-couples [die] [move] end to mutate if random-float 1000 < mutation-rate [ask one-of turtles [if (homdom? = true) [set homdom? false set het? false set homrec? true]]] end to-report count-girls report count turtles with [shape = "girl"] end to-report count-boys report count turtles with [shape = "boy"] end to-report %homdom report count turtles with [homdom? = true] / count turtles end to-report %het report count turtles with [het? = true] / count turtles end to-report %homrec report count turtles with [homrec? = true] / count turtles end to-report num-dom-allele report ( ((count turtles with [homdom? = true]) * 2 ) + (count turtles with [het? = true])) / (count turtles * 2) end to-report num-rec-allele report ( ((count turtles with [homrec? = true]) * 2) + (count turtles with [het? = true])) / (count turtles * 2) end

There is only one version of this model, created over 4 years ago by E C.

This model does not have any ancestors.

This model does not have any descendants.