Hi everyone,
I’m working on a recent biological introduction in Hawai’i (less than 20 generations ago) and am trying to parameterize SLiM to match the dynamics of this introduction. The species is partially clonal and can also spread by selfing. My main goal is to test whether partial clonality and successive founder effects could explain the high FST values and strong IBD observed through ddRADseq data.
Rather than generating random polymorphism, I used a VCF containing genotypes from the population at the initial point of introduction. I don’t have a specific question, but I would greatly appreciate feedback on my scripting to ensure that I am: i) correctly initializing simulations from this polymorphism, and ii) properly simulating successive founder events (p1 → p2 → p3 → p4) at successive generations, with all individuals evolving under partial clonality. I’m using SLiM v3.5.
Please let me know if anything looks wrong or inappropriate. I’m still a beginner with SLiM, so any guidance would be much appreciated.
Thank you for your help
Lauric Reynes
Here is my script:
// =====================
// SLiM 3.5
// =====================
initialize() {
setSeed(seed);
initializeSLiMModelType("nonWF");
initializeMutationType("m1", 0.5, "f", 0.0);
m1.convertToSubstitution = F;
initializeGenomicElementType("g1", m1, 1.0);
initializeGenomicElement(g1, 0, 5000);
initializeMutationRate(0);
initializeRecombinationRate(1e-08);
}
// ------------------- Reproduction with partial clonality -------------------
reproduction() {
CLONAL_RATE = INPUT_CLONAL; // 10% clonal reproduction
K = INPUT_K; // maximum population size per subpop
inds = subpop.individuals;
for (ind in inds) {
if (subpop.individualCount < K) {
if (runif(1) < CLONAL_RATE) {
subpop.addCloned(ind); // clonal offspring
} else {
mate = subpop.sampleIndividuals(1);
subpop.addCrossed(ind, mate[0]); // sexual offspring
}
}
}
}
1 early () {
sim.addSubpop("p1", 13);
p1.genomes.readFromVCF(INPUT_VCF, m1);
catn("Clonality rate: " + INPUT_CLONAL);
catn("maximum population size per subpop: " + INPUT_K);
}
// ------------------- Founder Events: Stepping-Stone -------------------
5 late() {
sim.addSubpop("p2", 0);
nFounders = min(3, p1.individualCount);
founders = sample(p1.individuals, nFounders);
p2.takeMigrants(founders);
catn("p2 colonized with " + nFounders + " founders");
}
8 late() {
sim.addSubpop("p3", 0);
nFounders = min(3, p2.individualCount);
founders = sample(p2.individuals, nFounders);
p3.takeMigrants(founders);
catn("p3 colonized with " + nFounders + " founders");
}
10 late() {
sim.addSubpop("p4", 0);
nFounders = min(3, p3.individualCount);
founders = sample(p3.individuals, nFounders);
p4.takeMigrants(founders);
catn("p4 colonized with " + nFounders + " founders");
}
// ------------------- Output -------------------
15 {
maxSample = 20; // maximum per population
nP1 = min(p1.individualCount, maxSample);
nP2 = min(p2.individualCount, maxSample);
nP3 = min(p3.individualCount, maxSample);
nP4 = min(p4.individualCount, maxSample);
// ----------------- Print the actual sample sizes -----------------
catn("Sampling " + nP1 + " individuals from p1");
catn("Sampling " + nP2 + " individuals from p2");
catn("Sampling " + nP3 + " individuals from p3");
catn("Sampling " + nP4 + " individuals from p4");
inds = c(
p1.sampleIndividuals(nP1),
p2.sampleIndividuals(nP2),
p3.sampleIndividuals(nP3),
p4.sampleIndividuals(nP4)
);
inds.genomes.outputVCF(filePath=OUT_VCF);
catn("Generation 15: VCF output completed");
sim.simulationFinished();
}
--
SLiM forward genetic simulation: http://messerlab.org/slim/
---
You received this message because you are subscribed to the Google Groups "slim-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to slim-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/slim-discuss/30c5f289-04c7-4abb-a69a-14c9c54e0a30n%40googlegroups.com.