Skip to content

Commit

Permalink
Merge pull request #165 from uclahs-cds/hwinata-fix-simple-dend
Browse files Browse the repository at this point in the history
Fix bug in simple dendrograms
  • Loading branch information
whelena authored Nov 20, 2024
2 parents 030bb7c + 520717f commit 112d1e6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

## Bug
* Resolved issue where the spread parameter was not applied in dendrogram mode.
* Resolved issue for simple dendrogram trees ( < 6 nodes or binary tree), where node angles were not calculated correctly.

# CancerEvolutionVisualization 2.0.1 (2023-11-17)

Expand Down
4 changes: 2 additions & 2 deletions R/calculate.clone.polygons.R
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ compute.clones <- function(
v <- rbind(root, v);
v <- count.leaves.per.node(v);
if (no.ccf) {
tree$angle <- if ((is.null(fixed.angle) && nrow(v) > 6) || any(table(v$parent) > 2)) {
tau <- -(pi / 2.5);
tree$angle <- if ((is.null(fixed.angle) && nrow(v) > 6) || any(table(v$parent) > 2) || any(v$mode == 'dendrogram')) {
tau <- -(pi / 2.5);
vi <- v[v$parent == -1, ];
calculate.angles.radial(v, tree, spread, abs(tau));
} else {
Expand Down
1 change: 1 addition & 0 deletions R/create.phylogenetic.tree.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ create.phylogenetic.tree <- function(
...
) {

tree <- as.data.frame(tree);
if ('node.id' %in% colnames(tree)) {
rownames(tree) <- tree$node.id;
}
Expand Down

0 comments on commit 112d1e6

Please sign in to comment.