Klaus and Everyone Else-

> here is a small function which it is very similar to David's 2nd script, but
> it is a bit more compact:
> library(phangorn) # requires the newest pangorn version >= 1.99-8
> addConfidences.phylo <- function(to, from){
>     conf = attr(addConfidences(as.splits(to), from), "confidences")
>     nTips = length(to$tip.label)
>     to$node.label = conf[-c(1:nTips)]
>     to
> }
> treeA <- addConfidences.phylo(treeA, treeB)

Ah yes, that works quite well. Thanks!

> And some comments on possible problems / features of the 2nd script:
> The function assumes that the ordering of the tip labels is identical with
> the effect
>
> "t3" "t4"
>
> is different to
>
> "t4" "t3"
>
> A lapply(splitsA, sort) and lapply(splitsB, sort) should do the trick.

Ah, thanks, Klaus, you're right. I did implicitly assume that the
tip.labels are identically ordered in the rerooted tree. (...Whoops!)

> Now the feature:
> let assume there a 5 taxa  "t1" "t2" "t3" "t4" "t5"
> A clade containing "t1" "t2"
> will be different from "t3" "t4" "t5".
> If you want just to reroot a tree, you probably do not want to distinguish
> clades but only splits.

I'm not quite certain I follow what you mean here, as I certainly had
intended to obtain splits with my implementation using prop.part,
which was why I selected the group that contained the index taxon
(which I ignorantly assumed would be listed first in $tip.label for
both trees).

Cheers,
-Dave

-- 
David W. Bapst, PhD
Adjunct Asst. Professor, Geology and Geol. Eng.
South Dakota School of Mines and Technology
501 E. St. Joseph
Rapid City, SD 57701

http://webpages.sdsmt.edu/~dbapst/
http://cran.r-project.org/web/packages/paleotree/index.html

_______________________________________________
R-sig-phylo mailing list - [email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/[email protected]/

Reply via email to