Skip to content

refactor: extract AnophelesIhsAnalysis and add simulated-data tests#1004

Open
ritoban23 wants to merge 1 commit intomalariagen:masterfrom
ritoban23:GH366-ihs-simulated-tests
Open

refactor: extract AnophelesIhsAnalysis and add simulated-data tests#1004
ritoban23 wants to merge 1 commit intomalariagen:masterfrom
ritoban23:GH366-ihs-simulated-tests

Conversation

@ritoban23
Copy link

Part of the ongoing Anopheles God-class refactor (#366).

What this PR does

Extracts all iHS (integrated haplotype score) analysis methods from AnophelesDataResource in anopheles.py into a new dedicated mixin class AnophelesIhsAnalysis, following the same pattern already used by AnophelesH12Analysis, AnophelesG123Analysis, etc.

Files changed

  • malariagen_data/anoph/ihs.py (new)AnophelesIhsAnalysis(AnophelesHapData) mixin containing ihs_gwss, _ihs_gwss, plot_ihs_gwss_track, and plot_ihs_gwss
  • malariagen_data/anopheles.py — removed the four iHS methods and abstract cache-name property; added AnophelesIhsAnalysis import and inserted it into the MRO
  • tests/anoph/test_ihs.py (new) — 7 test functions × 2 simulated-data fixtures (ag3, af1) = 14 parametrised tests covering basic runs, caching, windowing, sample queries, and percentile shapes

Testing

  • pytest test_ihs.py # 14 passed
  • pytest test_h12.py test_g123.py test_h1x.py # no regressions

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.

1 participant