[Bioperl-l] newick to nexus
Shawn Hoon
shawnh at stanford.edu
Thu Nov 27 12:01:02 EST 2003
On Thursday, November 27, 2003, at 8:39AM, 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);
> }
>
I think you wanna do $treeout->write_tree($tree) but thats probably
just a typo.
>
> 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.
>
Jason added nexus 2 months ago so probably you don't have it.
Check that you have Bio/TreeIO/nexus.pm, if not do a cvs update or
download a newer bioperl package.
(I checked mine and I didn't have it)
cheers,
shawn
> 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.
> --
> Lewis Lukens
> Assistant Professor
> Department of Plant Agriculture
> Univ. of Guelph, Guelph, Ontario. N1G 2W1
>
> Tel: (519) 824- 4120 ext 52304
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
More information about the Bioperl-l
mailing list