msprime icon indicating copy to clipboard operation
msprime copied to clipboard

add `stack_policy` argument to `SLiMMutationModel`

Open petrelharp opened this issue 1 year ago • 3 comments

Currently the SLiM mutation model always stacks mutations, i.e., adds them on to existing ones. Sometimes we'd like to do something different, e.g.,:

  • have a "last" stacking policy (so, there's no stacked mutations, it's just the last one that applies)
  • so we can add mutations like they are for nucleotide models

However, there's one tricky thing here (and the reason we didn't do this before): say we simulate selected mutations with SLiM, then want to add neutral ones. If we allow the neutral ones to 'overwrite' the existing selected mutations then we're changing the genotypes retroactively in a non-neutral way, which is not so good. Options to deal with this:

  1. just trust the user to not actually put new mutations on regions having existing mutations
  2. do not add mutations to any site with existing mutations
  3. always have existing mutations take precedence

petrelharp avatar Sep 30 '22 04:09 petrelharp