reading in multiple trees

161 views
Skip to first unread message

August Guang

unread,
Feb 13, 2017, 4:53:38 PM2/13/17
to The ETE toolkit
Hi,

I have files with bootstrap tree samples from RAxML. I want to be able to read in the bootstrap file into ete3 and then compute RF distances between the bootstrap tree samples. The Tree function seems to only be able to read in 1 tree/file; is there a way to read in a file with multiple trees?

Jaime Huerta Cepas

unread,
Feb 13, 2017, 5:54:50 PM2/13/17
to eteto...@googlegroups.com
Hi August, 
yes - if each bootstrapped tree is in one line, something like this should work:

from ete3 import Tree
tree_collection = []
for newick in open("Raxml.bootstrap_file"):
  tree_collection.append(Tree(newick))

Then you could compute RF among all trees loaded in the tree collection list as necessary. 

HTH
-jaime

On 13 February 2017 at 21:38, August Guang <august...@brown.edu> wrote:
Hi,

I have files with bootstrap tree samples from RAxML. I want to be able to read in the bootstrap file into ete3 and then compute RF distances between the bootstrap tree samples. The Tree function seems to only be able to read in 1 tree/file; is there a way to read in a file with multiple trees?

--
You received this message because you are subscribed to the Google Groups "The ETE toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to etetoolkit+unsubscribe@googlegroups.com.
To post to this group, send email to eteto...@googlegroups.com.
Visit this group at https://groups.google.com/group/etetoolkit.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages