Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QC for AraTha DFE #1647

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions stdpopsim/catalog/AraTha/dfes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,15 @@


def _HuberDFE():
id = "Gamma_H18"
description = "Deleterious Gamma DFE"
id = "GammaAdditive_H18"
description = "Deleterious additive Gamma DFE"
long_description = """
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah - could you update the long description, also? How about

    Additive, deleterious DFE from Huber et al. (2018) for Arabidopsis, 
    estimated using <software> from A. lyrata as a Gamma distribution
    of deleterious effects. Parameters are from Supplementary Table 4,
    the "genome-wide, additive-only model for A. lyrata". The DFE for
    lyrata (rather than thaliana) is provided due to challenges with
    simulating selfing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I see <software> wasn't some named software package, they just did it using Methods from the paper. I rephrased this to "using the SFS"

Return negative (no neutral, in this case) MutationType()s
representing an Arabidopsis DFE. From Huber et al. (2018).
Gamma parameters are based on Supplementary Table 4,
the genome-wide, additive-only model for A. LYRATA- due to
challenges with simulating with selfing for A. thaliana.
The Supplementary Table 4 DFEs are not noted to contain
any neutral mutations (in contrast, Supplementary Table 3
notes neutral proportions for two other DFEs), and in the
main text including neutral mutations seems like a
supplementary analysis rather than the main strategy.
Additive, deleterious DFE from Huber et al. (2018) for Arabidopsis,
estimated from the SFS of A. lyrata as a Gamma distribution
of deleterious effects. Parameters are from Supplementary Table 4,
the "genome-wide, additive-only model for A. lyrata". The DFE for
A. lyrata (rather than A. thaliana) is provided due to challenges
with simulating selfing.
"""
citations = [
stdpopsim.Citation(
Expand All @@ -34,12 +30,15 @@ def _HuberDFE():
]
neutral = stdpopsim.MutationType()
gamma_shape = 0.27 # shape
gamma_mean = -0.0004 # expected value
gamma_scale = -0.0004 # scale
gamma_mean = gamma_shape * gamma_scale
h = 0.5 # dominance coefficient
negative = stdpopsim.MutationType(
dominance_coeff=h,
distribution_type="g", # gamma distribution
distribution_args=[gamma_mean, gamma_shape],
# extra factor of 2 is to convert dadi to SLiM
# (1+s for homozygote in SLiM versus 1+2s in dadi)
distribution_args=[-2 * gamma_mean, gamma_shape],
)

return stdpopsim.DFE(
Expand Down
26 changes: 26 additions & 0 deletions stdpopsim/qc/AraTha.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,29 @@ def HuberThreeEpoch():


_species.get_demographic_model("African3Epoch_1H18").register_qc(HuberThreeEpoch())


def HuberDFE():
id = "QC-GammaAdditive_H18"
# Huber et al. 2018 Supplementary table 4.
# genome-wide A. lyrata additive fitness effects
neutral = stdpopsim.MutationType()
gamma_shape = 0.27
gamma_scale = 0.0004
gamma_mean = -(gamma_shape * gamma_scale) # negative since deleterious mutations
h = 0.5
negative = stdpopsim.MutationType(
dominance_coeff=h,
distribution_type="g",
distribution_args=[-2 * gamma_mean, gamma_shape],
)
return stdpopsim.DFE(
id=id,
description=id,
long_description=id,
mutation_types=[neutral, negative],
proportions=[0.0, 1.0],
)


_species.get_dfe("GammaAdditive_H18").register_qc(HuberDFE())
2 changes: 1 addition & 1 deletion tests/test_slim_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@ def test_not_simulated_outside_region(self):

left, right = 100000, 900000
contig = species.get_contig("1", left=left, right=right)
dfe = species.get_dfe("Gamma_H18")
dfe = species.get_dfe("GammaAdditive_H18")
exons = species.get_annotations("araport_11_exons")
exon_intervals = exons.get_chromosome_annotations("1")
contig.add_dfe(intervals=exon_intervals, DFE=dfe)
Expand Down
Loading