Skip to content

Commit

Permalink
Dromel qc (#1668)
Browse files Browse the repository at this point in the history
* qc for DroMel DFE
  • Loading branch information
clararehmann authored Jan 23, 2025
1 parent 5e63e81 commit cb1550a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 4 deletions.
13 changes: 9 additions & 4 deletions stdpopsim/catalog/DroMel/dfes.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,25 @@ def _HuberDFE():
]
neutral = stdpopsim.MutationType()
gamma_shape = 0.33 # shape
gamma_mean = -3.96e-04 # expected value
gamma_scale = 1.2e-3 # scale
gamma_mean = gamma_shape * gamma_scale # expected value
h = 0.5 # dominance coefficient
negative = stdpopsim.MutationType(
dominance_coeff=h,
distribution_type="g", # gamma distribution
distribution_args=[gamma_mean, gamma_shape],
# (1+s for homozygote in SLiM versus 1+2s in dadi)
distribution_args=[-2 * gamma_mean, gamma_shape],
)

# p. 2 in supplement says that the total sequence length of synonymous sites LS
# related to the total sequence length of nonsynonymous sites 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], # LNS = 2.85 x LS
citations=citations,
)

Expand Down
30 changes: 30 additions & 0 deletions stdpopsim/qc/DroMel.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,33 @@ def SheehanSongThreeEpic():


_species.get_demographic_model("African3Epoch_1S16").register_qc(SheehanSongThreeEpic())


def Gamma_H17():
id = "Gamma_H17"
description = "Deleterious Gamma DFE"
long_description = "QC version"
neutral = stdpopsim.MutationType()
gamma_shape = 0.33
gamma_scale = 1.2e-3
gamma_mean = gamma_shape * gamma_scale
h = 0.5 # dominance coefficient
negative = stdpopsim.MutationType(
dominance_coeff=h,
distribution_type="g", # gamma distribution
# (1+s for homozygote in SLiM versus 1+2s in dadi)
distribution_args=[-2 * gamma_mean, gamma_shape],
)
# LNS = 2.85 * LS
# prop_synonymous = 1/(1+2.85) = 0.26
prop_synonymous = 0.26
return stdpopsim.DFE(
id=id,
description=description,
long_description=long_description,
mutation_types=[neutral, negative],
proportions=[prop_synonymous, 1 - prop_synonymous],
)


_species.get_dfe("Gamma_H17").register_qc(Gamma_H17())

0 comments on commit cb1550a

Please sign in to comment.