You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if it could be useful to add methods for species that handle substitutions similarly to how genome (or individual) methods handle mutations. For instance:
I think any simulation of quantitative traits could benefit, as the trait of an individual of species sim based on mutations of type m1 (e.g. "n" with mean 0 and given variance) could be readily written as
Recipe 9.6.1:
From if (sum(sim.substitutions.selectionCoeff) == 0.0) to if (sim.sumOfSubstitutionsOfType(m1) == 0.0)
More generally, one could think of a new callback substitute(<mutType>) which takes place every time a mutation of a given type is about to become a substitution. This could be ideal to end simulations as soon as a fixation event takes place, e.g.
substitute(m1) { sim.simulationFinished(); }
(present in many Recipes of sweeps) or, to update a baseline trait-value (that is, to overcome the need for sumOfSubstitutionsOfType(m1) in my example of quantitative traits above, as one could write
or even to have a mutation-based policy of substitution (e.g., by returning T or F from the callback). This idea being shared, I do think a new callback for this might be an overkill.
On a different aspect, but also regarding Substitutions, I wonder if outputSubstitutions() would be more aligned with the SLiMverse vocabulary than the current outputFixedMutations(). But that's a detail :)
The text was updated successfully, but these errors were encountered:
Hi @vsudbrack. I've been working on a redesign of some parts of SLiM to better support quantitative traits. The design will automatically update the baseline offset of the trait after substitution, as you suggest here; so I think that aspect of your proposal is not necessary with that new design. But I like your other suggestions. Not sure whether the new callback type would really pay for itself; each new callback type just makes SLiM even more complicated, of course. It would help with that narrow problem of halting when a substitution occurs, but it doesn't strike me as having a lot of other uses (since the baseline issue will be taken care of). Anyhow, I'll think on all this, thanks!
I was wondering if it could be useful to add methods for species that handle substitutions similarly to how genome (or individual) methods handle mutations. For instance:
I think any simulation of quantitative traits could benefit, as the trait of an individual of species
sim
based on mutations of type m1 (e.g. "n" with mean 0 and given variance) could be readily written asA few recipes that could benefit from it (from a quick CTRL+F in the manual):
From
fixed = (sum(sim.substitutions.mutationType == m2) == 1);
tofixed = (sim.countOfSubstitutionsOfType(m2) > 0);
From
if (sum(sim.substitutions.selectionCoeff) == 0.0)
toif (sim.sumOfSubstitutionsOfType(m1) == 0.0)
More generally, one could think of a new callback
substitute(<mutType>)
which takes place every time a mutation of a given type is about to become a substitution. This could be ideal to end simulations as soon as a fixation event takes place, e.g.(present in many Recipes of sweeps) or, to update a baseline trait-value (that is, to overcome the need for
sumOfSubstitutionsOfType(m1)
in my example of quantitative traits above, as one could writeand then
or even to have a mutation-based policy of substitution (e.g., by returning
T
orF
from the callback). This idea being shared, I do think a new callback for this might be an overkill.On a different aspect, but also regarding Substitutions, I wonder if
outputSubstitutions()
would be more aligned with the SLiMverse vocabulary than the currentoutputFixedMutations()
. But that's a detail :)The text was updated successfully, but these errors were encountered: