Taxonomy->get_taxon() bug

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Taxonomy->get_taxon() bug

Karsten
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

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

Re: Taxonomy->get_taxon() bug

Fields, Christopher J
Yep, I can confirm this with the latest.  Can you file this as a bug?  I recall there is some munging of taxa in the classification but I don’t recall where to be honest.

https://github.com/bioperl/bioperl-live/issues

Thanks,

chris

On Jul 12, 2016, at 1:43 PM, Karsten Sieber <[hidden email]> wrote:

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
_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l


_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l