Modeling Evolution in Excel Mathematical models and computer















- Slides: 15

Modeling Evolution in Excel Mathematical models and computer simulations are tools used to explore the complexity of biological systems that might otherwise be difficult or impossible to study. • You will build a spreadsheet that models how a gene pool changes from one generation to the next. • The model is then modified, allowing you to explore parameters that affect allele frequencies, such as selection and genetic drift.

Modeling Evolution in Excel For the model, the dominant, or p allele, will be denoted by the letter ‘A’; recessive q will be represented by an ‘B’ (the formulas don’t work with lower case letters! ) • Recall that formulas are written just as in math, except with the equals sign in front of the equation. Type formulas, rather than copy and paste. • Fill cells by dragging down from the bottom right of the cell with the formula • To change the population size, modify rows in the middle of the model; formulas will change automatically

Insert a frequency p into cell D 2. Setting up the Parent generation Have Excel calculate the frequency of q by entering into cell D 3 the following formula: =SUM(1 -D 2) Check your model: enter a new p frequency to verify that your q changes too, and the two new values = 1

In cell E 5, enter the function; +Rand() Randomizing Gametes

Hit ‘return’ and the RAND command will generate a random number between 0 -1 Highlight the cell again, put the cursor after the formula in the formula bar, and hit return again. What happens? Using this function, our model simulates the “random” choosing of gametes from a gene pool.

Modify the formula using the following function: =IF(RAND()<=D$2, “A”, “B”) A randomly chosen gamete will be entered in the cell Enter this formula for cell F 5 too, to generate the second gamete for the offspring

Recalculate by putting the cursor at the end of the formula in the formula bar and clicking the mouse. What happens to the gametes?

Create the F 1 generation Copy the formulas in E 5 and F 5 down for 50 rows to randomly generate the gametes that will form the offspring of the next generation. Click and hold at the bottom right-hand corner of the cell; drag the downward to copy the formula into all cells + Grab the square with your changed cursor icon

It should look like this

The next step is to put the zygote in cell G 5. In cell G 5, enter the function = CONCATENATE(E 5, F 5) Create the genotypes copy this formula down as far as you have gametes

Summing the Data Use columns H, I and J to keep track of the quantity of each genotype. Enter the following functions for each column. The function in cell H is =IF(G 5=”AA”, 1, 0) The function in cell J is =IF(G 5=”BB”, 1, 0) In cell I 5, enter this function: =IF(G 5=”AB”, 1, (IF(G 5=”BA”, 1, 0))) Enter labels for the columns you have created

It should look like this:

Calculate the number of offspring of each genotype in a RESULTS table back at the top in cells M, N Use the SUM button or enter a SUM command for each column: ex: =SUM(H 6: H 55) Find the frequency of each genotype from the sums: =SUM(H 55/(H 55+I 55+J 55)) Cells in color are examples – be sure to refer to the cells your data are in

Calculate the number of each allele via the following functions: =COUNTIF(E 7: F 56, "A") for the A allele =COUNTIF(E 7: F 56, “B") for the B allele To calculate the allele frequency of the next generation: =M 8/(M 8+N 8) for p and =N 8/(M 8+N 8) for q (again, the cells in red must be customized according to where the gametes are located in your individual spreadsheet) No SUM in these frequency formulas!

Test the Model • Try recalculating a number of times to make sure everything is working as expected Double click on your initial p value cell and hit return to randomize Verify your formula calculations by hand; make sure they add up If you are using different cells than my model, make sure your formulas reflect your cells Do not use SUM in the frequency calculations • Try different values for p Each time, make sure the number of zygotes, alleles, genotypes and frequencies add up correctly