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

Allow specific text labels #10

Closed dan-knight closed 2 years ago

dan-knight commented 2 years ago

Currently, the package uses tree dataframe row names as node labels. This works for numeric values, but fails when text values are used. If cellular prevalence values are included, the package reorders the nodes by their CP values and also renames the nodes based on their new position (1-n).

This relabeling behaviour is fine in some situations, but could overwrite specified labels. The package needs a way to determine whether it should relabel the nodes. One solution would be to also use an optional label column. Nodes are only relabeled if there is no label column present. The parent column's behaviour would remain unchanged, referencing the row index of the parent node (not the new label value).