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

Allow mutations only at integer sites #9

Closed
wants to merge 2 commits into from
Closed

Allow mutations only at integer sites #9

wants to merge 2 commits into from

Conversation

petrelharp
Copy link
Contributor

I've written code that - I think - puts down mutations only at integer positions. With this branch, it worksl like this:

import msprime
import pyslim

ts = msprime.simulate(10, recombination_rate=0.01, length=100, mutation_rate=0.1)
new_ts = pyslim.mutate(ts, mutation_rate=0.2)

for h in new_ts.haplotypes():
    print(h)

It's simulating under an infinite alleles model, to avoid having to check if the parent mutation is the same. We want this in tskit eventually, and implemented in C (this is pure python, so probably slow for big tree sequences) but we could provide this as a stopgap.

@jeromekelleher
Copy link
Member

One quick question here: why the mutation_rate=0.1 in the call to msprime.simulate()?

@petrelharp
Copy link
Contributor Author

To check if existing mutations would be retained... which, I don't think they are, correctly. See tskit-dev/msprime#553

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 this pull request may close these issues.

None yet

2 participants