3 # BioPerl module for Bio::Tools::EUtilities::Cookie
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::Tools::EUtilities::Cookie - lightweight implementation of HistoryI
18 interface (not bound to filehandles, extraneous methods, etc).
22 #should work for any class which is-a HistoryI
24 if ($obj->has_History) {
28 ($webenv, $querykey) = $obj->history;
30 $obj->history($webenv, $querykey);
32 $webenv = $obj->get_webenv;
34 $query_key = $obj->get_query_key;
38 This class extends methods for any EUtilDataI implementation allow instances to
39 dealwith NCBI history data (WebEnv and query_key). These can be used as
40 parameters for further queries against data sets stored on the NCBI server, much
41 like NCBI's Entrez search history. These are important when one wants to run
42 complex queries using esearch, retrieve related data using elink, and retrieve
43 large datasets using epost/efetch.
45 This class is the simplest implementation and merely holds data for future
46 queries from any HistoryI. See also Bio::Tools::EUtilities::Query (esearch) and
47 Bio::Tools::EUtilities::LinkSet (elink), which also implement HistoryI.
55 User feedback is an integral part of the evolution of this and other Bioperl
56 modules. Send your comments and suggestions preferably to one of the Bioperl
57 mailing lists. Your participation is much appreciated.
59 bioperl-l@lists.open-bio.org - General discussion
60 http://www.bioperl.org/wiki/Mailing_lists - About the mailing lists
64 Report bugs to the Bioperl bug tracking system to help us keep track the bugs
65 and their resolution. Bug reports can be submitted via the web.
67 http://bugzilla.open-bio.org/
71 Email cjfields at uiuc dot edu
75 The rest of the documentation details each of the object methods. Internal
76 methods are usually preceded with a _
80 # Let the code begin...
82 package Bio
::Tools
::EUtilities
::History
;
86 use base
qw(Bio::Root::Root Bio::Tools::EUtilities::HistoryI);
90 my ($class, @args) = @_;
91 my $self = $class->SUPER::new
(@args);
92 my ($eutil) = $self->_rearrange([qw(eutil)],@args);
93 $eutil || $self->throw('eutil not defined');
95 $self->datatype('cookie');
102 Usage : my ($webenv, $qk) = $hist->history
103 Function : Get/Set two-element list of webenv() and query_key()
105 Args : two-element list of webenv, query key
112 Usage : my $webenv = $hist->get_webenv
113 Function : returns web environment key needed to retrieve results from
115 Returns : string (encoded key)
122 Title : get_query_key
123 Usage : my $qk = $hist->get_query_key
124 Function : returns query key (integer) for the history number for this session
131 my ($self, $simple) = @_;
132 if (!exists $simple->{WebEnv
} || !exists $simple->{QueryKey
}) {
133 $self->debug("Data:",Dumper
($simple));
134 $self->throw("Missing webenv/query key in history output");
136 $self->{_webenv
} = $simple->{WebEnv
} && delete $simple->{WebEnv
};
137 $self->{_querykey
} = $simple->{QueryKey
} && delete $simple->{QueryKey
};