forked from speciationgenomics/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathneutral_contraction.slim
37 lines (28 loc) · 965 Bytes
/
neutral_contraction.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
37
// Instantaneous population contraction from 1000 to 250 at genneration 2000
initialize()
{
// set the overall mutation rate
initializeMutationRate(1e-5);
// 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);
// Chromosome of length 10 kb, homogenous (all of type g1)
initializeGenomicElement(g1, 0, 9999);
// uniform recombination along the chromosome
initializeRecombinationRate(1e-8);
}
// create a population of 1000 individuals
1 early()
{
sim.addSubpop("p1", 1000);
}
// at generation 2000 decrease the population size to 250 immediately
2000 early() { p1.setSubpopulationSize(250); }
// run to generation 5000
5000 late() {
// randomly subsample 20 individuals for output
allIndividuals = sim.subpopulations.individuals;
sampledIndividuals = sample(allIndividuals, 20);
sampledIndividuals.genomes.outputVCF();
}