Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorder children in tree #217

Merged
merged 4 commits into from
Aug 28, 2023
Merged

Reorder children in tree #217

merged 4 commits into from
Aug 28, 2023

Conversation

colganwi
Copy link
Collaborator

Added reorder_children method to CassiopeiaTree. This is useful for reordering clades prior to plotting a tree.

@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02% 🎉

Comparison is base (43e6b2e) 78.80% compared to head (1ade18d) 78.82%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #217      +/-   ##
==========================================
+ Coverage   78.80%   78.82%   +0.02%     
==========================================
  Files          88       88              
  Lines        7774     7782       +8     
==========================================
+ Hits         6126     6134       +8     
  Misses       1648     1648              
Files Changed Coverage Δ
cassiopeia/data/CassiopeiaTree.py 91.57% <100.00%> (+0.10%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@mattjones315 mattjones315 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Happy to merge it in as is, but I'm curious if you think it would be worthwhile to include functionality to optimize leaf ordering with respect to a piece of meta data (e.g., cell type annotation)? I suppose it could be a separate function that invokes the reorder_children method that you implemented.

@colganwi
Copy link
Collaborator Author

I think a separate function that organizes the entire tree with respect to a meta data item would make the most sense. But I'm not sure we want to include this in Cassiopeia since it requires significant customization. What's the order of the items? How to handle missing data? How to order children with impure subtrees? How to organize with respect to multiple metadata columns? Probably better to let each user write their own function that calls reorder_children.

@colganwi colganwi closed this Aug 28, 2023
@colganwi colganwi reopened this Aug 28, 2023
@mattjones315
Copy link
Collaborator

All good points. I'll make an issue for providing an example in the existing plotting tutorial (just an enhancement). If it's alright, I'll assign it to you for when you have time to provide this example.

Thanks for discussion, and I'll go ahead and merge this in.

@mattjones315 mattjones315 merged commit 03198eb into master Aug 28, 2023
5 checks passed
@colganwi colganwi deleted the reorder-childred branch August 29, 2023 14:25
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.

2 participants