List phyloframe as tree provider#25
Conversation
|
Thank you, fantastic news! Do you think you could add a gallery example to this PR to demonstrate it? I can take care of dependencies for CI and such afterwards. Thanks! |
|
Will do! |
Add a biology gallery example showing phyloframe's iplotx integration: - Scatter tree with per-node trait overlay (adapted from hstrat) - Newick string parsing via phyloframe Both use phyloframe's data provider directly (no dendropy needed). Also add phyloframe>=0.7.0 to docs dependency group. https://claude.ai/code/session_016k3qjgchPRJSeWh8dyaafn
Co-authored-by: Matthew Andres Moreno <[email protected]>
Rewrite the phyloframe gallery example to use a hardcoded primate phylogeny with polars DataFrames instead of generated numpy arrays with pandas. Remove the ancestor_list column — only id, ancestor_id, and origin_time are needed. https://claude.ai/code/session_016k3qjgchPRJSeWh8dyaafn
Restructure the phyloframe gallery example so the scatter overlay uses seaborn.scatterplot and lives in a draw_scatter_tree() function that accepts hue/size/style column mappings. The function is then called on the hardcoded primate phylogeny DataFrame. Add seaborn>=0.13.0 to docs dependency group. https://claude.ai/code/session_016k3qjgchPRJSeWh8dyaafn
- First plot: small vertebrate phylogeny with radial layout and Set2 palette, coloured by taxonomic group - Second plot: primate phylogeny with vertical layout, hue=diet and size=body_mass_kg using dark palette - draw_scatter_tree() now handles radial layout using get_nodes().get_offsets() for Cartesian coords, matching the original hstrat-synthesis implementation - Added c, scatter_shuffle params from original draw_scatter_tree - Docstring links back to original source on GitHub https://claude.ai/code/session_016k3qjgchPRJSeWh8dyaafn
- Rename plot_phyloframe_scatter_tree.py → gallery/tree/plot_phyloframe.py to match other provider examples (plot_dendropy.py, plot_skbio_tree.py) - Use `from phyloframe import legacy as pfl` throughout - Replace primate phylogeny with smaller programming-language genealogy - Two plots: radial + vertical, both with scatter overlay https://claude.ai/code/session_016k3qjgchPRJSeWh8dyaafn
|
Hi @iosonofabio --- gallery example created! While making the example, I ran into an issue with leaf label ordering inside iplotx, so this PR also now includes a suggested patch to tree Let me know what you think and any more changes needed! Took a shot at updating |
|
Amazing, thanks! Lots to unpack, give me a couple days. We might also need test functions on the input from phyloframe. The spelling is not British, it's Aussie. Please don't change it to US English 😋 |
This reverts commit 4cca76d.
|
Sounds good, thanks!! (& colour reverted!) :) |
|
Ok I've edited the text and style a little bit but apart from that it looks good. I don't think we should add tests because the code implementing iplotx's compatibility in in I'll merge after it passes CI. |
|
I'll just add one thing since AI was involved in this PR. Generally, it is expected that you declare it if you intend to use AI for open source contributions, because AI-written PRs can be quite messy at times. Thanks! |
|
Sounds good! Thanks for the help with the label spacing — couldn’t quite get that right and my workaround wasn’t ideal. Yes, the AI tools definitely require a fair amount of babysitting and cleaning up. Tools attributing the commit record is a step in the right direction I think, but I’ll be sure to make an explicit note in any future PR’s too. 👍 Thanks again for the review and fixes iosonofabio!! I’ll keep an eye out for more potential examples in the future to contribute back to the gallery! |
Hi @/iosonofabio! Finally got around to implementing the integration I had mentioned a few months ago, and thought I should offer to note it here. Thanks again for the great tool. 👍