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

edits for DFE-alpha #119

Closed
wants to merge 8 commits into from

Conversation

silastittes
Copy link
Contributor

No description provided.

Comment on lines 365 to 369
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:])

Copy link
Contributor Author

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.

workflows/ts2fs.py Outdated Show resolved Hide resolved
Comment on lines +155 to +169
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']}")
Copy link
Contributor Author

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

@silastittes
Copy link
Contributor Author

closing because now subset of what's in #120

@silastittes silastittes closed this Sep 3, 2024
@silastittes silastittes mentioned this pull request Sep 3, 2024
@silastittes silastittes reopened this Oct 2, 2024
@silastittes
Copy link
Contributor Author

This one has some edits we need. Should be good to merge

@silastittes silastittes closed this Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants