Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add stack_policy argument to SLiMMutationModel #2113

Open
petrelharp opened this issue Sep 30, 2022 · 3 comments
Open

add stack_policy argument to SLiMMutationModel #2113

petrelharp opened this issue Sep 30, 2022 · 3 comments

Comments

@petrelharp
Copy link
Contributor

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
@jeromekelleher
Copy link
Member

(1) seems like the simplest and most consistent with existing models, but whatever makes most sense implementation wise is good by me.

@petrelharp
Copy link
Contributor Author

I agree, but however (1) is not actually consistent with how we use it in stdpopsim, where we want to add both selected mutations to a region in SLiM and later add neutral ones to the same regions.

@petrelharp
Copy link
Contributor Author

I'm not thinking of a good way to do this that doesn't lose information - I'm thinking that if we want this, it should be a post-processing method available in pyslim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants