Hi,
Regarding the question of reaching equilibrium it seems to me that 2N is
unnecessarily long. Unless I am misunderstanding the problem, I think
that "few" generations should be ok. The problem of taking the tree
sequence at the same generation the simulation reaches full coalescence
is that this tree sequence will be shorter than expected under the
coalescent model. Think about simulating your coalescent time forward in
time (but with a coalescent model), your take your waiting times between
coalescent events from an exponential with mean 4N/(k(k-1)) where k-1 is
the number of terminal branches and you start with k=2, when you reach
the last necessary coalescent event (k=2N, first coalescent in backwards
time) you still need to simulate the waiting time from that coalescent
event to the sampling time. Since the "sample size" in the case of the
SLiM simulation is the size of the population, waiting time between
sample time and first coalescent is basically 1 generation. Thus, I
would say that there is no need for simulating 2N generations. Am I
missing something?
That is for a neutral model. If the model has selection on it things
could be trickier. For instance, if the simulation model includes some
rate of slightly deleterious mutations at the beginning of the
simulation there will be no mutations affecting the shape of the
genealogy. By the time the simulation reaches coalescence a significant
number deleterious mutations will be present in the simulation and they
will be affecting how the genealogy is generated. In that case I think
an additional longer period of additional simulations is required to
reach some sort of steady state.
I think in many cases you may want to empirically verify that you are in
a steady state by calculating key measures (diversity, etc) after
coalescence has been reached.
I will be happy to hear other opinions about what is necessary to "reach
equilibrium" in SLiM.
Best,
Miguel
> *_Tree-sequence recording_*
>
> 1. Section 24.13 (p. 576) of the manual (version 3.6) discusses the
> "*permanent*" flag of *treeSeqRememberIndividuals()*, but I am
> having trouble understanding why one would use it. Specifically,
> *permanent=F* will "mark the individuals only for (temporary)
> retention" — does that mean they will be removed again upon the
> next simplification? If so, why would one ever use the flag? I
> had naively thought that the only point of using the function
> *treeSeqRememberIndividuals() *was to remember individuals
> across simplification. As a start, the manual does suggest that
> what happens to non-permanently remembered individuals depends
> on the *retainCoalescentOnly* flag, but this seems only to
> influence whether unary (intermediate) nodes are kept in
> addition to branch points. So, I think I'm confused about the
> purpose of "*permanent*". (I recognize that even my question
> lacks clarity!)
> 2. I also do not understand the following: "if a genome is kept by
> simplification, the genome's corresponding individual is kept
> also, /if/ it is retained." Doesn't a genome being kept by
> simplification mean that the individual in which it occurred
> will be kept, by very definition? In other words, what is the
> meaning of the final "/if/ it is retained"? (It seems it could
> be no other way?)
> 3. Can the *simplificationInterval* be CHANGED at some point during
> the simulation? Similarly, can *checkCoalescence* be CHANGED
> from *T *to*F* at some point during the simulation? I would like
> to check for coalescence during burn-in only, but then make the
> *simplificationInterval* longer and disable *checkCoalescence*
> after coalescence is first detected, because I want to avoid the
> associated performance hits.
>
> *_Rescheduling so as never to occur again_**_
> _*
> In my SLiM model, I have defined a named script block that checks
> for coalescence every 100 generations:
>
> /// CHECK FOR COALESCENCE ///
> s1 1: late() {
> if(sim.generation % 100 == 0) {
> if(sim.treeSeqCoalesced()) {
> // record when coalescence happened
> defineConstant("t_coalescence",
> asInteger(sim.generation));
> catn(t_coalescence + ": COALESCED");
>
> // RESCHEDULE THIS block so it's never run again
> sim.rescheduleScriptBlock(s1, start = 1, end = 1); //
> ERROR: isn't allowed
>
> // RESCHEDULE ALL SUBSEQUENT blocks relative to
> coalescence time
> }
> }
> }
>
> However, after coalescence is detected, I don't want to check for it
> anymore. As shown, I was thinking to reschedule *s1* (the block
> itself) for generation 1 (the past), which would guarantee it's
> never encountered again, but this produces an error:
>
> ERROR (SLiMSim::CheckScheduling): event/callback scheduled for a
> past generation would not run.
>
> What is the proper way to achieve the desired "discontinuing" of a
> script block?
>
>
> *_Coalescence and burn-in time_*
> I would like to run a forward-time burn-in (necessary because I'm
> using trinucleotide context-based mutation rates, which cannot yet
> be overlaid using *msprime*). I'd like the burn-in time to depend on
> when coalescence occurs for a given replicate; however, as the
> manual notes, the moment of coalescence does not necessary mean
> equilibrium has been reached. Thus, my question is *how many
> generations might folks advise continuing the burn-in AFTER
> coalescence*? Is there any agreed-upon rule of thumb (e.g., 2N, 10N,
> or something else)? Would be very grateful to know "best practices"
> in this regard!
>
> With gratitude,
> Chase
>
> --
> SLiM forward genetic simulation:
http://messerlab.org/slim/
> <
http://messerlab.org/slim/>
> ---
> You received this message because you are subscribed to the Google
> Groups "slim-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
slim-discuss...@googlegroups.com
> <mailto:
slim-discuss...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/slim-discuss/2e9c6ceb-07d4-4338-b379-e52b68bd9c98n%40googlegroups.com
> <
https://groups.google.com/d/msgid/slim-discuss/2e9c6ceb-07d4-4338-b379-e52b68bd9c98n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
Miguel NAVASCUÉS
UMR CBGP, INRAE
Centre de Biologie pour la Gestion des Populations
755 avenue du campus Agropolis
CS30016
34988 Montferrier-sur-Lez cedex (France)
phone:
+33499623370
fax:
+33499623345
e-mail: miguel.navascues AT
inrae.fr