comment out overzealous error checking, which caused some EMBL files to not parse...
[bioperl-live.git] / Bio / Tools / EUtilities / HistoryI.pm
blobf8d7d43103591ea0b21645b54741b33716d60b01
2 # BioPerl module for Bio::Tools::EUtilities::HistoryI
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Chris Fields
8 # Copyright Chris Fields
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
14 # Part of the EUtilities BioPerl package
16 =head1 NAME
18 Bio::Tools::EUtilities::HistoryI - simple extension of EUtilDataI interface
19 class for classes which hold NCBI server history data
21 =head1 SYNOPSIS
23 #should work for any class which is-a HistoryI
25 if ($obj->has_History) {
26 # do something here
29 ($webenv, $querykey) = $obj->history;
31 $obj->history($webenv, $querykey);
33 $webenv = $obj->get_webenv;
35 $query_key = $obj->get_query_key;
37 =head1 DESCRIPTION
39 This class extends methods for any EUtilDataI implementation allow instances to
40 dealwith NCBI history data (WebEnv and query_key). These can be used as
41 parameters for further queries against data sets stored on the NCBI server, much
42 like NCBI's Entrez search history. These are important when one wants to run
43 complex queries using esearch, retrieve related data using elink, and retrieve
44 large datasets using epost/efetch.
46 The simplest implementation is Bio::Tools::EUtilities::History, which holds the
47 history data for epost. See also Bio::Tools::EUtilities::Query (esearch) and
48 Bio::Tools::EUtilities::LinkSet (elink), which also implement HistoryI.
50 =cut
52 =head1 FEEDBACK
54 =head2 Mailing Lists
56 User feedback is an integral part of the evolution of this and other Bioperl
57 modules. Send your comments and suggestions preferably to one of the Bioperl
58 mailing lists. Your participation is much appreciated.
60 bioperl-l@lists.open-bio.org - General discussion
61 http://www.bioperl.org/wiki/Mailing_lists - About the mailing lists
63 =head2 Support
65 Please direct usage questions or support issues to the mailing list:
67 I<bioperl-l@bioperl.org>
69 rather than to the module maintainer directly. Many experienced and
70 reponsive experts will be able look at the problem and quickly
71 address it. Please include a thorough description of the problem
72 with code and data examples if at all possible.
74 =head2 Reporting Bugs
76 Report bugs to the Bioperl bug tracking system to help us keep track the bugs
77 and their resolution. Bug reports can be submitted via the web.
79 https://redmine.open-bio.org/projects/bioperl/
81 =head1 AUTHOR
83 Email cjfields at bioperl dot org
85 =head1 APPENDIX
87 The rest of the documentation details each of the object methods. Internal
88 methods are usually preceded with a _
90 =cut
92 # Let the code begin...
94 package Bio::Tools::EUtilities::HistoryI;
95 use strict;
96 use warnings;
98 use base qw(Bio::Tools::EUtilities::EUtilDataI);
100 =head2 history
102 Title : history
103 Usage : my ($webenv, $qk) = $hist->history
104 Function : Get/Set two-element list of webenv() and query_key()
105 Returns : array
106 Args : two-element list of webenv, querykey
108 =cut
110 sub history {
111 my $self = shift;
112 $self->parse_data if ($self->can('parse_data') && !$self->data_parsed);
113 if (@_) {
114 my ($webenv, $querykey) = (shift, shift);
115 $self->throw("Missing part of cookie!") if (!$webenv || !$querykey);
116 ($self->{'_webenv'}, $self->{'_querykey'}) = ($webenv, $querykey);
118 return ($self->get_webenv, $self->get_query_key);
121 =head2 get_webenv
123 Title : get_webenv
124 Usage : my $webenv = $hist->get_webenv
125 Function : returns web environment key needed to retrieve results from
126 NCBI server
127 Returns : string (encoded key)
128 Args : none
130 =cut
132 sub get_webenv {
133 my $self = shift;
134 $self->parse_data if ($self->can('parse_data') && !$self->data_parsed);
135 return $self->{'_webenv'};
138 =head2 get_query_key
140 Title : get_query_key
141 Usage : my $qk = $hist->get_query_key
142 Function : returns query key (integer) for the history number for this session
143 Returns : integer
144 Args : none
146 =cut
148 sub get_query_key {
149 my $self = shift;
150 $self->parse_data if ($self->can('parse_data') && !$self->data_parsed);
151 return $self->{'_querykey'};
155 __END__