Skip to content

Commit

Permalink
DroMel too
Browse files Browse the repository at this point in the history
  • Loading branch information
petrelharp committed Jan 19, 2025
1 parent fce44e2 commit 8aba4cf
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 54 deletions.
65 changes: 64 additions & 1 deletion stdpopsim/catalog/DroMel/dfes.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,83 @@ def _HuberDFE():
distribution_type="g", # gamma distribution
distribution_args=[gamma_mean, gamma_shape],
)
# p. 2 in supplement says that the total sequence length of synonymous sites LS
# related to the total sequence length LNS by LNS = 2.85 * LS;
# so this is 1 / (1 + 2.85) = 0.2597402597402597
prop_synonymous = 0.26

return stdpopsim.DFE(
id=id,
description=description,
long_description=long_description,
mutation_types=[neutral, negative],
proportions=[0.26, 0.74], # LNS = 2.85 x LS
proportions=[prop_synonymous, 1 - prop_synonymous],
citations=citations,
)


_species.add_dfe(_HuberDFE())


def _ZhenDFE():
id = "GammaPos_H17"
description = "Deleterious Gamma DFE with fixed-s beneficials"
long_description = """
The DFE estimated from D.melanogaster-simulans data estimated in Zhen et al
(2021, https://dx.doi.org/10.1101/gr.256636.119).
This uses the demographic model and deleterious-only DFE from
Huber et al (2017), and then the number of nonsynonymous differences
to simulans to estimate a proportion of nonsynonmyous differences
and (single) selection coefficient. So, this is the "Gamma_H17" DFE,
with some proportion of positive selection with fixed s.
"""
citations = [
stdpopsim.Citation(
author="Zhen et al.",
year=2021,
doi="https://dx.doi.org/10.1101/gr.256636.119",
reasons={stdpopsim.CiteReason.DFE},
)
]
neutral = stdpopsim.MutationType()
gamma_shape = 0.33 # shape
gamma_mean = -3.96e-04 # expected value
h = 0.5 # dominance coefficient
negative = stdpopsim.MutationType(
dominance_coeff=h,
distribution_type="g", # gamma distribution
distribution_args=[gamma_mean, gamma_shape],
)
# p. 2 in supplement says that the total sequence length of synonymous sites LS
# related to the total sequence length LNS by LNS = 2.85 * LS
# so this is 1 / (1 + 2.85) = 0.2597402597402597
prop_synonymous = 0.26

sel_coeff = 10 ** (-4.801)
prop_beneficials = 6.75e-4
positive = stdpopsim.MutationType(
dominance_coeff=0.5,
distribution_type="f",
distribution_args=[sel_coeff],
)

return stdpopsim.DFE(
id=id,
description=description,
long_description=long_description,
mutation_types=[neutral, negative, positive],
proportions=[
prop_synonymous,
(1 - prop_synonymous) * (1 - prop_beneficials),
(1 - prop_synonymous) * prop_beneficials,
],
citations=citations,
)


_species.add_dfe(_ZhenDFE())


def _RagsdaleDFE():
id = "LognormalPlusPositive_R16"
description = "Deleterious log-normal and beneficial mixed DFE"
Expand Down
106 changes: 53 additions & 53 deletions stdpopsim/catalog/HomSap/dfes.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,59 +149,6 @@ def _HuberLogNormalDFE():
_species.add_dfe(_HuberLogNormalDFE())


def _KyriazisDFE():
id = "Mixed_K23"
description = "Deleterious Gamma DFE with additional lethals"
long_description = """
The DFE estimated from human data recommended in Kyriazis et al.
(2023), https://doi.org/10.1086/726736, for general use.
This model is similar to the Kim et al. (2017) DFE based on human
genetic data, modified to include the dominance distribution from
Henn et al. (2016).
The model is also augmented with an additional proportion of 0.3% of
recessive lethals, based on the analysis of Wade et al. (2023).
"""
citations = [
stdpopsim.Citation(
author="Kyriazis et al.",
year=2023,
doi="https://doi.org/10.1086/726736",
reasons={stdpopsim.CiteReason.DFE},
)
]
neutral = stdpopsim.MutationType()
gamma_mean = -0.0131
gamma_shape = 0.186
coefs = [0.45, 0.2, 0.05, 0]
breaks = [0.001, 0.01, 0.1]
gamma = stdpopsim.MutationType(
dominance_coeff_list=coefs,
dominance_coeff_breaks=breaks,
distribution_type="g", # gamma distribution
distribution_args=[gamma_mean, gamma_shape],
)
lethal = stdpopsim.MutationType(
distribution_type="f", # fixed value
distribution_args=[-1], # fitness in SLiM for homozygotes is multiiplied by 1+s
dominance_coeff=0,
)
proportion_deleterious = 2.31 / (1 + 2.31)
lethal_prop = proportion_deleterious * 0.003 # 0.3% lethals
gamma_prop = proportion_deleterious - lethal_prop
neutral_prop = 1 - proportion_deleterious
return stdpopsim.DFE(
id=id,
description=description,
long_description=long_description,
mutation_types=[neutral, gamma, lethal],
proportions=[neutral_prop, gamma_prop, lethal_prop],
citations=citations,
)


_species.add_dfe(_KyriazisDFE())


def _ZhenDFE():
id = "GammaPos_Z21"
description = "Deleterious Gamma DFE with fixed-s beneficials"
Expand Down Expand Up @@ -262,3 +209,56 @@ def _ZhenDFE():


_species.add_dfe(_ZhenDFE())


def _KyriazisDFE():
id = "Mixed_K23"
description = "Deleterious Gamma DFE with additional lethals"
long_description = """
The DFE estimated from human data recommended in Kyriazis et al.
(2023), https://doi.org/10.1086/726736, for general use.
This model is similar to the Kim et al. (2017) DFE based on human
genetic data, modified to include the dominance distribution from
Henn et al. (2016).
The model is also augmented with an additional proportion of 0.3% of
recessive lethals, based on the analysis of Wade et al. (2023).
"""
citations = [
stdpopsim.Citation(
author="Kyriazis et al.",
year=2023,
doi="https://doi.org/10.1086/726736",
reasons={stdpopsim.CiteReason.DFE},
)
]
neutral = stdpopsim.MutationType()
gamma_mean = -0.0131
gamma_shape = 0.186
coefs = [0.45, 0.2, 0.05, 0]
breaks = [0.001, 0.01, 0.1]
gamma = stdpopsim.MutationType(
dominance_coeff_list=coefs,
dominance_coeff_breaks=breaks,
distribution_type="g", # gamma distribution
distribution_args=[gamma_mean, gamma_shape],
)
lethal = stdpopsim.MutationType(
distribution_type="f", # fixed value
distribution_args=[-1], # fitness in SLiM for homozygotes is multiiplied by 1+s
dominance_coeff=0,
)
proportion_deleterious = 2.31 / (1 + 2.31)
lethal_prop = proportion_deleterious * 0.003 # 0.3% lethals
gamma_prop = proportion_deleterious - lethal_prop
neutral_prop = 1 - proportion_deleterious
return stdpopsim.DFE(
id=id,
description=description,
long_description=long_description,
mutation_types=[neutral, gamma, lethal],
proportions=[neutral_prop, gamma_prop, lethal_prop],
citations=citations,
)


_species.add_dfe(_KyriazisDFE())

0 comments on commit 8aba4cf

Please sign in to comment.