-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathtest1.slim
More file actions
51 lines (37 loc) · 1.01 KB
/
test1.slim
File metadata and controls
51 lines (37 loc) · 1.01 KB
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
43
44
45
46
47
48
49
50
51
// Keywords:
// set up a simple neutral simulation
initialize()
{
// set the overall mutation rate
initializeMutationRate(1e-4);
// m1 mutation type: neutral
initializeMutationType("m1", 0.5, "f", 0.0);
// g1 genomic element type: uses m1 for all mutations
initializeGenomicElementType("g1", m1, 1.0);
// uniform chromosome of length 1 kb
initializeGenomicElement(g1, 0, 1000);
// uniform recombination along the chromosome
initializeRecombinationRate(1e-5);
}
// create a population of 100 individuals (1000 for testing)
1
{
sim.addSubpop("p1", 100);
}
// at generation 800, start pop growth
800: {
newSize = asInteger(round(1.03^(sim.generation - 799) * 100));
if (newSize >= 2500)
{
newSize = 2500;
sim.deregisterScriptBlock(self);
}
p1.setSubpopulationSize(newSize);
}
// run to generation 10000
10000 late() {
// randomly subsample 3 individuals for output
allIndividuals = sim.subpopulations.individuals;
sampledIndividuals = sample(allIndividuals, 3);
sampledIndividuals.genomes.outputVCF();
}