-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModelA.slim
36 lines (34 loc) · 1.39 KB
/
ModelA.slim
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
// set up a simulation
initialize()
{
// set the overall mutation rate
initializeMutationRate(5.468928e-08);
// we use autosomes not sex chromosomes, therefore:
initializeSex("A");
// two types of mutations: deleterious and neutral
// Neutral mutation (synonymous sites)
initializeMutationType("m1", 0.5, "f", 0.0);
// detrimental mutations (nonsynonymous sites) following a gamma distribution with mean=-2.5, shape=0.3
initializeMutationType("m2", 0.1, "g", -2.5, 0.35);
// g1 genomic element type: coding:
// Now I initialize the coding element with 2/3 non-synonymous and 1/3 synonymous
initializeGenomicElementType("g1", c(m1, m2), c(0.34,0.66));
// chromosome consisting of 1500 genomic elements of type g1 , with gaps between them at regular intervals
for (index in 1:1500)
initializeGenomicElement(g1, index*1000, index*1000 + 499);
// uniform recombination rate
// this value needs a better estimate
initializeRecombinationRate(6.604764e-06);
}
1 { sim.addSubpop("p1", 10000); }
50000 { p1.setSubpopulationSize(20000); }
65000 late() {sim.addSubpopSplit("p2", 20000, p1);}
65001{
p1.setSubpopulationSize(1000);
p2.setSubpopulationSize(30000);
}
71001 late() {
p1.outputSample(60,filePath="SmallPop_mutations_ModelA.txt",append=F);
p2.outputSample(60,filePath="LargePop_mutationss_ModelA.txt",append=F);
sim.outputFixedMutations(filePath="All_substitutionss_ModelA.txt",append=F);
}