Expected time for tree chromosomes simulation

16 views
Skip to first unread message

Jana Obsteter

unread,
Jul 6, 2020, 7:14:35 AM7/6/20
to msprime-users
Hi to all!

I am just starting with msprime to simulate tree genomes! We specified the demographic model, but the largest issue up to now has been simulation time. One chromosome is 2e09, there are 12 chromosomes. I am currently running just one chromosome with the following specifications:

chromosomeSize = 2.5e09
recombinationRate = 7.5e-10
mutationRate = 1.5e-13

I am including only two demographic events - starting with a huge initial effective population size 550,000, then simulating two bottleneck events shrinking the effective population size down to 500 and later to 100.

# Set present population parameters
population_configuration = [msprime.PopulationConfiguration(sample_size = 100,
                                                           initial_size = 100,
                                                           growth_rate = 0)]
# Specify pst demographic events - back in time (most recent first)
demographic_events = [msprime.PopulationParametersChange(time = 5,
                                                         initial_size = 100,
                                                         growth_rate = -0.805),
                      msprime.PopulationParametersChange(time = 7,
                                                         initial_size=550000,
                                                         growth_rate=0)]
And then running the simulation with: 
pop = msprime.simulate(length = chromosomeSize, recombination_rate = recombinationRate, mutation_rate = mutationRate, Ne = 100,
                       random_seed = randint(1, (2**32-1)), 
                       population_configurations = population_configuration, demographic_events = demographic_events)

So I wanted to ask - approximately how much time is such simulation supposed to run? And also, whether the simulation code can be optimized to be more efficient or maybe simulate the data faster?

Thanks!

Jerome Kelleher

unread,
Jul 7, 2020, 3:33:10 AM7/7/20
to msprim...@googlegroups.com
Hi Jana,

Simulating trees for trees, very cool! From what you say, unfortunately,
I think these simulations might take quite a while to run. It's
difficult to make predictions because the running time depends on the
input parameters in a complicated way.

Probably the best way to get an idea for how long the simulation might
take is to run it for some shorter chromosome sizes and try to
extrapolate. The running time will grow roughly quadratically with
chromosome size.

How long does it take to run a chromosome size of 1e08, say?

Cheers,
Jerome
> --
> 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
> <mailto:msprime-user...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/msprime-users/f8fef762-df63-449c-b624-3d832e88fdcbo%40googlegroups.com
> <https://groups.google.com/d/msgid/msprime-users/f8fef762-df63-449c-b624-3d832e88fdcbo%40googlegroups.com?utm_medium=email&utm_source=footer>.

Jana Obsteter

unread,
Jul 7, 2020, 5:05:41 AM7/7/20
to Jerome Kelleher, msprim...@googlegroups.com
Jerome, hi!

Thank you for your answer - the information about the quadratic relationship helps! I have simulated smaller sizes: 2e07  took ~40s, and 2e08 took about 2h.
We just need an approximate time to see, whether it's feasible and to set the time limit.

Thanks again!
Jana



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/3c2fde62-5292-2d3b-3c65-13cffb714ff1%40ndm.ox.ac.uk.

Jerome Kelleher

unread,
Jul 7, 2020, 5:12:25 AM7/7/20
to Jana Obsteter, msprim...@googlegroups.com
Hi Jana,

I'm guessing your full simulation should take around a week then. It
definitely seems feasible, though.

cheers,
Jerome
> <mailto:msprime-users%2Bunsu...@googlegroups.com>
> > <mailto:msprime-user...@googlegroups.com
> <mailto:msprime-users%2Bunsu...@googlegroups.com>>.
> > To view this discussion on the web, visit
> >
> https://groups.google.com/d/msgid/msprime-users/f8fef762-df63-449c-b624-3d832e88fdcbo%40googlegroups.com
>
> >
> <https://groups.google.com/d/msgid/msprime-users/f8fef762-df63-449c-b624-3d832e88fdcbo%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> 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
> <mailto:msprime-users%2Bunsu...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/msprime-users/3c2fde62-5292-2d3b-3c65-13cffb714ff1%40ndm.ox.ac.uk.
>

Jana Obsteter

unread,
Jul 7, 2020, 5:17:24 AM7/7/20
to Jerome Kelleher, msprim...@googlegroups.com
Great, thanks again, this is really good and helpful information!
Cheers, 
Jana
Reply all
Reply to author
Forward
0 new messages