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

Improper CP values silently rearranged #43

Open dan-knight opened 1 year ago

dan-knight commented 1 year ago

Nodes are reordered by CP, but a node whose CP is larger than its parent will swap positions in the tree (essentially swapping parents). In reality, this should probably generate an error, as a child node cannot be more prevalent than its parent. However, this may be a grey area. (@yashpatel6, @whelena, any thoughts?)

Reordering node names by CP (when no labels are provided) seems logical, and was the intended functionality. This seems to be a bug related to indexing the values themselves.

yashpatel6 commented 1 year ago

Generally, I'd lean against silently changing the input data with no warning or error. If we want to keep the default behavior of re-arranging the nodes despite the given parent-child relationships, I'd suggest documenting this explicitly and showing a warning when it occurs.