Nice solution. Just for reference, you don't need cat in the second command, perl will take the file from stdin or as an argument.
I am trying to visualize the tree using ete2 and figtree. But the programs don't seem to understand the bootstrap value given in RAxML_bipartitionsBranchLabels.test as branch_len[bootstrap value] : 0.44849636763673333961[20]
Could you tell me how can I visualize the trees with support values?
1 answer
Three quick solutions:
1. ETE comes with a command line script for quick tree visualization called 'ete2' that should be in your path. Try the --raxml option.
2. Convert raxml newick file into the the standard format using regular expressions. Something like this should work:
cat RAxML_bipartitionsBranchLabels.mytree
'(A:1, (B:1, (C, D):0.44849636763673333961[20]):0.44849636763673333961[20]);'
cat RAxML.bipartitions | perl -p -i -e 's/:(\d+\.\d+)\[(\d+)\]/$2:$1/g'
(A:1, (B:1, (C, D)20:0.44849636763673333961)20:0.44849636763673333961);
3. Latest versions of RAxML produce a newick file with the correct standard format. You should see something like RAxML_bipartitionsBranchLabels.mytree and RAxML_bipartitions.mytree. They are the same tree, and the former has the correct format
I tried this but I'm still having trouble with ete2. Here's the script I'm using:
from ete2 import Tree, faces, AttrFace, TreeStyle
t1=Tree('/home/kmkocot/Desktop/ete_test/RAxML_bipartitions.Best_425', format=0)
ancestor = t1.get_common_ancestor("PCAU","DMEL","DPUL")
t1.set_outgroup(ancestor)
print t1
print
print "Entoprocta"
print t1.check_monophyly(["NLAP", "GEBO"], "name", ignore_missing=False)
print t1.support
and here's the output I'm getting:
/-PCAU
/-|
| | /-SAME
| \-|
| | /-DPUL
| \-|
| \-DMEL
|
| /-SAGI
| |
| | /-SMAN
| /-| /-|
--| | | /-| \-TPIS
| | | | |
| | | | \-SMED
| | \-|
| | | /-BPLI
| | | /-|
| | \-| \-ARIC
| | |
| | \-GPAR
| |
| | /-BNER
| | |
\-| | /-LPEC
| | /-|
| | | \-LVIV
| | /-|
| | | | /-PCER
| | | \-|
| | /-| \-BGRA
| | | |
| | | | /-MEGA
| | | \-|
| | | \-MACR
| | |
| | | /-GPYR
| | | /-|
\-| | | \-NANO
| | /-|
| | | | /-HPSI
| | | \-|
| | /-| \-LCAL
| | | |
| | | | /-PVAN
| | | \-|
| | | \-PARC
| | |
| | | /-PPER
| | | /-|
| | | | \-MGRO
| | | /-|
| | | | | /-CMAR
| | /-| | | |
\-| | | | \-| /-LLON
| | | | | /-|
| | | | \-| \-LLAC
| | | /-| |
| | | | | \-LRUB
| | | | |
| | | | | /-CLIN
| | | | | /-|
| | | | | | \-CHON
| | | | \-|
| | | | | /-TPO1
| | \-| \-|
| | | \-TPO2
| | |
| | | /-PAGA
| | | |
| | | | /-PGOU
| | | | /-|
| | | | | \-CTOR
| | \-| /-|
| | | | | /-HROB
| | | | \-|
| | | /-| \-CTEL
| | | | |
\-| | | | /-BPRO
| \-| \-|
| | \-PLAM
| |
| | /-ASUC
| \-|
| \-GDIB
|
| /-LASE
| /-|
| /-| \-LRUG
| | |
| | \-ROLI
| /-|
| | | /-SCLE
| | | /-|
| | | | \-PCAL
| | \-|
| | | /-ACRA
| | \-|
| | | /-NCAR
| | \-|
| | \-MSCH
| |
| | /-LHYA
\-| /-|
| | | /-OVUL
| | \-|
| | | /-DGIG
| | \-|
| | | /-SESC
| | \-|
| | \-SLES
| |
| | /-SVEL
| | /-|
| | | \-ETEN
| | |
\-| /-| /-VLIE
| | | /-|
| | | | \-RPHI
| | \-|
| | | /-MEDU
| /-| \-|
| | | | /-CGIG
| | | \-|
| | | \-PFUC
| | |
| | \-NPER
| |
| | /-PPUL
\-| /-|
| | | /-LGIG
| | \-|
| /-| \-PVUL
| | |
| | | /-HRUF
| | \-|
| | | /-ACAL
\-| \-|
| | /-NLAP
| \-|
| \-CFOR
|
| /-GEBO
\-|
| /-ETET
\-|
\-GTOL
Entoprocta
(True, 'monophyletic')
Traceback (most recent call last):
File "ete2_script.py", line 11, in <module>
print t1.support("NLAP", "CFOR", "ACAL")
TypeError: 'float' object is not callable
Log in to answer this question.