... | ... |
@@ -2,7 +2,7 @@ Package: ggtree |
2 | 2 |
Type: Package |
3 | 3 |
Title: an R package for visualization and annotation of phylogenetic trees with |
4 | 4 |
their covariates and other associated data |
5 |
-Version: 1.15.2 |
|
5 |
+Version: 1.15.3 |
|
6 | 6 |
Authors@R: c( |
7 | 7 |
person("Guangchuang", "Yu", email = "guangchuangyu@gmail.com", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0002-6485-8781")), |
8 | 8 |
person("Tommy Tsan-Yuk", "Lam", email = "tylam.tommy@gmail.com", role = c("aut", "ths")), |
... | ... |
@@ -46,10 +46,12 @@ layoutEqualAngle <- function(model, branch.length ){ |
46 | 46 |
} |
47 | 47 |
} |
48 | 48 |
|
49 |
- if (branch.length == "none") { |
|
49 |
+ if (is.null(tree$edge.length) || branch.length == "none") { |
|
50 | 50 |
tree <- set_branch_length_cladogram(tree) |
51 | 51 |
} |
52 |
- |
|
52 |
+ brlen <- numeric(getNodeNum(tree)) |
|
53 |
+ brlen[tree$edge[,2]] <- tree$edge.length |
|
54 |
+ |
|
53 | 55 |
root <- getRoot(tree) |
54 | 56 |
## Convert Phylo tree to data.frame. |
55 | 57 |
## df <- as.data.frame.phylo_(tree) |
... | ... |
@@ -71,6 +73,9 @@ layoutEqualAngle <- function(model, branch.length ){ |
71 | 73 |
df[root, "end"] <- 2 # 360-degrees |
72 | 74 |
df[root, "angle"] <- 0 # Angle label. |
73 | 75 |
|
76 |
+ df$branch.length <- brlen[df$node] # for cladogram |
|
77 |
+ |
|
78 |
+ |
|
74 | 79 |
N <- getNodeNum(tree) |
75 | 80 |
|
76 | 81 |
## Get number of tips for each node in tree. |