Add optional Hampel filter support to H12 functions#955
Add optional Hampel filter support to H12 functions#955Tanisha127 wants to merge 5 commits intomalariagen:masterfrom
Conversation
|
Hi @alimanfoo and @jonbrenas This PR adds optional Hampel filter support to the h12_gwss() function and related plotting functions to help smooth isolated outliers. All 14 H12 tests pass locally, and all CI checks are green. Thanks! |
|
Hi @jonbrenas , |
jonbrenas
left a comment
There was a problem hiding this comment.
Thanks @Tanisha127. Can you move the new parameters to the correct location?
ae8b2b9 to
d0d6293
Compare
16c02b6 to
8a6c4f0
Compare
|
Hi @jonbrenas, I've addressed your feedback — the hampel parameters have been moved to the correct location (before chunks and inline_array) in all affected functions. All 17 tests are passing and all 8 CI checks are green. Please take a look when convenient! |
Closes #351
Summary
Added optional Hampel filter support to
h12_gwss()and related plottingfunctions. H12 GWSS results commonly include isolated outliers with high H12
values but little support from neighbouring windows. These are unlikely to be
true selection signals. The Hampel filter smooths these isolated outliers,
helping direct attention towards real recent selection signals.
Changes
hampel_filter()function using median absolute deviation (MAD)h12_gwss()and all related plotting functions:apply_hampel(bool, defaultFalse) — enable/disable the filterhampel_window(int, default5) — window size for the filterhampel_t(float, default3) — threshold multiplier for outlier detectiontest_hampel_filter_removes_isolated_outliercheck_h12_gwssandcheck_h12_gwss_multiFunctions Updated
h12_gwss()plot_h12_gwss_track()plot_h12_gwss()plot_h12_gwss_multi_overlay_track()plot_h12_gwss_multi_overlay()plot_h12_gwss_multi_panel()Testing
All 14 h12 tests pass locally.