[Bioperl-l] creating a tree from scratch ?

Jason Stajich jason at cgt.duhs.duke.edu
Fri Jan 30 10:25:16 EST 2004


See t/Tree.t for test examples

my $tree = new Bio::Tree::Tree(-root => $node);
my $treeio = new Bio::TreeIO(-format => 'newick', -file => '>file.nh');
$treeio->write_tree($tree);

I have not bothered to write a pretty ASCII graphical output yet, tabtree
was a failed attempt at this.

Still don't have a good answer to your re-rooting question.  I've not had
a chance to play with example code to either show there is a problem or
show you how it can be done.

-jason

On Fri, 30 Jan 2004, Iain Wallace wrote:

> Hi,
> Does any one know how to write a tree that has been created in BioPerl?
> I just cann't seem to figure it out! I have the nodes that make up my
> tree, just not sure how to convert the nodes into a tree.
>
>
>     my $nodeA = new Bio::Tree::Node();
>     my $nodeL = new Bio::Tree::Node();
>     my $nodeR = new Bio::Tree::Node();
>
>     $nodeL->id("Left");
>     $nodeR->id("Right");
>     my $node = new Bio::Tree::Node();
>     $node->add_Descendent($nodeL);
>     $node->add_Descendent($nodeR);
>
> which I think should give a tree like     .....
> 					/	\
> 					Left	Right
>
> thanks for all your help
>
> Iain
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu


More information about the Bioperl-l mailing list