omerwe / polyfun

PolyFun (POLYgenic FUNctionally-informed fine-mapping)
MIT License
88 stars 22 forks source link

Only run one susieR finemapping function #150

Closed jdblischak closed 1 year ago

jdblischak commented 1 year ago

Currently finemapper.py supports susieR >= 0.9 (susie_suff_stat()) and susieR <= 0.8.0 (susie_bhat()). It achieves this by always running susie_bhat() if the call to susie_suff_stat() fails. This works as intended when the failure is because susie_suff_stat() doesn't exist. However, when susie_suff_stat() fails for a legitimate reason, the subsequent failure to run susie_bhat() clutters the traceback and confuses end users because the susie_bhat() error is the bottom-most message.

In Issue #119, multiple users have reported legitimate errors from susie_suff_stat() and interpreted them as needing to fix susie_bhat(), and I don't think we should be encouraging new users to install a pre-CRAN susieR from 2019.

This PR maintains backwards compatibility with outdated susieR versions, but now only runs a single function from susieR based on which function is available. I ran python test_polyfun.py to confirm the tests continue to pass with both susieR 0.8.0 and 0.9.0 (conda binaries available from my channel, jdblischak::r-susier)

omerwe commented 1 year ago

Looks great, thanks as always @jdblischak!