IMPORTANT: You must generate you own answers to all questions.
In this assignment you will apply Monte Carlo computer simulations to study the effects of genetic drift and selection pressure on a single locus with two alleles: “A” and “a”. You will be running these simulations on a computer using a simple simulation program written in Python (see appendix if this is not on your computer). Note that you do not need to know how to program in Python in order to do this lab. Each exercise will involve editing one or two lines at the top of the file and then running the simulation for a few minutes and analyzing the output.
The simulation software carries out the simulation shown in the following flowchart. The initial population is 100% heterozygous (Aa). Each generation the population is exactly replaced by new individuals and all of the old individuals die off. In the simulations in Part II, in which some part of the population is eliminated by selection, the population is restored to the original population size in the next generation. This might seem artificial, but it actually is not a bad model of species that produce a huge number of offspring only a fraction of which survive to reproduce due to limitations in food supply or space.
![]() |
Figure 1 Flowchart for simulation program. The program will simulate 100 different populations for each set of conditions you specify and simulate each population for 125 generations.
In most cases the output will be a histogram showing the distribution of allele A frequencies across the set of different populations simulated. For example, the following histogram is the result of simulating 100 separate populations. The number ranges on x-axis give the range of allele A frequencies and the length of the bar reflects how many populations had allele A percentages in this range. So, of the 100 simulated populations, 25 ended up with allele A percentages between 50 and 60 percent, while just 1 population had an allele A percentage less than 10 percent.
![]() |
Figure 2 sample output
General instructions for using the simulation software:
Step 1: First, Go to http://bioinformatics.ucmerced.edu/resources/biological_sciences_1. Then, download “Population Allele Simulation file” of Assignment 2 on your Desktop.
Step 2:Then, start the Python interpreter: Start::Programs::Python2.4::IDLE(Python GUI). This will start a Python Shell window. (This location might vary slightly for different versions of Python.) If you don’t have Python in your computer, please refer to Appendix 1 of this assignment to install Python.
Step 3:In the File menu on the Python Shell, select Open and then navigate to Desktop and open the file called Population Allele Simulation (which you downloaded in step 2). This will open a new window showing the simulation program
Note: You may see Python icon with your saved files, so just double-click the icon to run the program.
![]() |
Figure 3 python icon
Step 4:Then, two windows will open: console and graphic user interface (GUI) windows.
![]() |
Figure 4. This Python program opens console and graphic user interface windows.
Step 5: Now select your BIS 1 section from the menu bar. This is very important. Otherwise, the “Run Simulation” button in the dotted circle of the above figure cannot be turned on.
Step 6:You can run a simulation by clicking Run Simulation button from the GUI window. The simulation will now start running. In the Python console window, you will see a series of numbers printing out on the first line—this is just an indicator of the number of populations completed—since we’re running 100 populations, you’ll be done shortly after this number reaches 90.










