.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Bio::Tools::EUtilities::EUtilParameters 3pm" .TH Bio::Tools::EUtilities::EUtilParameters 3pm "2020-03-13" "perl v5.30.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::Tools::EUtilities::EUtilParameters \- Manipulation of NCBI eutil\-based parameters for remote database requests. .SH "VERSION" .IX Header "VERSION" version 1.77 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& # Bio::Tools::EUtilities::EUtilParameters implements Bio::ParameterBaseI \& \& my @params = (\-eutil => \*(Aqefetch\*(Aq, \& db => \*(Aqnucleotide\*(Aq, \& id => \e@ids, \& api_key => \*(AqmYApiKeyFrOMNCBI\*(Aq, \& email => \*(Aqme@foo.bar\*(Aq, \& retmode => \*(Aqxml\*(Aq); \& \& my $p = Bio::Tools::EUtilities::EUtilParameters\->new(@params); \& \& if ($p\->parameters_changed) { \& # ... \& } # state information \& \& $p\->set_parameters(@extra_params); # set new NCBI parameters, leaves others preset \& \& $p\->reset_parameters(@new_params); # reset NCBI parameters to original state \& \& $p\->to_string(); # get a URI\-encoded string representation of the URL address \& \& $p\->to_request(); # get an HTTP::Request object (to pass on to LWP::UserAgent) .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Bio::Tools::EUtilities::EUtilParameters is-a Bio::ParameterBaseI implementation that allows simple manipulation of \s-1NCBI\s0 eutil parameters for CGI-based queries. SOAP-based methods may be added in the future. .PP For simplicity parameters do not require dashes when passed and do not need \s-1URI\s0 encoding (spaces are converted to '+', symbols encoded, etc). Also, the following extra parameters can be passed to the \fBnew()\fR constructor or via \&\fBset_parameters()\fR or \fBreset_parameters()\fR: .PP .Vb 3 \& eutil \- the eutil to be used. The default is \*(Aqefetch\*(Aq if not set. \& correspondence \- Flag for how IDs are treated. Default is undef (none). \& history \- a Bio::Tools::EUtilities::HistoryI object. Default is undef (none). .Ve .PP At this point minimal checking is done for potential errors in parameter passing, though these should be easily added in the future when necessary. .SH "Bio::ParameterBaseI implemented methods" .IX Header "Bio::ParameterBaseI implemented methods" .SS "set_parameters" .IX Subsection "set_parameters" .Vb 8 \& Title : set_parameters \& Usage : $pobj\->set_parameters(@params); \& Function: sets the NCBI parameters listed in the hash or array \& Returns : None \& Args : [optional] hash or array of parameter/values. \& Note : This sets any parameter passed but leaves previously set data alone. \& In addition to regular eutil\-specific parameters, you can set the \& following: \& \& \-eutil \- the eUtil to be used (default \*(Aqefetch\*(Aq) \& \-history \- pass a HistoryI\-implementing object, which \& sets the WebEnv, query_key, and possibly db and linkname \& (the latter two only for LinkSets) \& \-correspondence \- Boolean flag, set to TRUE or FALSE; indicates how \& IDs are to be added together for elink request where \& ID correspondence might be needed \& (default 0) .Ve .SS "reset_parameters" .IX Subsection "reset_parameters" .Vb 8 \& Title : reset_parameters \& Usage : resets values \& Function: resets parameters to either undef or value in passed hash \& Returns : none \& Args : [optional] hash of parameter\-value pairs \& Note : This sets any parameter passed, but resets all others (deletes them). \& In addition to regular eutil\-specific parameters, you can set the \& following: \& \& \-eutil \- the eUtil to be used (default \*(Aqefetch\*(Aq) \& \-history \- pass a HistoryI\-implementing object, which \& sets the WebEnv, query_key, and possibly db and linkname \& (the latter two only for LinkSets) \& \-correspondence \- Boolean flag, set to TRUE or FALSE; indicates how \& IDs are to be added together for elink request where \& ID correspondence might be needed \& (default 0) .Ve .SS "carryover" .IX Subsection "carryover" .Vb 8 \& Title : carryover \& Usage : $obj\->carryover(qw(email api_key tool db)) \& Function : Carries over the designated parameters when using reset_parameters() \& Returns : a list of carried\-over parameters \& Args : An array reference of parameters to carry over, followed optionally \& by the mode (\*(Aqadd\*(Aq or \*(Aqdelete\*(Aq, indicating whether to append to or \& remove the specified values passed in). To clear all values, pass in \& an empty array reference (the mode in this case doesn\*(Aqt matter). \& \& In addition to the normal eUtil\-specific parameters, the following \& additional parameters are allowed: \& \& \-eutil \- the eUtil to be used (default \*(Aqefetch\*(Aq) \& \-history \- pass a HistoryI\-implementing object, which \& sets the WebEnv, query_key, and possibly db and linkname \& (the latter two only for LinkSets) \& \-correspondence \- Boolean flag, set to TRUE or FALSE; indicates how \& IDs are to be added together for elink request where \& ID correspondence might be needed \& (default 0) \& Default : None (no carried over parameters) \& Status : NYI (dev in progress, carry on, nothing to see here) .Ve .SS "request_mode" .IX Subsection "request_mode" .Vb 7 \& Title : request_mode \& Usage : $obj\->request_mode \& Function : get/set the mode for the user agent to use for generating a request \& Returns : either a preset mode (checked against the eutil) or a best\-possible \& option based upon the currently\-set parameters \& Args : \& Status : .Ve .SS "parameters_changed" .IX Subsection "parameters_changed" .Vb 5 \& Title : parameters_changed \& Usage : if ($pobj\->parameters_changed) {...} \& Function: Returns TRUE if parameters have changed \& Returns : Boolean (0 or 1) \& Args : [optional] Boolean .Ve .SS "available_parameters" .IX Subsection "available_parameters" .Vb 6 \& Title : available_parameters \& Usage : @params = $pobj\->available_parameters() \& Function: Returns a list of the available parameters \& Returns : Array of available parameters (no values) \& Args : [optional] A string with the eutil name (for returning eutil\-specific \& parameters) .Ve .SS "get_parameters" .IX Subsection "get_parameters" .Vb 12 \& Title : get_parameters \& Usage : @params = $pobj\->get_parameters; \& %params = $pobj\->get_parameters; \& Function: Returns list of key/value pairs, parameter => value \& Returns : Flattened list of key\-value pairs. All key\-value pairs returned, \& though subsets can be returned based on the \*(Aq\-type\*(Aq parameter. Data \& originally set as an array ref are returned based on whether the \& \*(Aq\-join_id\*(Aq flag is set (default is the same array ref). \& Args : \-type : the eutil name (Default: returns all). Use of \*(Aq\-list\*(Aq \& supersedes this \& \-list : array ref of specific parameters \& \-join_ids : Boolean; join IDs based on correspondence (Default: no join) .Ve .SH "Implementation-specific to_* methods" .IX Header "Implementation-specific to_* methods" .SS "to_string" .IX Subsection "to_string" .Vb 8 \& Title : to_string \& Usage : $string = $pobj\->to_string; \& Function: Returns string (URL only in this case) \& Returns : String (URL only for now) \& Args : [optional] \*(Aqall\*(Aq; build URI::https using all parameters \& Default : Builds based on allowed parameters (presence of history data \& or eutil type in %MODE). \& Note : Changes state of object. Absolute string .Ve .SS "to_request" .IX Subsection "to_request" .Vb 12 \& Title : to_request \& Usage : $uri = $pobj\->to_request; \& Function: Returns HTTP::Request object \& Returns : HTTP::Request \& Args : [optional] \*(Aqall\*(Aq; builds request using all parameters \& Default : Builds based on allowed parameters (presence of history data \& or eutil type in %MODE). \& Note : Changes state of object (to boolean FALSE). Used for CGI\-based GET/POST \& TODO : esearch, esummary, elink now accept POST for batch submission \& (something NCBI apparently allowed but didn\*(Aqt advertise). Should we \& switch most of these to utilize POST instead, or make it dep on the \& number of submitted IDs? .Ve .SH "Implementation specific-methods" .IX Header "Implementation specific-methods" .SS "eutil" .IX Subsection "eutil" .Vb 7 \& Title : eutil \& Usage : $p\->eutil(\*(Aqefetch\*(Aq) \& Function: gets/sets the eutil for this set of parameters \& Returns : string (eutil) \& Args : [optional] string (eutil) \& Throws : \*(Aq$eutil not supported\*(Aq if eutil not present \& Note : This does not reset retmode to the default if called directly. .Ve .SS "history" .IX Subsection "history" .Vb 8 \& Title : history \& Usage : $p\->history($history); \& Function: gets/sets the history object to be used for these parameters \& Returns : Bio::Tools::EUtilities::HistoryI (if set) \& Args : [optional] Bio::Tools::EUtilities::HistoryI \& Throws : Passed something other than a Bio::Tools::EUtilities::HistoryI \& Note : This overrides WebEnv() and query_key() settings when set. This \& caches the last history object passed and returns like a Get/Set .Ve .SS "correspondence" .IX Subsection "correspondence" .Vb 5 \& Title : correspondence \& Usage : $p\->correspondence(1); \& Function: Sets flag for posting IDs for one\-to\-one correspondence \& Returns : Boolean \& Args : [optional] boolean value .Ve .SS "id_file" .IX Subsection "id_file" .Vb 9 \& Title : id_file \& Usage : $p\->id_file(\*(Aqurl_base_address(); \& Function: Get URL base address \& Returns : String \& Args : None in this implementation; the URL is fixed .Ve .SS "set_default_retmode" .IX Subsection "set_default_retmode" .Vb 6 \& Title : set_default_retmode \& Usage : $p\->set_default_retmode(); \& Function: sets retmode to default value specified by the eutil() and the value \& in %NCBI_DATABASE (for efetch only) if called \& Returns : none \& Args : none .Ve .SH "FEEDBACK" .IX Header "FEEDBACK" .SS "Mailing lists" .IX Subsection "Mailing lists" User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. .PP .Vb 2 \& bioperl\-l@bioperl.org \- General discussion \& https://bioperl.org/Support.html \- About the mailing lists .Ve .SS "Support" .IX Subsection "Support" Please direct usage questions or support issues to the mailing list: \&\fIbioperl\-l@bioperl.org\fR rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. .SS "Reporting bugs" .IX Subsection "Reporting bugs" Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: .PP .Vb 1 \& https://github.com/bioperl/bio\-eutilities/issues .Ve .SH "AUTHOR" .IX Header "AUTHOR" Chris Fields .SH "COPYRIGHT" .IX Header "COPYRIGHT" This software is copyright (c) 2006\-2013 by Chris Fields. .PP This software is available under the same terms as the perl 5 programming language system itself.