Skip to content

Extract plot_haplotype_network into AnophelesHapNetAnalysis mixin#1310

Open
AswaniSahoo wants to merge 1 commit intomalariagen:masterfrom
AswaniSahoo:refactor/extract-hapnet-analysis
Open

Extract plot_haplotype_network into AnophelesHapNetAnalysis mixin#1310
AswaniSahoo wants to merge 1 commit intomalariagen:masterfrom
AswaniSahoo:refactor/extract-hapnet-analysis

Conversation

@AswaniSahoo
Copy link
Copy Markdown
Contributor

Relates to #366

Extracts plot_haplotype_network from AnophelesDataResource into a new
AnophelesHapNetAnalysis mixin, as outlined in my comment on the issue.

What this does

  • New: malariagen_data/anoph/hapnet.py — mixin with plot_haplotype_network and its internal helpers (_median_joining_network, _mjn_graph)
  • Modified: malariagen_data/anopheles.py — removed method, added mixin to MRO, cleaned up unused imports
  • Unchanged: hapnet_params.py — kept as-is
  • New: tests/anoph/test_hapnet.py — simulated-data tests following the existing hapclust.py pattern

Verification

  • MRO resolves correctly with method coming from the new mixin
  • All existing test_hapclust tests pass (no regressions)
  • ruff check and ruff format clean
  • Pre-commit hooks pass

@AswaniSahoo
Copy link
Copy Markdown
Contributor Author

@jonbrenas Ready for review when you get a chance. Let me know if you'd like any changes to the test coverage or the MRO placement.

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