This help page answers some questions about the mechanics
of Web PopGen. The function of buttons will be described
as well as some of the algorithms used in generating the graphs.
Evolutionary theory will not be covered. Click on the
links below to get information on a particular aspect of the program
Display,
Stochastic/Infinite populations,
Population Size,
Number of Populations,
Selection/Fitness,
Mutation,
Migration,
Bottle Neck
Effect,
How to copy and paste graphs into a Word Processor Document (
Macintosh,
Windows).
Please send any "Bug" reports, comments or suggestions to
Bob Sheehy
Introduction:
This program is a web based version of Joe
Felsenstein's Simul8
and PopG
programs. There are variations that make the this program more attractive
and some that may make it more painful to use.
First, the bad news:
This program is very slow. Flash does not
handle calculations well so this program could take a while to run.
Grab a cup of coffee or a soda and join the moment. If you need
large populations (other than infinite populations) it is best to download
one of the above programs.
Please be patient when using the "reset" or the "continue"
button as it takes a while to clear the data from a previous run.
Variations of this program from PopG/Simul8
 Alleles are labeled A_{1} and A_{2}.
There is no longer an implied dominance between the alleles. The
dominance relationship can be determined by genotypic fitness.
 Populations are distinguishable by color.
 When more than one population is simulated the upper graph
depicts the frequency of the A_{1} allele (p) and the lower graph
mirrors the upper graph with the frequency of the A_{2} allele
(q).
 When a single population is simulated the upper graph depicts
the frequencies of both the A1 and A2 alleles while the lower graph depicts
the genotype frequencies (A_{1}A_{1}, A_{1}A_{2},
and A_{2}A_{2}).
 Two models of migration are allowed.
 Bottleneck effects may be simulated. Starting and
ending generations determine the length of the bottleneck. The population
size within the bottleneck may also be determined by the user.
 It is possible to compare the effects of different fitness
values among the different populations.
Future Changes
 Pass variables to an external program (server side) to
speed calculations.
 Write data to an output file.
 Stepping stone model of migration
Return to top
Display:
The upper part of the display (light blue background)
contains the input boxes for setting variables (population size, fitness,
migration rates etc.). The lower portion contains two graphs.
If 2 or more populations are modeled the upper graph will plot
the frequency of the A
_{1} allele for each population and the
lower graph will mirror the upper graph by plotting the frequency of
the A
_{2} allele. If a single population is modeled the
frequencies of both the A
_{1} and A
_{2} allele are plotted
on the upper graph while the genotype frequencies of the Homozygote
A
_{1}A
_{1}, the homozygote A
_{2}A
_{2}
and the heterozygote A
_{1}A
_{2} is plotted on the lower
graph.
The simulation is started by clicking on the "
Go" button and two new buttons will appear on
the lower portion of the screen. The go button will be replaced
by a "
Reset" button which clears the plotted
data and prepares for the next simulation. To the lower right is
a "
Continue" button which will remove the
previously plotted data from the screen and continue with the simulation
for the next interval of generations.
Return to top
Stochastic/Infinite populations:
Simulation may be run either with a defined population
size or with a theoretically infinite population. Stochastic
populations are used to examine the effects of population size on
genetic drift. Some other factors which affect allele frequency
may become more apparent when using infinite populations.
Clicking on the square check box allows the user to toggle
between stochastic and infinite populations. The number of
populations being simulated will determine the number of allele frequency
input boxes that are available. Below (center) is what appears
for 5 populations. Each population may have a different starting
allele frequency.
Population 0 is a control population. The allele frequency of
Population 0 will vary with selection but migration and drift have no
effect.
Clicking on the "
OK" button will
close the window causing the program to look as at right. Clicking
on the check box again will return you to a simulations using stochastic
populations.
Choosing infinite populations will speed the program
considerably. When infinite population is chosen the initial
allele frequency of each population may be set independent of the
other populations. The infinite population option is unavailable
if the number of different populations is greater than 5.
It is possible to toggle between Stochastic and Infinite populations
during a simulation run if desired.
Return to top
Population Size
Population size between 5 and 250 individuals work well.
The larger the population the slower the program. If
one has patients and a good cup of coffee this may not be an intolerable
situation to use larger populations. When running the program
in stochastic mode all populations start with the same initial allele
frequency. Allele frequency will drift, independently, in each
population.
Return to top
Number of Populations
15 populations may be simulated at a time. If 1 population
is chosen then both the A
_{1} and A
_{2} allele frequencies
are plotted on the upper graph and the three genotype frequencies
(A
_{1}A
_{1}, A
_{2}A
_{2} and A
_{1}A
_{2})
are plotted on the lower graph. If 2 or more populations are
simulated then the frequency of the A
_{1} allele for each population
is plotted on the top graph while the frequencies of the A
_{2}
allele for each population is plotted on the lower graph. Each
population is given a different color and, in the absence of migration,
each population is independent of the others.
Return to top
Selection/Fitness
Web PopGen may be used to model natural selection of alleles
and genotypes. The fitness of a particular genotype may range
from 0 to 1 inclusive. Fitness provides the relative survival
rate of a particular genotype with the most fit being set to 1.0. For
example, suppose the finesses for the three genotypes are A
_{1}A
_{1}
= 1, A
_{1}A
_{2} = 1 and A
_{2}A
_{2} = 0.8.
This would indicate that fitness of the A1 allele behaves as a
dominant, That the A
_{1}A
_{1} homozygote and the A
_{1}A
_{2}
heterozygote have an equal fitness (leave, on average, the same number
of viable offspring) and that the A
_{2}A
_{2}
homozygote leaves, on average 80% of the number of viable offspring
as either the A
_{1}A
_{1} and the A
_{1}A
_{2}
genotypes.
The general formula for selection is:
 Average Fitness (
):

= p^{2} * w_{11} + 2pq * w_{12}
+ q^{2} * w_{22}
 where p = the frequency of the A_{1} allele,
q = the frequency of the A_{2} allele, w_{11} = the
fitness of the A_{1}A_{1} homozygote, w_{12}
= the relative fitness of the A_{1}A_{2} heterozygote
and w_{22} = the relative fitness of the A_{2}A_{2}
homozygote.
 The frequencies of the various genotypes after selection:
 Frequency of the A_{1}A_{1} homozygote
= (p^{2} * w_{11})/
 Frequency of the A_{1}A_{2} heterozygote
= (2pq * w_{12})/
 Frequency of the A_{2}A_{2} homozygote
= q2 * w_{22})/
Selecting Infinite population will cause a check box to
appear in the Fitness box. Initially, the fitness for each genotype
is the same for all populations.
Initially, all populations share the same fitness values
as placed in the various boxes. Clicking on the check box reveals
a drop down menu which allows the user to enter different genotypic fitnesses
for each of the populations.
After entering the desired values clicking on the "OK" button will close the dialogue box. Only
the fitness values for population 0 will be visible.
When the "
GO" button is clicked,
starting the simulation, a key to the various populations will appear to
the right of the lower graph.
Clicking on the fitness check box will return to all populations
sharing the same fitness values.
Return to top
Migration
Currently two models of migration are possible.
 The Island model
in which migration occurs at random among a group of small populations.
 The Sourcesink or Continentisland model in which
there is effectively oneway movement from a large ("source") population
to a smaller, isolated ("sink") population. In this case there
is no migration among the sub populations. The allele frequency(s)
of the Source population may be different than the allele frequency of
the sink populations.
The migration option can be chosen by clicking on the
Migration check box. After the first click
you will see the input data box asking for the rate of migration. This
is a number between 0 and 1 inclusive (0 = no migration, 1 = every
individual is a migrant). Clicking on the
Migration check box again brings up the Source/Sink
model where the frequency of the A1 allele in the source population
may be determined. Frequency of the A
_{1} allele in the
source population may vary between 0 and 1 inclusive. Migration may
be turned on and off during a simulation by clicking on the Migration
check box while the simulation is running. This will give you an
idea of the effect migration has on allele frequency among populations.
The general formula for migration is:
 Island model:
 Average frequency of the A_{1} allele (
) is calculated across all populations.

= (p_{1}+p_{2}+p_{3}+ ...p_{n})/n
 p_{n} = p_{n}*(1m) + m*
 where p_{n} in the frequency of the A_{1}
allele in population n, m is the frequency of migrants to the population
and 1m is the frequency of individuals which do not migrate.
 Source/Sink model
 p'_{n} = p_{n}*(1m) + m*p_{s}
 where p_{n} is the frequency of the A_{1}
allele in population n, p'_{n} in the frequency of the A_{1}
allele in population n in the next generation, m is the frequency of migrants
to the population, 1m is the frequency of individuals which do not migrate
and p_{s} in the frequency of the A_{1} allele in
the source population.
Mutation
Mutation allows you to convert a proportion of one allele
type to another allele type at a given frequency of mutation per allele
per generation. Both forward mutations (A
_{1}
A
_{2}) and reverse mutations (A
_{1
} A
_{2}) are allowed. The frequency
of forward and reverse mutations may vary.
The general formula for mutation is:
 p' = p*(1µ) + (1p) * v
 where p is the frequency of the A_{1}
allele in population, p' is the frequency of the A_{1}
allele in the next generation, µ is the frequency of the forward
mutation (A_{1}
A_{2}) and v is the frequency of the reverse
(A_{1}
_{ } A_{2}) mutation.
Return to top
Bottle Neck
Bottlenecks can be simulated for stochastic populations. When
the bottle neck check box is clicked three input boxes become available.
Start represents the starting generation (the generation where
the population crash occurs). End is the last generation of the bottleneck
where the population instantly returns to the initial population
size. The length of the bottleneck is determined by values entered
into the End and Start boxes. The size of the population will remain
constant during the bottleneck and is determined by the value placed
in the BN Pop. box.
Return to top