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

Convenience functions for single site selection models #1329

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

Convenience functions for single site selection models #1329

nspope opened this issue Aug 19, 2022 · 1 comment · Fixed by #1341
Labels
enhancement New feature or request
Milestone

Comments

@nspope
Copy link
Collaborator

nspope commented Aug 19, 2022

In #1082, @andrewkern suggested making the single site selection API more user-friendly. The idea is to have convenience functions that set up lists of extended events for frequently-used models like hard sweeps.

This could look something like:

contig.add_single_site(id="sweep_locus", coordinate=10000, fitness_coeff=0.1)
sweep_events = stdpopsim.ext.selective_sweep(
  single_site_id="sweep_locus",
  population_id=0, 
  start_time=1000, 
  end_time=0, 
  min_end_frequency=1.0
)

which would condition on a mutation originating in population 0 at time 1000 and reaching fixation by the end of the simulation.

Some questions are:

  • What other models would be useful to support-- soft sweeps and adaptive introgression, probably? Should these be separate convenience functions, or combined into one function with more arguments?
  • How much flexibility to allow in terms of allele frequency conditioning; e.g. for the hard sweep model above, should it be possible to condition on ending allele frequencies in multiple populations, rather than just the population where the mutation originated?
  • To what degree should the lower-level API (lists of user-created extended events) be documented?
  • Should stdpopsim.ext be removed?
@nspope nspope added the enhancement New feature or request label Aug 19, 2022
@nspope nspope added this to the Version 0.2.0-beta milestone Aug 21, 2022
@nspope
Copy link
Collaborator Author

nspope commented Aug 23, 2022

Resolving the ext or not question should close #584. A related question is if "extended events" should be referred to as "SLiM events", as suggested in #656.

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

Successfully merging a pull request may close this issue.

1 participant