[Bioperl-l] NCBI efetch: request limits and getting dates fast
Dave Messina
David.Messina at sbc.su.se
Tue Apr 20 21:48:41 UTC 2010
Great, thanks Chris, I'll try it that way.
Dave
On Apr 20, 2010, at 8:57 PM, Chris Fields wrote:
> Not sure about the upper limit with SOAP, but simple ol' EUtilities can take ~250-500 IDs (somewhere in that range) with a direct efetch/esummary/elink, and many many more if you use epost first. I have been able to fetch a couple thousand with epost.
>
> As an example, this code works for me:
>
> use Modern::Perl;
> use Bio::DB::EUtilities;
>
> my $eutil = Bio::DB::EUtilities->new(-eutil => 'esearch',
> -db => 'protein',
> -email => 'cjfields at bioperl.org',
> -term => 'pyrR',
> -retmax => 250,
> -usehistory => 'y');
>
> my $hist = $eutil->next_History || die "No history returned";
>
> $eutil->set_parameters(-eutil => 'esummary',
> -history => $hist);
>
> my %id_map;
>
> while (my $ds = $eutil->next_DocSum) {
> my ($cdate) = $ds->get_contents_by_name('CreateDate');
> $id_map{$ds->get_id} = $cdate;
> }
>
> say join("\t", $_, $id_map{$_}) for sort keys %id_map;
More information about the Bioperl-l
mailing list