1
# $Id: epost.pm,v 1.7.4.3 2006/11/10 16:48:09 cjfields Exp $
3
# BioPerl module for Bio::DB::EUtilities::epost
5
# Cared for by Chris Fields
7
# Copyright Chris Fields
9
# You may distribute this module under the same terms as perl itself
11
# POD documentation - main docs before the code
13
# Part of the EUtilities BioPerl package
17
Bio::DB::EUtilities::epost - posting IDs on the remote NCBI server for batch
18
retrieval and chained queries
22
my $epost = Bio::DB::EUtilities->new(
32
B<WARNING>: Please do B<NOT> spam the Entrez web server with multiple requests.
34
The EUtility EPost is used to post a list of primary IDs to the NCBI EUtilities
35
server for retrieval by L<EFetch|Bio::DB::EUtilities::efetch> or for using in
36
futher searches using L<ELink|Bio::DB::EUtilities::elink> or
37
L<ESearch|Bio::DB::EUtilities::esearch>. The data is posted using:
41
When not used in void context, this will also return a
42
L<HTTP::Response|HTTP::Response> object for further processing. This is not
43
necessary, as any posts made will automatically generate a
44
L<Cookie|Bio::DB::EUtilities::Cookie>,
45
which can be used to retrieve the posted information using
46
L<EFetch|Bio::DB::EUtilities::efetch>.
48
Using EPost is recommended for retrieving large lists of primary IDs and is
49
capable, when used repeatedly and in combination with EFetch, of retrieving
50
thousands of database entries.
54
The following are a general list of parameters that can be used to take
55
advantage of EPost. Up-to-date help for EPost is available at this URL
56
(the information below is a summary of the options found there):
58
http://eutils.ncbi.nlm.nih.gov/entrez/query/static/epost_help.html
64
The name of an Entrez database available through EUtilities.
68
a list of primary ID's
70
Below are a list of IDs which can be used with EPost:
72
B<PMID> (pubmed), B<MEDLINE UI> (NIH MedLine), B<MIM number> (omim),
73
B<GI number> (nucleotide, protein), B<MMDB-ID> (structure), B<TAXID> (taxonomy)
81
User feedback is an integral part of the
82
evolution of this and other Bioperl modules. Send
83
your comments and suggestions preferably to one
84
of the Bioperl mailing lists. Your participation
87
bioperl-l@lists.open-bio.org - General discussion
88
http://www.bioperl.org/wiki/Mailing_lists - About the mailing lists
92
Report bugs to the Bioperl bug tracking system to
93
help us keep track the bugs and their resolution.
94
Bug reports can be submitted via the web.
96
http://bugzilla.open-bio.org/
100
Email cjfields at uiuc dot edu
104
The rest of the documentation details each of the
105
object methods. Internal methods are usually
110
# Let the code begin...
112
package Bio::DB::EUtilities::epost;
115
use Bio::DB::EUtilities::Cookie;
119
use base qw(Bio::DB::EUtilities);
121
our $EUTIL = 'epost';
122
our $RETMODE = 'xml';
125
my ($self, @args) = @_;
126
$self->SUPER::_initialize(@args);
128
$self->_eutil($EUTIL);
129
$self->retmode($RETMODE);
132
=head2 parse_response
134
Title : parse_response
135
Usage : $db->_parse_response($content)
136
Function: parse out response for cookie
139
Throws : 'unparseable output exception'
145
my $response = shift if @_;
146
if (!$response || !($response->isa("HTTP::Response"))) {
147
$self->throw("Need HTTP::Response object");
149
my $xs = XML::Simple->new();
150
my $simple = $xs->XMLin($response->content);
151
#$self->debug("Response dumper:\n".Dumper($simple));
153
if ($simple->{ERROR}) {
154
$self->throw("NCBI epost nonrecoverable error: ".$simple->{ERROR});
156
if ($simple->{InvalidIdList}) {
157
$self->warn("NCBI epost error: Invalid ID List".$simple->{InvalidIdList});
160
my $webenv = $simple->{WebEnv};
161
my $querykey = $simple->{QueryKey};
162
my $cookie = Bio::DB::EUtilities::Cookie->new(-webenv => $webenv,
163
-querykey => $querykey,
167
$self->add_cookie($cookie);
b'\\ No newline at end of file'