[Bioperl-l] Taxonomy->get_taxon() bug

Karsten Sieber karsten.sieber at gmail.com
Tue Jul 12 18:43:44 UTC 2016


I have experienced that Bio::DB::Taxonomy::entrez->get_taxon() dies when
pulling the taxon object for taxon ids corresponding to *some* of the top
level taxons (
http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Root&id=1&lvl=3&keep=1&srchmode=1&unlock).
Specifically, I have found that get_taxon() dies when querying taxon ids
corresponding to "cellular organisms" (131567), viroids (12884), viruses
(10239), unclassified (12908), and "other sequences" (28384). Below is code
demonstrating the error. I think this is a bug because get_taxon() should
always return a taxon object for a valid taxon id.

Best,
Karsten

## $db->get_taxon() working as intended:
perl -MBio::DB::Taxonomy -we
'$db=Bio::DB::Taxonomy->new(-source=>"entrez");
@taxonids=$db->get_taxonids("bacteria"); print join(" : ", @taxonids)."\n";
$taxon=$db->get_taxon(@taxonids); print "Pass:\t"; print
$taxon->scientific_name."\n";'
2
Pass: Bacteria

## $db->get_taxon() fails to pull the taxon object for viruses
perl -MBio::DB::Taxonomy -we
'$db=Bio::DB::Taxonomy->new(-source=>"entrez");
@taxonids=$db->get_taxonids("viruses"); print join(" : ", @taxonids)."\n";
$taxon=$db->get_taxon(@taxonids); print "Pass:\t"; print
$taxon->scientific_name."\n";'
10239
Can't call method "children" on an undefined value at
/Users/ksieber/perl5/lib/perl5/Bio/DB/Taxonomy/entrez.pm line 361.

## $db->get_taxon() fails with unclassified
perl -MBio::DB::Taxonomy -we
'$db=Bio::DB::Taxonomy->new(-source=>"entrez");
@taxonids=$db->get_taxonids("unclassified"); print join(" : ",
@taxonids)."\n"; $taxon=$db->get_taxon(@taxonids); print "Pass:\t"; print
$taxon->scientific_name."\n";'
12908
Can't call method "children" on an undefined value at
/Users/ksieber/perl5/lib/perl5/Bio/DB/Taxonomy/entrez.pm line 361

## fresh Bio::Perl install from the github repo 07.11.2016

perl -MBio::Perl -e 'print Bio::Perl->VERSION . "\n";'
1.006924
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/bioperl-l/attachments/20160712/0cb3df88/attachment.html>


More information about the Bioperl-l mailing list