Skip to content

Adding mutations when using "num_replicates" and how to use demes format #2250

Answered by molpopgen
yzliu01 asked this question in Q&A
Discussion options

You must be logged in to vote

When using num_replicates, you get an iterator over tree sequences rather than, say, a list of simulated outputs. You must consume the iterator in order to start adding mutations:

import msprime

for ts in msprime.sim_ancestry(10, num_replicates=5):
    mts = msprime.sim_mutations(ts, rate=1e-4)

Replies: 5 comments 15 replies

Comment options

You must be logged in to vote
14 replies
@GertjanBisschop
Comment options

@yzliu01
Comment options

@GertjanBisschop
Comment options

@yzliu01
Comment options

@GertjanBisschop
Comment options

Answer selected by GertjanBisschop
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@yzliu01
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #2249 on December 29, 2023 20:13.