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

Add cohort_allele_frequencies method #729 #777

Merged
merged 2 commits into from
Jan 22, 2022

Conversation

timothymillar
Copy link
Collaborator

Fixes #729

Copy link
Collaborator

@jeromekelleher jeromekelleher left a comment

Choose a reason for hiding this comment

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

LGTM, one question about the NaN corner case semantics though.

variables.validate(ds, {cohort_allele_count: variables.cohort_allele_count_spec})
AC = ds[cohort_allele_count]
K = AC.sum(dim="alleles")
# avoid divide by zero
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we be returning 0 in this case or NaNs? I think in other stats we decided it was simpler to let the maths libraries decide what the outcome of a 1/0 should be, but to suppress the warnings.

We should be consistent with the behaviour of the popgen stats here I think.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

AFAIK runtime warnings still can't be suppressed in Dask. I'll just let them be raised and suppress them in the tests where needed (as in Tajima's D).

@timothymillar
Copy link
Collaborator Author

Thanks for the review @jeromekelleher

Copy link
Collaborator

@jeromekelleher jeromekelleher left a comment

Choose a reason for hiding this comment

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

LGTM!

@tomwhite tomwhite added the auto-merge Auto merge label for mergify test flight label Dec 13, 2021
@tomwhite
Copy link
Collaborator

Looks like this is causing an existing test to fail.

@timothymillar
Copy link
Collaborator Author

@tomwhite I think the test failure was due to #778 which was unrelated (change upstream). Can you restart the builds?

@tomwhite
Copy link
Collaborator

@tomwhite I think the test failure was due to #778 which was unrelated (change upstream). Can you restart the builds?

Yes, that looks like it was the problem. I can't see a button to re-run the build - maybe try rebasing?

@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2022

Codecov Report

Merging #777 (dbc9864) into main (881555a) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #777   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           36        36           
  Lines         3050      3057    +7     
=========================================
+ Hits          3050      3057    +7     
Impacted Files Coverage Δ
sgkit/__init__.py 100.00% <ø> (ø)
sgkit/stats/aggregation.py 100.00% <100.00%> (ø)
sgkit/variables.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 881555a...dbc9864. Read the comment docs.

@mergify mergify bot merged commit d5187c9 into sgkit-dev:main Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge Auto merge label for mergify test flight
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cohort allele frequencies
4 participants