[Bioperl-l] root node branch length in newick trees writtenincorrectly

Mark A. Jensen maj at fortinbras.us
Thu Apr 1 13:51:18 UTC 2010


Hi Dave,
The spot in the code you're dealing with looks a little kludgy-- the branch 
length must fall through to $id when the node in the data file has branch length 
but no explicit id (like a root node), is that right? Maybe it's more robust to 
to do a check whether a 'putative id' is actually a float, and shunt it into a 
branch length variable in that case. (course, maybe ids like "103748923.192934", 
which would make that bork)... hmm
MAJ
----- Original Message ----- 
From: "Dave Messina" <David.Messina at sbc.su.se>
To: "BioPerl List" <bioperl-l at lists.open-bio.org>
Sent: Thursday, April 01, 2010 8:41 AM
Subject: [Bioperl-l] root node branch length in newick trees writtenincorrectly


Hi everyone,

It seems that TreeIO::newick might not be properly writing root nodes which have 
a branch length — it omits the colon.

e.g.

If you read in

(a:1,b:2):0.0;

It will be written out as

(a:1,b:2)0.0;


And in the latter case, 0.0 now looks like a node id, causing strict 
interpreters of newick (like PAML) to complain.

Crazy for the root to have a branch length, you say? Apparently it's a matter of 
taste — RAxML and TreeAlign do it, and according to the newick spec it's legit.*

I just filed a bug report (http://bugzilla.open-bio.org/show_bug.cgi?id=3039) 
with a patch and a test.

But I'm not sure I understand the code that well,though; could another dev or 
two take a look before I commit?


Thanks,
Dave




* See the example at the bottom of 
http://evolution.genetics.washington.edu/phylip/newick_doc.html


_______________________________________________
Bioperl-l mailing list
Bioperl-l at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/bioperl-l





More information about the Bioperl-l mailing list