Hi team,
I'm quite new to Slim and I work with version 3.7.1. Will appreciate any help.
I'm trying to study the balancing selection example in section 10.4 of the Slim manual and adapt it to the nucleotide-based models.
The adapted code is
initialize() {
initializeSLiMOptions(nucleotideBased=T);
defineConstant("L", 1e4);
initializeAncestralNucleotides(randomNucleotides(L));
// m1 mutation type: neutral
initializeMutationTypeNuc("m1", 0.5, "f", 0.0);
initializeMutationTypeNuc("m2", 0.5, "f", 0.1); // balanced
// g1 genomic element type: uses m1 for all mutations
initializeGenomicElementType("g1", c(m1,m2), c(999,1), mmKimura(1e-7, 2e-7));
// uniform chromosome of length 10 kb with uniform recombination
initializeGenomicElement(g1, 0, L-1);
initializeRecombinationRate(1e-8);
}
// create a population of 500 individuals
1 {
sim.addSubpop("p1", 100);
}
500 {
sim.addSubpopSplit("p2", 50, p1);
}
1000 {
sim.addSubpopSplit("p3", 25, p2);
}
100000 late() {
// print mutant freqs
cat("Frequencies m1:\n");
print(sim.mutationFrequencies(p1, sim.mutationsOfType(m1)));
cat("Frequencies m2:\n");
print(sim.mutationFrequencies(p1, sim.mutationsOfType(m2)));
}
Most of the output frequencies are around ~0.5 or ~1.0, indicating the possible preferred frequencies as far as I understand. So my question is if there is a way in Slim to study the balancing selection with the pre-set value of the preferred frequency in the population, for example, 0.1? Also, is there a way to set the preferred frequency of certain nucleotides, e.g. A?
Many thanks
Svitlana
mutationEffect(m2) {
return 1.5 - sim.mutationFrequencies(p1, mut);
}
mutationEffect(m2) {
return 1.6 - sim.mutationFrequencies(p1, mut);
}
--
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 on the web visit https://groups.google.com/d/msgid/slim-discuss/ac00d54c-bfdb-47cc-89a1-f7557a210301n%40googlegroups.com.
Hi Ben,
Thanks a lot for your response. Unfortunately, I couldn't solve the previous problem. It's okay though because my focus has shifted, and it's not as important now.
I'm currently working on simulating overdominance only (without GC bias) and adjusting mutation rates and recombination rates to be closer to physiological values (as indicated in the attached script). However, I'm struggling to achieve a strong enough overdominance effect. This means I'm not getting enough polymorphic sites in the simulations to produce a detectable effect. I tried increasing the dominance coefficient and selection coefficient in the balanced mutation through "initializeMutationTypeNuc("m2", 1.5, "f", 0.5)," but this resulted in the error "Simulation Runtime Error ERROR (Subpopulation::UpdateFitness): total fitness of subpopulation is not finite; numerical error will prevent accurate simulation."
Could you please advise if it's possible to overcome this error?
Best wishes,
Svitlana
To view this discussion on the web visit https://groups.google.com/d/msgid/slim-discuss/18721f8a-4933-4bed-bcaf-a3abe0d85b48n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/slim-discuss/a454f89c-67d6-41be-8370-235d0417aca4n%40googlegroups.com.