-
Notifications
You must be signed in to change notification settings - Fork 14
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
edits for DFE-alpha #119
edits for DFE-alpha #119
Conversation
workflows/ts2fs.py
Outdated
neu_len = round(seq_len * kwargs['neu_prop']) | ||
neu_fs[0] = neu_len - sum(neu_fs[1:]) | ||
nonneu_len = round(seq_len * kwargs['nonneu_prop']) | ||
nonneu_fs[0] = nonneu_len - sum(nonneu_fs[1:]) | ||
|
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.
Need to add something similar in _generate_dfe_alpha_fs
. Right now the first bin is ALL positions including mutated and substitutions. This is the right format form some software, but not for DFE-alpha.
rng = default_rng(42) | ||
neutral_subs_draw = rng.poisson(total_neutral_subs) | ||
|
||
#add neutral subs to last bin | ||
mut_afs["neutral"][-1] = neutral_subs_draw | ||
|
||
#add in ancestral counts | ||
mut_afs["neutral"][0] = neutral_anc_count | ||
mut_afs["non_neutral"][0] = non_neutral_anc_count | ||
|
||
# Remove mutated sites from first bin | ||
mut_afs["neutral"][0] = mut_afs["neutral"][0] - sum(mut_afs["neutral"][1:]) | ||
mut_afs["non_neutral"][0] = mut_afs["non_neutral"][0] - sum(mut_afs["non_neutral"][1:]) | ||
|
||
print(f"AFSs\nNeutral: {mut_afs['neutral']}\nNon-neutral: {mut_afs['non_neutral']}") |
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.
poisson draw and removing mutations from ancestral monomorphic counts
closing because now subset of what's in #120 |
This one has some edits we need. Should be good to merge |
No description provided.