[Bioperl-l] root node branch length in newick treeswrittenincorrectly

Mark A. Jensen maj at fortinbras.us
Thu Apr 1 11:44:16 EDT 2010


Looks like there's no is_root; that should be easily remedied.
I think I'll take a harder look at _write_tree_Helper() overall,
just for fun; my gut feeling is there is some redundant redundancy
there. Will have to do it later on today tho. cheers MAJ
----- Original Message ----- 
From: "Dave Messina" <David.Messina at sbc.su.se>
To: "Mark A. Jensen" <maj at fortinbras.us>
Cc: "BioPerl List" <bioperl-l at lists.open-bio.org>
Sent: Thursday, April 01, 2010 10:32 AM
Subject: Re: [Bioperl-l] root node branch length in newick 
treeswrittenincorrectly


>
> On Apr 1, 2010, at 15:51, Mark A. Jensen wrote:
>
>> 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?
>
> Well, I'm not exactly sure. :) But in case that's true, that's why I left the 
> original code's if block as an elsif.
>
> elsif ( defined $id || defined $bs ) {
>                    $data[-1] .= defined $bs ? $bs : $id;
> }
>
> There should probably be an
>
> else {
> warn "We should never reach this branch, should we?"
> }
>
> following that elsif just in case. Except the lack of an else{} before, I'm 
> not positive that the code isn't relying on the fallthrough.
>
>
>> 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
>
> Yeah. Is there already a method to ask if a node is the root node?
>
> There's $tree->get_root_node() which is kinda close. But I think what we 
> really want is $node->is_root(). I didn't see that in Bio::Tree::NodeI.
>
> Does anyone know if that (or similar) exists?
>
>
> D
>
>
> _______________________________________________
> 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