Scaling in msprime? #1687
-
Hello all! I am currently trying to benchmark methods to detect introgression utilizing msprime and my overarching goal is to test under a wide parameter space that makes biological sense to a plethora of organisms. However, the issue that I am now running into is that msprime is starting to become quite slow when considering systems that are millions of generations diverged. I know it is common to apply a scaling factor to forward in time simulations and I wanted to confirm or deny that this is applicable to msprime. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @David-Peede! In a coalescent setting, simulating the ancestry of a sample is agnostic to the time scale of the simulation. So it's probably the simulation of mutations that is the computational constraint in your case. The total number of mutations to be simulated is proportional to |
Beta Was this translation helpful? Give feedback.
-
I agree with @grahamgower - another note: a good way to benchmark would be to run your simulations on a range of shorter chromosomes, and then extrapolate to figure out how long the simulations you actually want to run would take. Collecting data from simulations that take minutes to a few hours and looking at the msprime paper for suggestions of what curve to fit to the data should give you good predictions. |
Beta Was this translation helpful? Give feedback.
Hi @David-Peede! In a coalescent setting, simulating the ancestry of a sample is agnostic to the time scale of the simulation. So it's probably the simulation of mutations that is the computational constraint in your case. The total number of mutations to be simulated is proportional to
mu*T
(whereT
the sum of the branch lengths in the tree(s) andmu
is the mutation rate). When scaling a SLiM simulation, one generally divides the time values by the scaling factor and multiplies the mutation rate by the scaling factor, which maintains the same total diversity as an unscaled simulation. But this would imply thatmu*T
is held constant! So unless I'm missing something, I don't think any kind…