MomentsLD / moments

MIT License
10 stars 3 forks source link

The "rescaling factor" is the inverse of what people may have in mind #195

Open molpopgen opened 6 hours ago

molpopgen commented 6 hours ago

Exisiting papers treat Q = 10 as making the pop sizes Q-fold smaller. The API here does the inverse.

(Also see molpopgen/demes-rs#447)

Reposting from a Slack discussion w/@apragsdale:

>>> import moments
>>>import demes
>>> with open("model.yaml", "rb") as f:
...     yaml = demes.load(f)
... 
>>> yaml
Graph(description='simple simple simple', time_units='generations', generation_time=1, doi=[], metadata={}, demes=[Deme(name='deme', description='', start_time=inf, ancestors=[], proportions=[], epochs=[Epoch(start_time=inf, end_time=0, start_size=1000, end_size=1000, size_function='constant', selfing_rate=0, cloning_rate=0)])], migrations=[], pulses=[])
>>> r = moments.Demes.DemesUtil.rescale(yaml, 10)
>>> r
Graph(description='simple simple simple', time_units='generations', generation_time=1, doi=[], metadata={}, demes=[Deme(name='deme', description='', start_time=inf, ancestors=[], proportions=[], epochs=[Epoch(start_time=inf, end_time=0, start_size=10000, end_size=10000, size_function='constant', selfing_rate=0, cloning_rate=0)])], migrations=[], pulses=[])