tskit-dev / pyslim

Tools for dealing with tree sequences coming to and from SLiM.
MIT License
26 stars 23 forks source link

Strange warning in recapitation #345

Open trevorcousins opened 3 weeks ago

trevorcousins commented 3 weeks ago

Hi, I am following the SLiM manual for recapitation, and after doing the command:

recap = pyslim.recapitate(ts, ancestral_Ne=ancestralNe, recombination_rate=recombinationrate)

I get the warning: /home/trc468/.conda/envs/snakemake_new/lib/python3.10/site-packages/msprime/ancestry.py:831: TimeUnitsMismatchWarning: The initial_state has time_units=ticks but time is measured in generations in msprime. This may lead to significant discrepancies between the timescales.

Which I am a bit confused about - the SLiM manual indicates to me that ticks and generations are synonymous in a WF model (I did indeed simulate a WF model from SLiM). Is this just a safety warning?

petrelharp commented 3 weeks ago

Yep, just a safety warning! For more info on this, see the docs.

I'll close this, but feel free to re-open if there's an issue here. I suppose one could make the case that in WF models SLiM should make the output time unit "generations" (or, ["ticks", "generations"]?), but this also sounds like a can of worms.

bhaller commented 3 weeks ago

Hey @petrelharp. I suggested that @trevorcousins ought to open this issue, because it seems weird to me that the warning is issued for WF models. If WF models ticks and generations are the same thing, so what, really, is pyslim warning about? And pyslim does know that the tree sequence came from a WF model, right? So, should it really warn in this case?