[Bioperl-l] TreeIO problem with nexus format

Csaba Ortutay Csaba.Ortutay at uta.fi
Tue Aug 3 02:17:13 EDT 2004


I am working with phylogenetic trees, and I have the following problem.

I want to build a tree from scratch, and according to some posts on the list I 
made this code:

#!/usr/bin/perl -w
use strict;

use Bio::TreeIO;

my $nodeL = new Bio::Tree::Node();
my $nodeR = new Bio::Tree::Node();

my $node = new Bio::Tree::Node();

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


This is working nicely, but when I try to save the tree in nexus format, I got 
this message:

------------- EXCEPTION  -------------
MSG: Cannot call method write_tree on Bio::TreeIO object must use a subclass
STACK Bio::TreeIO::nexus::write_tree 
STACK toplevel ./makemaintree.pl:25

I am using bioperl 1.4.

Do you have any idea, what is wrong?

Csaba Ortutay PhD
University of Tampere
Institute of Medical Technology
Bioinformatics Group
Csaba.Ortutay at uta.fi

More information about the Bioperl-l mailing list