Hi Thomas.
I also have a new R package, Rphylip, which calls PHYLIP programs
(including consense) from within R. This package presently covers about
40% or so of PHYLIP programs. It is not yet on CRAN, and should be
considered "alpha" (i.e., it is incomplete & likely has bugs). Here is a
demo following Klaus's lead:
## after installing PHYLIP & Rphylip
library(Rphylip)
trees<-read.tree("example_trees.tre")
consensus<-Rconsense(trees)
## node labels as proportion of trees containing
## each clade
plot(consensus)
nodelabels(round(consensus$node.label,2))
## node labels as in consense
plot(consensus)
nodelabels(consensus$node.label*length(trees))
It is also possible, of course, to call the other consensus tree methods
implemented in consense.
Use of Rphylip requires that you first install PHYLIP, but if you
install it in a sensible place (e.g., /Applications for instance) it
will even search for the path to the executable for you.
You can get Rphylip here: http://www.phytools.org/Rphylip/ & it is also
on gitHub (http://github.com/liamrevell/Rphylip).
All the best, Liam
--
Liam J. Revell
web: http://faculty.umb.edu/liam.revell/
blog: http://blog.phytools.org
On 12/16/2013 11:41 AM, Thomas Manke wrote:
Dear Klaus & Emmanuel,
Thank you for your fast answers. Both work!
There still is a deviation at the level of the consensus tree from
Phylip, but my technical problem has been solved.
Best wishes,
Thomas
======================
# the script below uses the list of trees ("example_trees.tre") from
# http://evolution.genetics.washington.edu/phylip/doc/consense.html
tr=read.tree(file="example_trees.tre")
ct=consensus(tr,p=0.5)
sv=prop.clades(ct,tr)
# using phangorn
library(phangorn)
# adds support values as node.label
ct=plotBS(ct, tr)
plot(ct,show.node.label=TRUE, type="phylogram")
nodelabels(sv,frame="none", adj=c(-1,-1),col="red")
=========================
On 12/16/13 16:37, Emmanuel Paradis wrote:
Hi Thomas,
Have you tried prop.clades?
Best,
Emmanuel
-----Original Message-----
From: Thomas Manke <ma...@ie-freiburg.mpg.de>
Sender: r-sig-phylo-boun...@r-project.org
Date: Mon, 16 Dec 2013 11:52:33
To: <r-sig-phylo@r-project.org>
Subject: [R-sig-phylo] plotting support value
Dear Forum,
I have a list containing sampled trees for the same "taxa" and would
like to plot their consensus tree
with the support values (absolute numbers or frequencies) for the
various branches.
(as done by the Consense program of the Phylip suite)
I understand that boot.phylo() returns an object "bs" that contains such
information as bs$BP.
My scenario is similar, but the sampled trees are not based on sequence
information and boot.phylo()
is not applicable here.
I assume the support values can be obtained from prop.part(), but I
could not figure how.
Thank you for any help or suggestions,
Thomas
#tr is list of trees
ct<-consensus(tr, p=0.5) # majority consensus
pt<-prop.part(tr)
pc<-prop.part(ct)
# calculate support values
sv <- f(pc, pt) = ???
plot(ct); nodelabels(sv)
_______________________________________________
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 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/