Re: [R-sig-phylo] Collapsing branches with low bootstrap values
Thank you Klaus, this works like a charm. One more if I may: If I still want to have bootstrap values in my plot, how do I go about plotting those for my new tree? Kamila On Aug 22, 2013, at 12:12 PM, Klaus Schliep klaus.schl...@gmail.commailto:klaus.schl...@gmail.com wrote: Hi Kamila, try function pruneTree in phangorn. data(woodmouse) f - function(x) nj(dist.dna(x)) tr - f(woodmouse) X = boot.phylo(tr, woodmouse, f, trees = TRUE) tree = plotBS(tr, X$trees) tree2 = pruneTree(tree, 75) par(mfrow=c(2,1)) plot(tree, show.node=TRUE) plot(tree2, show.node=TRUE) Cheers, Klaus On Thu, Aug 22, 2013 at 5:09 PM, Naxerova, Kamila naxer...@fas.harvard.edumailto:naxer...@fas.harvard.edu wrote: Dear list, is there a function that will take a tree and the output of boot.phylo() and collapse branches below a chosen bootstrap value cutoff? Many thanks. Kamila ___ R-sig-phylo mailing list - R-sig-phylo@r-project.orgmailto:R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ -- Klaus Schliep Phylogenomics Lab at the University of Vigo, Spain http://darwin.uvigo.es/kschliep/ [[alternative HTML version deleted]] ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
Re: [R-sig-phylo] Collapsing branches with low bootstrap values
So sorry for the silly question, I overlooked your show.node=T. Many thanks. Kamila On Aug 22, 2013, at 12:29 PM, Naxerova, Kamila naxer...@fas.harvard.edu wrote: Thank you Klaus, this works like a charm. One more if I may: If I still want to have bootstrap values in my plot, how do I go about plotting those for my new tree? Kamila On Aug 22, 2013, at 12:12 PM, Klaus Schliep klaus.schl...@gmail.commailto:klaus.schl...@gmail.com wrote: Hi Kamila, try function pruneTree in phangorn. data(woodmouse) f - function(x) nj(dist.dna(x)) tr - f(woodmouse) X = boot.phylo(tr, woodmouse, f, trees = TRUE) tree = plotBS(tr, X$trees) tree2 = pruneTree(tree, 75) par(mfrow=c(2,1)) plot(tree, show.node=TRUE) plot(tree2, show.node=TRUE) Cheers, Klaus On Thu, Aug 22, 2013 at 5:09 PM, Naxerova, Kamila naxer...@fas.harvard.edumailto:naxer...@fas.harvard.edu wrote: Dear list, is there a function that will take a tree and the output of boot.phylo() and collapse branches below a chosen bootstrap value cutoff? Many thanks. Kamila ___ R-sig-phylo mailing list - R-sig-phylo@r-project.orgmailto:R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ -- Klaus Schliep Phylogenomics Lab at the University of Vigo, Spain http://darwin.uvigo.es/kschliep/ [[alternative HTML version deleted]] ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
Re: [R-sig-phylo] Rooting and rotating in ape
Sorry, forgot the most important part of R version [1] R version 2.15.3 (2013-03-01) On Aug 19, 2013, at 10:12 PM, Liam J. Revell liam.rev...@umb.edu wrote: Hi Kamila. 1) A tree stored in memory as an object of class phylo can have a root edge - but no root label. One option (if your tree has edge lengths) that approximates what it sounds like you want to do is to re-root the tree 0 distance below the tip that is your root. You can do this using the function reroot (which uses root internally) from the phytools package. E.g., to re-root the (random, in this case) tree 'tree' at the tip t10: library(phytools) tree-rtree(n=10) ## just for demonstration nn-which(tree$tip.label==t10) ## get node number of tip tt-reroot(tree,nn,tree$edge.length[which(tree$edge[,2]==nn)]) plotTree(tt) 2) To better help you with this, can you give us a reproducible error? (E.g., your tree, the code that produces the error, your version of R and ape.) All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools.org On 8/19/2013 9:51 PM, Naxerova, Kamila wrote: Dear list, I have just started playing around with ape, and I have some naive newbie questions. Any help would be very much appreciated. 1) In my data set, the root is extant. Is there a way to directly designate one of the taxa as the root? 2) When I use the rotate function on what I think is a fairly small and simple tree, R always freezes and I have to kill it and start over. Any ideas what I might be doing wrong? Many thanks in advance. Kamila ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
[R-sig-phylo] equal or not distance function for NJ
Dear list, I would like to construct a neighbor-joining tree from a data set in which each taxon is characterized by a vector of integers ranging from 0 to 5. I would like to treat these as unordered characters, i.e. assuming that the likelihood of transitioning from 0 to 1 is the same as transitioning from 0 to 5. For this, I would need some kind of equal or not distance function which increases the distance between two taxa by one for each dimension that differs, regardless of its magnitude. Is such a distance function already implemented anywhere or is it easiest to create one for myself? Many thanks. Kamila ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/