How to convert phylip tree format in text format to png image with perl.
1
2
Entering edit mode
10.0 years ago
Naren ▴ 1000
((raccoon:19.19959,bear:6.80041):0.84600,((sea_lion:11.99700, seal:12.00300):7.52973,((monkey:100.85930,cat:47.14069):20.59201, weasel:18.87953):2.09460):3.87382,dog:25.46154);

Suppose this is my tree. I want to convert it to png image.

I tried Bio::Tree::Tree module but it writes wrong nodes in svg file.

code:

use Bio::TreeIO;
use SVG::Graph;

my $in = new Bio::TreeIO(-file => 'DATA',
                         -format => 'newick');

my $out = new Bio::TreeIO(-file => '>mytree.svg',
                            -format => 'svggraph');
while(  $tree = $in->next_tree ) {
    $out->write_tree($tree);
}

system(convert mytree.svg svg2.png);
phylip phylogeny • 3.7k views
ADD COMMENT
0
Entering edit mode

I tried Bio::Tree::Tree module but it writes wrong nodes in svg file.

Show us the code please.

ADD REPLY
0
Entering edit mode

@pierre I added my code.

ADD REPLY
0
Entering edit mode
10.0 years ago

The old TreeFam API has some code to draw a tree image in PNG format from a NH/NHX representation.

ADD COMMENT

Login before adding your answer.

Traffic: 1569 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6