-
Notifications
You must be signed in to change notification settings - Fork 0
/
SAIsim_DeNovo.py
42 lines (27 loc) · 1.24 KB
/
SAIsim_DeNovo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Simulator script for running SAI forward simulations with particular parameters
import SAIsim as sim
# Whoops, a possibility with randomly assigned sexes is population death
size = 1000
# given 10^-8 SAmut/base/gen and
mutRate = 10^-3
# Approximated by
mutRateInv = 10^-3
# Deviation of normally distributed offset of mutation effects from [x,1-x], with x = uniform[0,1)
mutEffectDiffSD = .2
# Reasonable minimum length given that 1 distance unit on the chromosome = 1 Morgan
minInvLen = .1
# The expected # of crossovers per chromosome arm
# parameter = 1 gives 1 Morgan chromosome arm
recombRate = 1
# Must be <= pop size
encounterNum = 100
# SD for the normally distributed additive noise to male quality in the female choice
choiceNoiseSD = .5
# The probability that a gene undergoes conversion in a heterozygous gamete,
# which one is converted is selected at random, treated independently from number of crossover events
conversionRate = 10.0**-4.0
# Inversion record buffer represents how far from inversion edges to examine mutation effects
invRecBuffer = .1
numGens = 50000
pop = sim.SAIpop(size, mutRate, mutRateInv, mutEffectDiffSD, minInvLen, conversionRate, recombRate, encounterNum, choiceNoiseSD, invRecBuffer)
pop.recordNGens(numGens)