Hello!
A quick comment about the SLiM manual. The current recipe for biallelic loci, sec. 14.13, implements the following mutation callbacks:
mutation(m2) {
// unique down to the canonical m2 mutation
return MUT2[mut.position];
}
mutation(m3) {
// unique down to the canonical m3 mutation
return MUT3[mut.position];
}
Notice that this mutation process includes events from m2 to m2 and from m3 to m3, which produce no allelic change at all (due to the uniquing down). Therefore, this version of the recipe actually has an effective mutation rate lower than the rate specified in initializeMutationRate(). With equal mutation rates and under neutrality, such that the equilibrium is 50% m2 and 50% m3, the effective mutation rate is approximately half of the value passed to initializeMutationRate().
This is, of course, not a bug per se, since SLiM’s interpretation of mutation rates is completly consistent. However, I would suggest either adding a warning to the recipe, along the lines of:
Notice that, if you are comparing this recipe with biallelic models in which mutation rates are defined as probabilities of switching between the two alleles, the effective switching rate in this recipe is lower than the rate passed to initializeMutationRate() due to...
Alternatively, the mutation callbacks could be updated as follows, which might also be instructive for people learning SLiM:
/// Back and forth mutations m2<-->m3
mutation(m2) {
pos = mut.position;
originally_m2 = haplosome.containsMutations(MUT2[pos]);
return ifelse(originally_m2, MUT3[pos], MUT2[pos]);
}
mutation(m3) {
pos = mut.position;
originally_m2 = haplosome.containsMutations(MUT2[pos]);
return ifelse(originally_m2, MUT3[pos], MUT2[pos]);
}
Hello!
A quick comment about the SLiM manual. The current recipe for biallelic loci, sec. 14.13, implements the following mutation callbacks:
Notice that this mutation process includes events from
m2tom2and fromm3tom3, which produce no allelic change at all (due to the uniquing down). Therefore, this version of the recipe actually has an effective mutation rate lower than the rate specified ininitializeMutationRate(). With equal mutation rates and under neutrality, such that the equilibrium is 50%m2and 50%m3, the effective mutation rate is approximately half of the value passed toinitializeMutationRate().This is, of course, not a bug per se, since SLiM’s interpretation of mutation rates is completly consistent. However, I would suggest either adding a warning to the recipe, along the lines of:
Alternatively, the mutation callbacks could be updated as follows, which might also be instructive for people learning SLiM: