uclahs-cds / package-CancerEvolutionVisualization

Publication Quality Phylogenetic Tree Plots
https://cran.r-project.org/web/packages/CancerEvolutionVisualization/
GNU General Public License v2.0
2 stars 0 forks source link

Trunk node must be first #12

Closed dan-knight closed 2 years ago

dan-knight commented 2 years ago

(Submitted by @whelena)

The trunk node (with parent NA) will break SRCGrob if it is in any position except first. Some node arrangements will result in a strange looking tree, while others will actually result in an error in the internal plotting code.

This only occurs when no CP column is provided, as the nodes are reordered correctly by CP values when it is present.

The solution, for now, seems to be to add a step to prep.tree to move the trunk node to the top of the order, and change parent values accordingly.