Dan Rabosky <dl...@cornell.edu> a écrit :
Howdy - Does anyone have functional code that allows grafting of phylogenetic trees? Ideally, I'd like to take two trees X (the recipient)and Y, and: (1) specify a target terminal or internal node for grafting Y (call it node Z...) (2) Drop all descendants of node Z (if it is internal) from tree X
At this stage, I guess you are using drop.tip(): have you tried with the option subtree=TRUE, so that Z becomes a tip? Then you can graft to this new tip...
Emmanuel
(3) swap in the root node of tree Y for node Z, and (4) use this to graft the remainder of Y into X. Ideally, the graft location could be specified with considerable precision, changing the length of the branch between the root of Y and the parent node in X as necessary, but this is not strictly necessary. I am having difficulty getting bind.tree from ape to work for internal nodes as desired (though it appears to work fine for grafting to root node and to tips), but haven't looked carefully yet at why it seems to be failing. Thanks! ~Dan Dan Rabosky Department of Ecology and Evolutionary Biology & Fuller Evolutionary Biology Program Cornell Lab of Ornithology Cornell University Ithaca, NY 14853-2701 DLR32Xcornell.edu (X = @) ph 607 592 4636 fax 607 255 8088 new website: http://www.eeb.cornell.edu/Rabosky/dan/main.html [[alternative HTML version deleted]] _______________________________________________ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
_______________________________________________ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo