in reply to how to output the final Tree into a file?

Based on http://www.bioperl.org/wiki/HOWTO:Trees#Reading_and_Writing_Trees, it seems you need something like:

open my $fh, '>', 'filename' or die $!; while ( my $tree = $treeout->next_tree ) { for my $node ( $tree->get_nodes ) { printf $fh "id: %s bootstrap: %s\n", $node->id || '', $node->b +ootstrap || '', "\n"; } } close $fh or die $!;

Hope this helps!


Edit: fix typo
The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^2: how to output the final Tree into a file?
by dimitris852 (Acolyte) on Mar 16, 2016 at 01:32 UTC

    hi!.i thinks this codes is just for nodes and bootstrap values.i cant use it to print the tree in newick form into a file.it just reads a file with newick form.