-
Notifications
You must be signed in to change notification settings - Fork 93
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
add pos & neg DFE from Rodrigues et al (PosNeg_R24 in HomSap) #1657
Conversation
(Actually I was hoping @mufernando would QC this - I'll get a code review from someone else?) |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1657 +/- ##
========================================
Coverage 99.84% 99.85%
========================================
Files 132 136 +4
Lines 4584 4690 +106
Branches 467 470 +3
========================================
+ Hits 4577 4683 +106
Misses 3 3
Partials 4 4 ☔ View full report in Codecov by Sentry. |
I've removed you from the assignee list, @mufernando, since I'm hoping you'll QC this? Say if you are actually going to review this PR instead. |
I will QC this instead
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Peter Ralph ***@***.***>
Sent: Tuesday, January 21, 2025 12:57:30 PM
To: popsim-consortium/stdpopsim ***@***.***>
Cc: Murillo F. Rodrigues ***@***.***>; Mention ***@***.***>
Subject: Re: [popsim-consortium/stdpopsim] add pos & neg DFE from Rodrigues et al (PosNeg_R24 in HomSap) (PR #1657)
I've removed you from the assignee list, @mufernando<https://github.com/mufernando>, since I'm hoping you'll QC this? Say if you are actually going to review this PR instead.
—
Reply to this email directly, view it on GitHub<#1657 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACL5HFA5YOEHECD6CDMJB6T2L2YDVAVCNFSM6AAAAABVO3YKFOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBVG4ZDEOJRGM>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Did the following locally with the PR import stdpopsim
import numpy as np
species = stdpopsim.get_species("HomSap")
dfe = species.get_dfe("PosNeg_R24")
contig = species.get_contig(length=30000)
model = species.get_demographic_model("OutOfAfrica_3G09")
samples = {"YRI": 50, "CEU": 50, "CHB": 50}
gene_interval = np.array([[10000, 20000]])
contig.add_dfe(intervals=gene_interval, DFE=dfe)
engine = stdpopsim.get_engine("slim")
ts = engine.simulate(
model,
contig,
samples,
seed=236,
slim_scaling_factor=10,
slim_burn_in=10,
)
print(ts)
print(ts.diversity())
print(ts.allele_frequency_spectrum())
The rationale makes sense and all looks good to me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All seems good!
…-consortium#1657) * DFE from Rodrigues et al
Motivation: we'd like to have a DFE containing positive mutations that aren't all at one fixed value of
s
.Rodrigues, Kern & Ralph doesn't exactly infer such a DFE, in the sense of using a validated inference procedure, but does explore parameter space and find a best-fitting DFE - so, I think it counts, and since it is simulation-based, we know it produces roughly reasonable simulations. The targets of inference are only the proportions of positive and negative selection; the negative part of the DFE is from Castellano et al, which I also cite here; the positive part is based on "expert knowledge" (i.e., something that seems reasonable).
So, in the popsim spirit of "best guess based on current state of knowledge", I think this is a good one to put in. Other opinions welcome (esp if they propose a better alternative such DFE?).
Note that the method uses all the great apes, and so could reasonably be applied to any of them.