bioperl-live
bioperl-live copied to clipboard
Bio::TreeIO produces incorrect phyloXML after parsing Newick with boostrap values as internal node names
Besides issue #234 , there is another problem with Bio::TreeIO. When parsing a Newick formatted file in which the internal node names are bootstrap support values, and the attempting to write the resulting tree object to phyloXML, the resulting "phyloXML" is quite "wrong". For once it has unexpected "property" elements, which contain the support values.
The test script: use Bio::TreeIO;
$infile = "t2.txt";
my $treeio = Bio::TreeIO->new(-format => 'newick', -file => $infile, -internal_node_id => 'bootstrap');
my $tree = $treeio->next_tree;
for my $node ( $tree->get_nodes ) { printf "id: %s branchlength: %s bootstrap: %s\n", $node->id || '', $node->branch_length || '', $node->bootstrap || '', "\n"; }
my $outfile = "outfile.xml"; my $newio = Bio::TreeIO->new (-format => 'phyloxml', -file=>">$outfile"); $newio->write_tree($tree);
Likely tied somewhat to #234