[Bioperl-l] Problem with Bio::DB::Taxonomy

Chris Fields cjfields at illinois.edu
Fri Aug 19 10:05:03 EDT 2011


Anjan,

You are likely using an old version of BioPerl (this was fixed in the latest release on CPAN I believe).  Bio::DB::Taxonomy uses Bio::Taxon, so the use ofname() is incorrect; it is node_name(); if this is documented somewhere it is incorrect, so let us know where that came from.  

Also, the print statement at the end isn't interpolating correctly; in general with objects I make this more explicit:

  print $bacteria->id."\t".$bacteria->node_name."\n";

Correcting that, it works for me:

[cjfields at pyrimidine1 anjan]$ perl test.pl
2	Bacteria

chris

On Aug 15, 2011, at 9:32 AM, ANJAN PURKAYASTHA wrote:

> Hello,
> I wrote a short test script for the Bio::DB::Taxonomy module:
> ================================================
> #!/usr/bin/perl -w
> use strict;
> use Bio::DB::Taxonomy;
> 
> my ($nodesfile, $namesfile)= ('nodes.dmp', 'names.dmp');
> 
> my $db= new Bio::DB::Taxonomy(-source    => 'flatfile',
>                              -nodesfile => $nodesfile,
>                              -namesfile => $namesfile
>                              );
> 
> my $bacteria= $db->get_Taxonomy_Node(-taxonid => '2');
> print("$bacteria->id\t$bacteria->name\n");
> ================================================
> 
> On running this script I expect the following output: 2 Bacteria.
> 
> Instead I get a warning:
> UNIVERSAL->import is deprecated and will be removed in a future perl at
> /usr/share/perl5/vendor_perl/Bio/Tree/TreeFunctionsI.pm line 94.
> 
> and the following ouput:
> Bio::Taxon=HASH(0x158dbe0)->id    Bio::Taxon=HASH(0x158dbe0)->name
> 
> The script seems to be working but there seems to be a problem with
> dereferencing a Bio::Taxon object.
> 
> Any leads on how to troubleshoot this will be much appreciated.
> Thanks
> Anjan
> 
> 
> 
> -- 
> ===================================
> Anjan Purkayastha, PhD
> Senior Computational Biologist
> TessArae LLC
> 46090 Lake Center Plaza, Suite 304
> Potomac Falls, VA 20165**
> Office- 703.444.7188 ext. 116
> Mobile-703.740.6939
> ===================================
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list