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 Garuds G gwss statistics #430

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sanjaynagi
Copy link

In this PR, I add the Garuds G statistics (G1, G12, G123, G2/G1) to scikit-allel.

We use the same hashing function as the Garuds H functions, as opposed to the optimised (DJB33XA) hash function used in malariagen_data. Currently I cant actually install scikit-allel, not sure whats going on, have asked @alimanfoo for help.

We also add a function diplotype_frequencies() which computes distinct_frequencies of diplotypes. This is not quite analogous to the garuds_h function, as the garuds_h function takes an allel.HaplotypeArray which has the method distinct_frequencies(). garuds_g expects an array of alternate counts (biallelic, from GenotypeArray.to_n_alt() ), which is not a scikit-allel class (just a np array), therefore we cannot add its own methods to it.

As far as I can see, H12 does not have tests, so I haven't added any yet, but will do.

@pep8speaks
Copy link

pep8speaks commented Oct 8, 2024

Hello @sanjaynagi! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 842:1: E302 expected 2 blank lines, found 1
Line 863:1: E302 expected 2 blank lines, found 1
Line 893:1: W293 blank line contains whitespace
Line 909:1: E302 expected 2 blank lines, found 1

Comment last updated at 2024-10-10 17:02:09 UTC

@sanjaynagi
Copy link
Author

Working nicely!
image

Havent written any tests yet, otherwise id say this is ready to merge. FWIW, i cant see any tests for H12, otherwise I would've copied them.

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.

2 participants