pcantalupo / annotater

Annotate sequences by BLAST using NCBI taxonomy information
MIT License
6 stars 0 forks source link

EXCEPTION: Bio::Root::Exception MSG: Response Error Too Many Requests #11

Open pcantalupo opened 3 years ago

pcantalupo commented 3 years ago

When testing the Taxonomy.pm module using Taxonomy.t, recently been getting alot of errors like below (stemming from gi2taxid and taxid2lineage methods). I thought the Bioperl module has a built in delay so that it doesn't send too many requests.

------------- EXCEPTION: Bio::Root::Exception -------------
MSG: Response Error
Too Many Requests
STACK: Error::throw
STACK: Bio::Root::Root::throw /ihome/uchandran/pgc92/local/lib/bioperl/bioperl-live/lib/Bio/Root/Root.pm:449
STACK: Bio::DB::GenericWebAgent::get_Response /ihome/uchandran/pgc92/local/lib/bioperl/bioperl-live/lib/Bio/DB/GenericWebAgent.pm:215
STACK: Bio::DB::EUtilities::get_Response /ihome/uchandran/pgc92/local/lib/bioperl/Bio-EUtilities/lib/Bio/DB/EUtilities.pm:204
STACK: Bio::DB::EUtilities::get_Parser /ihome/uchandran/pgc92/local/lib/bioperl/Bio-EUtilities/lib/Bio/DB/EUtilities.pm:287
STACK: Bio::DB::EUtilities::next_DocSum /ihome/uchandran/pgc92/local/lib/bioperl/Bio-EUtilities/lib/Bio/DB/EUtilities.pm:856
STACK: Taxonomy::gi2taxid /ihome/uchandran/pgc92/local/lib/annotater/Taxonomy.pm:232

and

------------- EXCEPTION: Bio::Root::Exception -------------
MSG: Response Error
Too Many Requests
STACK: Error::throw
STACK: Bio::Root::Root::throw /ihome/uchandran/pgc92/local/lib/bioperl/bioperl-live/lib/Bio/Root/Root.pm:449
STACK: Bio::DB::GenericWebAgent::get_Response /ihome/uchandran/pgc92/local/lib/bioperl/bioperl-live/lib/Bio/DB/GenericWebAgent.pm:215
STACK: Bio::DB::EUtilities::get_Response /ihome/uchandran/pgc92/local/lib/bioperl/Bio-EUtilities/lib/Bio/DB/EUtilities.pm:204
STACK: Taxonomy::taxid2lineage /ihome/uchandran/pgc92/local/lib/annotater/Taxonomy.pm:276
pcantalupo commented 3 years ago

Here is the respone from NLM Support case #CAS-630050-S2L8Q7: RE: too many requests error using eutilities TRACKING:000349000000978 (Nov 9 2020)

Dear Colleague, Bioperl is crowd sourced and not review/approved/maintained by NCBI, so I cannot explicitly answer this. It is possible the built in waits are set for 101 milliseconds, assuming the user has an API key, which would fail if you do not supply an API key, as the rate drops to three requests per second rather than ten when you have an API key.

So, I would not make the above assumption, and simply institute your own wait statements using standard Perl methods within your loops. If you have questions about the built in timer to Bioperl, I would post a comment to the github site, rather than writing to the help desk.