Skip to content

Commit

Permalink
add dfes.py configuration file (#1556)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdfields authored Jan 4, 2025
1 parent 451b94e commit a011bf1
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions stdpopsim/catalog/MusMus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

from . import species # noqa: F401
from . import demographic_models # noqa: F401
from . import dfes # noqa: F401
51 changes: 51 additions & 0 deletions stdpopsim/catalog/MusMus/dfes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import stdpopsim

_species = stdpopsim.get_species("MusMus")

###########################################################
#
# DFEs
#
###########################################################


def _BookerDFE():
id = "Gamma_B21"
description = "Deleterious Gamma DFE CDS"
long_description = """
Return negative MutationType()s representing a Mus
musculus subsp. castaneous DFE for protein coded exons or CDS. Booker et al. (2021),
https://doi.org/10.1101/2021.06.10.447924
DFE parameters are based on an analysis of the unfolded site frequency spectrum
(uSFS) using polyDFE v2 (Tataru and Bataillon 2019) as presented in Booker
et al. (2021).
"""
citations = [
stdpopsim.Citation(
author="Booker et al.",
year=2021,
doi="https://doi.org/10.1101/2021.06.10.447924",
reasons={stdpopsim.CiteReason.DFE}, # include the dfe_model reason
)
]
neutral = stdpopsim.MutationType()
gamma_shape = 0.186 # shape
gamma_mean = -5.96e-02 # expected value
h = 0.5 # dominance coefficient
negative = stdpopsim.MutationType(
dominance_coeff=h,
distribution_type="g", # gamma distribution
distribution_args=[gamma_mean, gamma_shape],
)

return stdpopsim.DFE(
id=id,
description=description,
long_description=long_description,
mutation_types=[neutral, negative],
proportions=[0.334, 0.666],
citations=citations,
)


_species.add_dfe(_BookerDFE())

0 comments on commit a011bf1

Please sign in to comment.