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

feat(coloc): single SNP case #511

Merged
merged 18 commits into from
Mar 7, 2024
Merged

feat(coloc): single SNP case #511

merged 18 commits into from
Mar 7, 2024

Conversation

xyg123
Copy link
Contributor

@xyg123 xyg123 commented Feb 29, 2024

no longer filtering out single snp studyLocusOverlaps.

when: f.col("sumlogsum") == f.col("logsum12") == 0 :
This causes problems when we have to log the result.
Instead of 0, replace with a very small number.

Works when one causal snp is overlapping, returns high h4 value very close to 1.

@addramir addramir changed the title Single snp coloc chore: single snp coloc case Feb 29, 2024
@addramir
Copy link
Contributor

addramir commented Mar 5, 2024

What is the status here?

@xyg123
Copy link
Contributor Author

xyg123 commented Mar 6, 2024

Added additional tests for other edge cases where the overlapping SNPs are not causal/ only causal in one study. The fix returns sensible results in both cases(high h0 or high h1).

This doesn't happen in practice as we take the union of the overlaps between credible sets, in Finngen r10 for example there are 3.4k/39k studyLocusOverlaps which are single SNP, all of which are causal (min.PP = ~0.95, avg.PP=0.99).

@xyg123 xyg123 marked this pull request as ready for review March 6, 2024 13:58
Copy link
Collaborator

@d0choa d0choa left a comment

Choose a reason for hiding this comment

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

Everything looks healthy. One small comment to make more clear why things are done in this way but nothing critical. Feel free to merge when appropiate

src/gentropy/method/colocalisation.py Outdated Show resolved Hide resolved
@d0choa d0choa changed the title chore: single snp coloc case feat: single SNP coloc case Mar 6, 2024
@d0choa d0choa changed the title feat: single SNP coloc case feat(coloc): single SNP case Mar 6, 2024
@github-actions github-actions bot added Feature and removed Chore labels Mar 7, 2024
@xyg123 xyg123 merged commit 1fecffb into dev Mar 7, 2024
4 checks passed
@xyg123 xyg123 deleted the single_snp_coloc branch March 7, 2024 12:37
DSuveges pushed a commit that referenced this pull request Mar 8, 2024
* feat: include single snp overlaps in coloc calcs

* chore: added unit test for coloc

* feat: include single snp overlaps in coloc calcs

* chore: added unit test for coloc

* fix: check for differences in test results

* fix: revert changes to single snp coloc tests for other pr

* fix: revert single snp change

* chore: restructure test folder

* fix: compare differences in results rather than exact match

* chore: test description

* fix: allow for coloc when only one snp is overlapping

* chore: include tests for h0 and h1/2

* fix: added pseudocount variable to coloc

* fix: pseudocount as a Coloc attribute

---------

Co-authored-by: David Ochoa <ochoa@ebi.ac.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants