Skip to content

Commit

Permalink
Fix factor of 2 in Gamma_K17 DFE
Browse files Browse the repository at this point in the history
Confirmed by @klohmueller here: #1477
  • Loading branch information
RyanGutenkunst authored and petrelharp committed Jun 13, 2023
1 parent e9c9b1e commit 5f319a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion stdpopsim/catalog/HomSap/dfes.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def _KimDFE():
Na = 12378
gamma_scale = 875
gamma_shape = 0.186 # shape
# Extra factor of 2 in mean is to account for difference between tools
# in how fitness is defined
# (1+s for homozygote in SLiM versus 1+2s in dadi)
gamma_mean = (-gamma_shape * gamma_scale * 2) / (2 * Na) # expected value
h = 0.5 # dominance coefficient
negative = stdpopsim.MutationType(
Expand Down Expand Up @@ -74,7 +77,10 @@ def _HuberDFE():
]
neutral = stdpopsim.MutationType()
gamma_shape = 0.19 # shape
gamma_mean = -0.014 # expected value
# Extra factor of 2 in mean is to account for difference between tools
# in how fitness is defined
# (1+s for homozygote in SLiM versus 1+2s in dadi)
gamma_mean = -0.014 * 2 # expected value
h = 0.5 # dominance coefficient
negative = stdpopsim.MutationType(
dominance_coeff=h,
Expand Down
2 changes: 1 addition & 1 deletion stdpopsim/qc/HomSap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1703,7 +1703,7 @@ def Huber2017():
negative = stdpopsim.MutationType(
dominance_coeff=0.5,
distribution_type="g", # gamma distribution
distribution_args=[-0.014, 0.19],
distribution_args=[-0.014 * 2, 0.19],
)

return stdpopsim.DFE(
Expand Down

0 comments on commit 5f319a5

Please sign in to comment.