Skip to content

Commit

Permalink
mallard demographic model
Browse files Browse the repository at this point in the history
  • Loading branch information
petrelharp committed Apr 9, 2021
1 parent 2591c7c commit 6d3e934
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/parameter_tables/AnaPla/MallardBlackDuck_2L19.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Population size,"2,940,000",Ancestral pop. size
Population size,"1,570,000",Mallard pop. size
Population size,"1,370,000",Black duck pop. size
Migration rate (x10^-6 per gen.),0.84,Black-Mallard migration rate
Migration rate (x10^-6 per gen.),1.10,Mallard-Black migration rate
Epoch Time (gen.),"158076",Mallard/Black split time
Generation time (yrs.),4,Generation time
Mutation rate (subst/gen),4.83e-9,Mutation rate
1 change: 1 addition & 0 deletions stdpopsim/catalog/AnaPla/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
Catalog definitions for AnaPla (Ensembl ID='anas_platyrhynchos')
"""
from . import species # noqa: F401
from . import demographic_models # noqa: F401
66 changes: 66 additions & 0 deletions stdpopsim/catalog/AnaPla/demographic_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import msprime

import stdpopsim

_species = stdpopsim.get_species("AnaPla")


def _mallard_black_split():
id = "MallardBlackDuck_2L19"
description = "North American Mallard/Black Duck split"
long_description = """
This is a model fit to contemporary samples of wild North American
mallard and black duck, using the "split-migration" model of dadi.
See Figure 6 of Lavretsky et al 2019.
"""
T = 632305 / 4 # in generations
N_BlackDuck = 1.57e6
N_Mallard = 1.37e6
N_Anc = N_BlackDuck + N_Mallard
# the migration rate is given in forwards time relative to the ancestral
# population size
m_bm = (2.82 / N_Anc) * N_Mallard / N_BlackDuck
m_mb = (2.82 / N_Anc) * N_BlackDuck / N_Mallard

model = msprime.Demography()
model.add_population(
initial_size=N_Mallard,
name="Mallard",
description="Wild North American mallards",
)
model.add_population(
initial_size=N_BlackDuck,
name="Black_duck",
description="Wild black ducks",
)
model.add_population(
initial_size=N_Anc,
name="Ancestral",
description="Ancestral population",
)
model.set_migration_rate(rate=m_bm, source="Black_duck", dest="Mallard")
model.set_migration_rate(rate=m_mb, source="Mallard", dest="Black_duck")

model.add_population_split(
time=T, derived=["Mallard", "Black_duck"], ancestral="Ancestral"
)

return stdpopsim.DemographicModel(
id=id,
description=description,
long_description=long_description,
citations=[
stdpopsim.Citation(
author="Lavretsky et al.",
year=2019,
doi="https://doi.org/10.1111/mec.15343",
reasons={stdpopsim.CiteReason.DEM_MODEL},
)
],
generation_time=4,
model=model,
# mutation_rate=4.83e-9,
)


_species.add_demographic_model(_mallard_black_split())

0 comments on commit 6d3e934

Please sign in to comment.