msprime
msprime copied to clipboard
Define global stopping condition
In #2157 we decided to add a boolean flag stop_at_local_mrca which states whether we should keep simulating the ancestry of genome segments after an mrca has been reached.
We also want some way of specifying the global stopping condition.
Note that we already have an end_time parameter, which currently allows us to stop simulations early, and could be used as the global stopping condition if we turn off the current default of stopping when all intervals have a local mrca.
I guess there's two options.
- We could have a
stop_conditionparameter which takes a string, and could have things likegrand_mrca,all_local_mrcas,time(used in conjunction withend_timeabove) - Have a single boolean parameter which turns off the current stop condition, like
stop_at_all_local_mrcasor something?
Option (1) seems neater. We'd have something like
ts = msprime.sim_ancestry(10,
stop_at_local_mrcas=False,
stop_condition="time",
end_time=100)
to record the full process back to time 100, regardless of whether coalescence occurs or not?