Skip to content

Commit

Permalink
Merge pull request #993 from izabelcavassim/demography
Browse files Browse the repository at this point in the history
Boyko 2008 African demographic model
  • Loading branch information
petrelharp committed Aug 11, 2021
2 parents d476871 + 650a9df commit 00bcb96
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/parameter_tables/HomSap/Africa_1B08.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Population size,"7,778",Ancestral pop. size
Population size,"25,636",Current pop. size
Growth rate (per gen.),0.000175165,AFR pop. growth rate expansion
Epoch Time (gen.),"6,809",Expansion time of ancestral pop.
Generation time (yrs.),1,Generation time
Mutation rate,1.80E-08,Per-base per-generation mutation rate
53 changes: 53 additions & 0 deletions stdpopsim/catalog/HomSap/demographic_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1548,3 +1548,56 @@ def _ooa_4pop():


_species.add_demographic_model(_ooa_4pop())


def _africanBoyko():
id = "Africa_1B08"
description = "African population"
long_description = """
This was the best fit model for the African population described
in Boyko et al (2008). It is a two-epoch instantaneous growth model
and values were extracted from Table S1 of the article.
"""
populations = [
stdpopsim.Population(id="AFR_Boyko", description="African Boyko"),
]
citations = [
stdpopsim.Citation(
author="Boyko et al.",
year=2008,
doi="https://doi.org/10.1371/journal.pgen.1000083",
reasons={stdpopsim.CiteReason.DEM_MODEL},
)
]

mutation_rate = 1.8e-8 # from Gravel et al, 2011, PNAS
generation_time = None
N1 = 25636 # Population size at present
N2 = 7778 # Population size at start (forwards in time) of exponential growth.
T1 = 0 # End of exponential growth period (forwards in time)
T2 = 6809 # Start of exponential growth period (forwards in time)
# Calculate growth rate; solve N2 = N1 * exp(-alpha * (T2 - T1))
growth_rate = -math.log(N2 / N1) / (T2 - T1)
growth_rate = growth_rate

return stdpopsim.DemographicModel(
id=id,
description=description,
long_description=long_description,
populations=populations,
citations=citations,
generation_time=generation_time,
mutation_rate=mutation_rate,
population_configurations=[
msprime.PopulationConfiguration(
initial_size=N1, metadata=populations[0].asdict()
),
],
demographic_events=[
msprime.PopulationParametersChange(time=T1, growth_rate=growth_rate),
msprime.PopulationParametersChange(time=T2, growth_rate=0),
],
)


_species.add_demographic_model(_africanBoyko())

0 comments on commit 00bcb96

Please sign in to comment.