YosefLab / Cassiopeia

A Package for Cas9-Enabled Single Cell Lineage Tracing Tree Reconstruction
https://cassiopeia-lineage.readthedocs.io/en/latest/
MIT License
75 stars 24 forks source link

Reorder children in tree #217

Closed colganwi closed 1 year ago

colganwi commented 1 year ago

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

codecov[bot] commented 1 year ago

Codecov Report

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

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

Additional details and impacted files ```diff @@ 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](https://app.codecov.io/gh/YosefLab/Cassiopeia/pull/217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=YosefLab) | Coverage Δ | | |---|---|---| | [cassiopeia/data/CassiopeiaTree.py](https://app.codecov.io/gh/YosefLab/Cassiopeia/pull/217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=YosefLab#diff-Y2Fzc2lvcGVpYS9kYXRhL0Nhc3Npb3BlaWFUcmVlLnB5) | `91.57% <100.00%> (+0.10%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

colganwi commented 1 year ago

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.

mattjones315 commented 1 year ago

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.