24 | 10 | 2017

DendroPy codes

If you are one of those systematists tranfering your bootstrap support values manually from a MP to a ML or a BI tree, sorry, but you've been losing a lot of time. Hopefully this page can help you with that. DendroPy does it in less than one second. 

First, you will need to install DendroPy, available online for free HERE. Installation is the most difficult part, especially if you are not familiar with this kind of packages. This is what you will need to do:

1. Install Python 2.7
2. Download the appropriate egg for setuptools (e.g. setuptools-0.6c11-py2.7.egg). It will depend on your OS system and the Python version you installed.
3. In terminal (if using Mac) or Command Prompt (if using Windows) navigate to the folder where the egg is and type "sh setuptools-0.6c11-py2.7.egg".
4. Install DendroPy from terminal with the command: 

sudo easy_install -U dendropy


Once DendroPy is installed, you can open the help page by typing in the Terminal/Command Prompt: sumtrees.py --help
Also, check this website for more information: http://packages.python.org/DendroPy/scripts/sumtrees.html


Examples:

I use different packages to run and edit my trees, but there are certain routines that I find useful in DendroPy. For instance, I get my final trees with MP / ML / BI supports on the branches in seconds. Here are some examples (remember to change the titles of the files so they match your tree files): 

How do I transfer the boostrap support values from a PAUP bootstrap tree to a Maximum Parsimony Strict Consensus tree? 

sumtrees.py -o MP.best.cons.SUM.tre -t MP.best.cons.tre --rooted -p -l -d0 -f0.50 Paup_MP_Boot10000.tre
Where:
MP.best.cons.SUM.tre: output tree
MP.best.cons.tre: topology used (in this case the MP Strict Consensus tree)
Paup_MP_Boot10000.tre: file containing 10,000 trees from where the bootstrap supports are going to be calculated.

How do I transfer the boostrap support values from a Maximum Likelihood bootstrap tree to the best Maximum Likelihood tree? 

sumtrees.py -o garli_run.best.SUM.tre -t garli_run.best.tre --rooted -p -l -d0 -f 0.50 allBootTrees-1.tre allBootTrees-2.tre allBootTrees-3.tre allBootTrees-4.tre allBootTrees-5.tre allBootTrees-6.tre allBootTrees-7.tre allBootTrees-8.tre allBootTrees-9.tre allBootTrees-10.tre
Where:
garli_run.best.SUM.tre: output tree
garli_run.best.tre: topology used (in this case the best Maximum Likelihood tree)
allBootTrees-1.tre to allBootTrees-10.tre: ten independent runs, each producing a file containing the bootstrap trees.

How do I add MP bootstrap supports on the best ML?

sumtrees.py -o garli_run.best.MP.tre -t garli_run.best.tre --rooted -p -l -d0 -f 0.50 Paup_MP_Boot10000.tre
Where:
garli_run.best.MP.tre: output tree
garli_run.best.tre: topology used (in this case the best Maximum Likelihood tree)
Paup_MP_Boot10000.tre: Paup_MP_Boot10000.tre: file containing 10,000 trees from where the bootstrap supports are going to be calculated.

How do I add ML bootstrap supports to an ML tree containing MP bootstrap supports (e.g. from previous step)?    

sumlabels.py -o garli_run.best.ML-MP.tre -t garli_run.best.SUM.tre --rooted --preserve-target-labels --separator="/" garli_run.best.MP.tre

How do I add BI posterior probabilities to an ML tree containing MP and ML bootstrap supports (e.g. from previous step)?

sumlabels.py -o garli_run.best.ML-MP-BI.tre -t garli_run.best.ML-MP.tre --rooted --preserve-target-labels --separator="/" BI_cons.tre

Comments
Share on Myspace

These are some of my codes and tips you might find useful:  GREP formulas  |  Dendropy.  Coming soon: R Codes  |  PAUP codes  |  Nexus for MrBayes  |  Garli codes  |  Python codes for GIS. 

Postdoctoral researcher | Botany | National Museum of Natural History | Smithsonian Institution
PO Box 37012, Washington DC 20013 | Phone: (202)633-0951 | Email: espeletias@gmail.com
Useful links
Interactive Digital Key for Espeletiinae

Access to the key HERE

key 160x112

 

Gallery of Espeletiinae

With 5000 pics, this is the World's largest collection of photographs of Espeletiinae (a.k.a. frailejones). Check it out HERE!

gallery

Recent recommended papers

Read this paper by Madriñán et al. (2013): Páramo is the world's fastest evolving and coolest biodiversity hotspot.

My latest publication

This is my latest paper (Diazgranados & Morillo, 2013): A new species of Coespeletia (Asteraceae, Millerieae) from Venezuela. Check it out!

Latest organized event

The first Symposium of Biogeography of Neotropical Plants in Colombia was a total success! (Diazgranados & Funk, 2013)