-
Dear GertjanBisschop and all, I am writing to ask if you can advise me on this problem I got using Another question. Here
How can I set the current time with a Thank you very much in advance. Used codes
Error I got with Other codes after the above steps.
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 15 replies
-
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) |
Beta Was this translation helpful? Give feedback.
-
Regarding the question about demography, it is probably easier to write the demographic model in demes format. To get a growth rate at time 0, you write the most recent epoch for a deme with start_size != end_size. There are examples here |
Beta Was this translation helpful? Give feedback.
-
Hi, many thanks. It's great to know this method. It seems I need to create yaml file? I am not so clear how to incorporate this deme format in my msprime codes. Can you post a simple example? |
Beta Was this translation helpful? Give feedback.
-
You can convert the demes yaml file like this:
(see here) |
Beta Was this translation helpful? Give feedback.
-
You can also write the YAML as a string literal: yaml = """
details here
"""
graph = demes.loads(yaml) |
Beta Was this translation helpful? Give feedback.
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: