Skip to content

List phyloframe as tree provider#25

Merged
iosonofabio merged 15 commits intofabilab:mainfrom
mmore500:phyloframe
Apr 8, 2026
Merged

List phyloframe as tree provider#25
iosonofabio merged 15 commits intofabilab:mainfrom
mmore500:phyloframe

Conversation

@mmore500
Copy link
Copy Markdown
Contributor

@mmore500 mmore500 commented Apr 3, 2026

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. 👍

@iosonofabio
Copy link
Copy Markdown
Contributor

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!

@mmore500
Copy link
Copy Markdown
Contributor Author

mmore500 commented Apr 3, 2026

Will do!

claude and others added 11 commits April 4, 2026 00:02
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
@mmore500
Copy link
Copy Markdown
Contributor Author

mmore500 commented Apr 4, 2026

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 _add_leaf_vertices 👍

Let me know what you think and any more changes needed! Took a shot at updating pyproject.toml dependency-groups.docs to include phyloframe and Seaborn (used in the added gallery examples) --- just a guess as to how to include the dependency, I didn't dig too far into how the dependencies are handled in CI.

Comment thread gallery/tree/plot_phyloframe_tree.py
@iosonofabio
Copy link
Copy Markdown
Contributor

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 😋

@mmore500
Copy link
Copy Markdown
Contributor Author

mmore500 commented Apr 4, 2026

Sounds good, thanks!! (& colour reverted!) :)

@iosonofabio
Copy link
Copy Markdown
Contributor

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 phyloframe anyway, therefore even if we had failing tests we would not be able to fix them. You might want to add tests in phyloframe though.

I'll merge after it passes CI.

@iosonofabio iosonofabio merged commit a9065c9 into fabilab:main Apr 8, 2026
7 checks passed
@iosonofabio
Copy link
Copy Markdown
Contributor

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!

@mmore500 mmore500 deleted the phyloframe branch April 8, 2026 14:13
@mmore500
Copy link
Copy Markdown
Contributor Author

mmore500 commented Apr 8, 2026

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!

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.

3 participants