tskit-dev / pyslim

Tools for dealing with tree sequences coming to and from SLiM.
MIT License
27 stars 23 forks source link

add `mutation_rate` to recapitate #225

Closed petrelharp closed 2 years ago

petrelharp commented 2 years ago

This would make a SLiMMutationModel(type=0) and call sim_mutations( ), thus saving some code complexity.

It should also check what the largest mutation ID is, using #179.

jeromekelleher commented 2 years ago

Are you sure? It took a lot of work to untangle ancestry and mutation simulation in msprime. What if someone wants to, say, only put mutations on the new bits of the tree? Aren't you going to end up with having to add all the arguments to sim_mutations to recapitate?

Why not pyslim.sim_mutations which has sensible defaults for SLiMulated trees?

grahamgower commented 2 years ago

What if someone wants to, say, only put mutations on the new bits of the tree?

This is what we do in stdpopsim for DFE sims, right? I.e. put mutations on the recapitated bit only with the full mutation rate, then put neutral mutations on the SLiM part with a rate map appropriate for the DFE annotations.

petrelharp commented 2 years ago

Yeah - maybe not. Doing mutation-to-complement SLiM and recapitation is a bit fiddly, so we could make it easier somehow, but just adding a mutation rate wouldn't help that much. I'll leave this open as a part in that puzzle, though.