bioperl-live icon indicating copy to clipboard operation
bioperl-live copied to clipboard

Bio::TreeIO produces incorrect phyloXML after parsing Newick with boostrap values as internal node names

Open cmzmasek opened this issue 8 years ago • 1 comments

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);

t2.txt

cmzmasek avatar Jul 17 '17 22:07 cmzmasek

Likely tied somewhat to #234

cjfields avatar Dec 19 '17 20:12 cjfields