[Bioperl-l] Problem with EUtilities

Chris Fields cjfields at uiuc.edu
Mon Oct 22 18:16:19 UTC 2007


On Oct 22, 2007, at 12:53 PM, Warren Gallin wrote:

> I've encountered a problem with retrieving a set of records using
> efetch.
>
> Code snippet:
>
>      my $gpeptfactory = Bio::DB::EUtilities->new(
>          -eutil   => 'efetch',
>          -db      => 'protein',
>          -rettype => 'genbank',
>          -id      => \@ginumber_search
>      );
>      $file = 'temp_hold.gb';
>
>      $gpeptfactory->get_Response( -file => $file );
>
>
>
> If the array of gi numbers that I submit is large (482 elements does
> not give the problem but 1517 does) I am getting an error at the
> get_response step:
>
> ------------- EXCEPTION: Bio::Root::Exception -------------
> MSG: Response Error
> Request-URI Too Large
> STACK: Error::throw
> STACK: Bio::Root::Root::throw /Library/Perl/5.8.1/Bio/Root/Root.pm:357
> STACK: Bio::DB::GenericWebAgent::get_Response /Library/Perl/5.8.1/Bio/
> DB/GenericWebAgent.pm:184
> STACK: Stable_gb_update.pl:144
> -----------------------------------------------------------
>
>
> Am I correct in thinking that the individual array elements are being
> submitted as part of the URI, and therefore a large array is
> exceeding the acceptable size limit for a URI?

Yes.

> If so, is there a workaround?  Breaking the large request into a set
> of smaller requests?
> Or is there a way of submitting a file of gi numbers using
> EUtilities, rather than an array?
>
> Warren Gallin

You can use epost and post your IDs first, then retrieve them.   
Alternatively, you can fetch them in small batches.  The following  
two code bits should help:

http://www.bioperl.org/wiki/ 
HOWTO:EUtilities_Cookbook#How_do_I_post_a_specific_list_of_UIDs_to_NCBI. 
27s_history_server.3F

http://www.bioperl.org/wiki/ 
HOWTO:EUtilities_Cookbook#How_do_I_retrieve_a_long_list_of_sequences_usi 
ng_a_query.3F

chris



More information about the Bioperl-l mailing list