Hello, biostars! I have some problems with miltyPhylo object manipulation and can't understand how to solve it.
I have many trees from MrBayes analysis and want to use it for comparative phylogenetics methods. Trees are ultrametric and UNrooted (also can't understand why, in MrBayes my outgroup sequence was the first in the matrix). Than I did following steps: 1) outgroup deletion (species from other group, which I don't want to include in analysis).
>lapply (ntrees [1], is.ultrametric)
$` TREE * gen.6720000`
[1] TRUE
>lapply (ntrees [1], is.rooted)
$` TREE * gen.6720000`
[1] TRUE
Than I looked at one of the trees, it was unrooted.
2) To root trees for the following analysis
>rtrees<-lapply (ntrees, root, "new outgroup")
> lapply (rtrees [1], is.rooted)
$` TREE * gen.6720000`
[1] FALSE
> lapply (rtrees [1], is.ultrametric)
$` TREE * gen.6720000`
[1] FALSE
I'm new in phylogenetic comparative methods and in R project. So I just can't find a mistake.
Thank you very much! I'm not sure, if 0-length branches are acceptable for further analysis. Anyway, your answer is very helpful, especially about brackets and "all (lapply...)".