[Bioperl-l] newick to nexus

Jason Stajich jason at cgt.duhs.duke.edu
Thu Nov 27 12:03:04 EST 2003


The TreeIO::nexus parser is not in bioperl 1.2.x but only in bioperl 1.3.x
so you'd need to get the latest code from the dev releases to achieve
this.

However, all that said I don't think I implemented nexus tree writing,
just nexus tree parsing at this time.  Will be able to check this weekend
I expect.

-jason
On Thu, 27 Nov 2003, Lewis Lukens wrote:

> Hi,
>
> I am trying to convert tree files from newick to nexus format.  It
> seems that one can do this (using the example script from
> bio::factory::treefactoryI) but I have been unable to.
>
> My the code is:
>
> #!/usr/bin/perl
> use Bio::TreeIO;
> my $treeio= new Bio::TreeIO ('-format'=> 'newick', '-file'=>'bpoistree');
> my $treeout= new Bio::TreeIO ('-format'=> 'nexus', '-file'=>'>outfile');
>
> while(my $tree = $treeio->next_tree) {
>        $treeout->write_tree($treeout);
> }
>
>
> The newick tree is fine, but the "nexus" module is missing, and I get
> the following error:
>
> Bio::TreeIO: nexus cannot be found
> Exception
> ------------- EXCEPTION  -------------
> MSG: Failed to load module Bio::TreeIO::nexus. Can't locate
> Bio/TreeIO/nexus.pm in @INC (@INC contains:
> /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin
> /Library/Perl /Library/Perl /Network/Library/Perl/darwin
> /Network/Library/Perl /Network/Library/Perl .) at
> /Library/Perl/Bio/Root/Root.pm line 407.
>
> STACK Bio::Root::Root::_load_module /Library/Perl/Bio/Root/Root.pm:409
> STACK (eval) /Library/Perl/Bio/TreeIO.pm:221
> STACK Bio::TreeIO::_load_format_module /Library/Perl/Bio/TreeIO.pm:220
> STACK Bio::TreeIO::new /Library/Perl/Bio/TreeIO.pm:121
> STACK toplevel treeswitch.pl:4
>
> Is there another way to do this in bioperl?
>
> Thanks much,
> Lewis
>
> P.S. Please respond to the address above, as I am not a subscriber to
> the mailing list.
>

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


More information about the Bioperl-l mailing list