Implement Garud's G selection statistics for unphased data#1341
Open
sanjaynagi wants to merge 2 commits intosgkit-dev:mainfrom
Open
Implement Garud's G selection statistics for unphased data#1341sanjaynagi wants to merge 2 commits intosgkit-dev:mainfrom
sanjaynagi wants to merge 2 commits intosgkit-dev:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After @benjeffery's awesome talk at EIT the other day, I was reminded of a feature I never finished adding to sgkit from over 3 years ago (#980)! not sure how much work is being done on sgkit right now but thought it would be fun to finish it.
In this PR I add the Garud's G statistics GWSS, that are analogous to the Garud's H statistics but for unphased data. In our experience from mosquito genomics, they tend to work very well. G123 is directly analogous to H12, so most of the code is identical to that implementation (please see the issue #980 for more detail).
In the PR i've renamed the _Garud_h() function to _Garud_stat(), as it is applicable to both haplotypes (Garuds H stats) and diplotypes/MLGs (Garuds G stats), and I didn't want to duplicate the code with two separate functions. I have used Nandita Garuds original implementation (SelectionHapStats) to generate expected values for tests from the sgkit simulated dataset.