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

Allele frequency conditioning with multiple DrawMutation events at the same locus #1337

Closed
nspope opened this issue Aug 23, 2022 · 1 comment · Fixed by #1341
Closed

Allele frequency conditioning with multiple DrawMutation events at the same locus #1337

nspope opened this issue Aug 23, 2022 · 1 comment · Fixed by #1341
Milestone

Comments

@nspope
Copy link
Collaborator

nspope commented Aug 23, 2022

Relates to #608.

If multiple DrawMutation events with the same single site id are supplied to the SLiM engine, then multiple mutations of the same type will be generated. If these mutations make it into the sampled individuals, they will ultimately end up as different alleles (integer codes) in the outputted tree sequence.

This creates a bit of a dilemma for ConditionOnAlleleFrequency. What exactly should be conditioned on? Some options are:

  1. The simulation could abort if there's more than one DrawMutation event at the same site. This is de facto what happens currently -- if there's more than one extant mutation at a site when the AF condition is evaluated, then SLiM will exit with a rather ambiguous error message. So we'd just need to add a check for overlapping DrawMutation events in slim_makescript and exit with an informative error.
  2. The allele frequency condition could apply to the sum of frequencies of derived alleles.
  3. The allele frequency condition could apply independently to all derived alleles. This seems useful in some cases, like for conditioning on the survival of all derived alleles. However we'd need some additional checks to ensure that the condition is possible to satisfy.
  4. Separate conditions could be applied to separate alleles. I think the only reasonable way to allow this would be to permit multiple mutation types at the same "single site" (in which case alleles could have separate fitness coefficients) -- but this would require more infrastructure, testing, etc.

My vote is for (1) as this will require very little work to implement, and should cover many use cases (?). Ultimately it'd be nice to extend this to (4).

@nspope nspope added this to the Version 0.2.0-beta milestone Aug 23, 2022
@petrelharp
Copy link
Contributor

I vote for (1) also!

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

Successfully merging a pull request may close this issue.

2 participants