[BioRuby] BioRuby: newick parser

Naohisa GOTO ngoto at gen-info.osaka-u.ac.jp
Tue Mar 13 14:37:27 UTC 2012


Hi Pjotr,

On Mon, 12 Mar 2012 21:11:59 +0100
Pjotr Prins <pjotr.public14 at thebird.nl> wrote:

> Bio::Tree::distance(node1,node2)'s calculating the path distance is
> pretty cool :)
> 
> http://bioruby.open-bio.org/rdoc/Bio/Pathway.html#method-i-breadth_first_search
> 
>   seq7.parent.should == root
>   seq4 = tree.find("seq4")
>   seq4.distance(seq7).should == 19.387756600000003 

This is a problem of floating point numbers.
Calculating sum of floating point numbers frequently causes
accumulation of errors and/or loss of significant digits.

-- 
Naohisa Goto
ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org



More information about the BioRuby mailing list