Using population parameter change

22 views
Skip to first unread message

Elizabeth Barthelemy

unread,
Apr 2, 2020, 9:41:29 AM4/2/20
to msprime-users
Hello all!

I have a few questions regarding using demographic events with msprime.

First, in the documentation, initial_size is said to be the absolute diploid size of the population at the beginning of the time slice starting at time.
However in this example: http://www.molpopgen.org/2018/12/18/msprime.html#/9 initial sizes are 0.01 and 0.1 so I don't really understand how these can be absolute sizes...

Second, say I want to simulate the coalescent for a sample of size 10 with an effective population size of 1000 and I want Ne to change (for example it doubles) at a given time in the past say at generation 500.
I then use:

example = msprime.PopulationParametersChange(time=500, initial_size= 2000)

and when I print the demography debugger for this event the first period before the demographic change has a effective size of 1.

I was wondering how this is handled by msprime.simulate() ? Will it consider over the first period that the effective size is 1 or 1000 in this case:

msprime.simulate(sample_size = 10, Ne = 1000, demographic_events = example)


Thanks!


Elizabeth

Peter Ralph

unread,
Apr 2, 2020, 12:31:16 PM4/2/20
to Elizabeth Barthelemy, msprime-users
Hello!  Good questions.


First, in the documentation, initial_size is said to be the absolute diploid size of the population at the beginning of the time slice starting at time.
However in this example: http://www.molpopgen.org/2018/12/18/msprime.html#/9 initial sizes are 0.01 and 0.1 so I don't really understand how these can be absolute sizes...

An excellent question; this is very confusing. I prefer to use interpretable sizes at all times for this reason. However, since this is a coalescent simulator, everything can be *rescaled* - for instance, setting Ne=1.0 (the default!) and mutation and recombination rate both also equal to 1.0 is "equivalent" to having Ne=1000 and mutation and recombination rate both 0.001. I put "equivalent" in quotes because this is a time scaling - the trees you get will have time in units of Ne generations - but the genotypes you get have the same distribution.  To see why, you need to read up on coalescent theory.
 

Second, say I want to simulate the coalescent for a sample of size 10 with an effective population size of 1000 and I want Ne to change (for example it doubles) at a given time in the past say at generation 500.
I then use:

example = msprime.PopulationParametersChange(time=500, initial_size= 2000)

and when I print the demography debugger for this event the first period before the demographic change has a effective size of 1.

I was wondering how this is handled by msprime.simulate() ? Will it consider over the first period that the effective size is 1 or 1000 in this case:

msprime.simulate(sample_size = 10, Ne = 1000, demographic_events = example)

Small error here: the demographic events needs to be a list. Except for that, Ne over the first period would be 1000, as we can see from the Demography Debugger:

example = msprime.PopulationParametersChange(time=500, initial_size= 2000)>>> example = msprime.PopulationParametersChange(time=500, initial_size= 2000)
dd = msprime.DemographyDebugger(Ne=1000, demographic_events = [example])
dd.print_history()

Model =  hudson(reference_size=1000)
=============================
Epoch: 0 -- 500.0 generations
=============================
     start     end      growth_rate |     0    
   -------- --------       -------- | --------
0 |  1e+03    1e+03               0 |     0    

Events @ generation 500.0
   - Population parameter change for -1: initial_size -> 2000
===============================
Epoch: 500.0 -- inf generations
===============================
     start     end      growth_rate |     0    
   -------- --------       -------- | --------
0 |  2e+03    2e+03               0 |     0   


Hope that clears things up (except the rescaling thing, which is just plain confusing)!!



Thanks!


Elizabeth

--
You received this message because you are subscribed to the Google Groups "msprime-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msprime-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/msprime-users/4d09b393-4e0f-4c31-ac63-48939c3eca59%40googlegroups.com.

Elizabeth Barthelemy

unread,
Apr 3, 2020, 3:27:13 AM4/3/20
to msprime-users
Thank you very much! This is very helpful, I hadn't noticed you could supply the demography debugger with Ne.

As for the first point, I figured as much but wasn't sure, thanks again for your help :-) !
Reply all
Reply to author
Forward
0 new messages