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 14, 2021
1 parent 2591c7c commit 7715866
Show file tree
Hide file tree
Showing 3 changed files with 78 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
69 changes: 69 additions & 0 deletions stdpopsim/catalog/AnaPla/demographic_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
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, not years
N_BlackDuck = 1.57e6
N_Mallard = 1.37e6
# personal communication from Joshua Brown 13 Apr 2021:
# "Based on the contemporary dataset, the ancestral population size
# "for the Black duck/Mallard dadi model was 819535."
N_Anc = 819535
# the migration rate is reported as 2.82 in each direction. From the dadi
# manual, m12 is "the fraction of individuals each generation in pop 1 that
# are new migrants from pop 2, times the 2Nref". To convert back to real
# time units (fraction replaced per generation) we divide by 2 * N_anc.
m = 2.82 / (2 * N_Anc)

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_symmetric_migration_rate(populations=["Mallard", "Black_duck"], rate=m)

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 7715866

Please sign in to comment.