使用ape::consensus
制作共识树时,分支长度会丢失。有没有办法不失去分支长度?或者在制作后以某种方式将它们添加到共识树中。
library(ape)
> cat("owls(((Strix_aluco:4.2,Asio_otus:4.1):4.1,Athene_noctua:7.3):6.3,Tyto_alba:13.5);", file = "ex1.tre", sep = "\n")
> cat("owls(((Strix_aluco:1.2,Asio_otus:4.5):3.1,Athene_noctua:7.3):6.3,Tyto_alba:13.5);", file = "ex2.tre", sep = "\n")
> cat("owls(((Strix_aluco:3.2,Asio_otus:4.7):8.1,Athene_noctua:7.3):6.3,Tyto_alba:13.5);", file = "ex3.tre", sep = "\n")
> tree1 <- read.tree("ex1.tre")
> tree2 <- read.tree("ex2.tre")
> tree3 <- read.tree("ex3.tre")
> trees <- c(tree1, tree2, tree3)
> trees_con <- consensus(trees)
> trees_con
Phylogenetic tree with 4 tips and 3 internal nodes.
Tip labels:
[1] "Strix_aluco" "Asio_otus" "Athene_noctua" "Tyto_alba"
Rooted; no branch lengths.