Bio-EUtilities
view release on metacpan or search on metacpan
lib/Bio/DB/EUtilities.pm view on Meta::CPAN
Returns : Bio::ParameterBaseI object
Args : Bio::ParameterBaseI object
=head2 ua
Title : ua
Usage : $dbi->ua;
Function: Get/Set LWP::UserAgent.
Returns : LWP::UserAgent
Args : LWP::UserAgent
=head2 get_Response
Title : get_Response
Usage : $agent->get_Response;
Function: Get the HTTP::Response object by passing it an HTTP::Request (generated from
Bio::ParameterBaseI implementation).
Returns : HTTP::Response object or data if callback is used
Args : (optional)
-cache_response - flag to cache HTTP::Response object;
Default is 1 (TRUE, caching ON)
These are passed on to LWP::UserAgent::request() if stipulated
-cb - use a LWP::UserAgent-compliant callback
-file - dumps the response to a file (handy for large responses)
Note: can't use file and callback at the same time
-read_size_hint - bytes of content to read in at a time to pass to callback
Note : Caching and parameter checking are set
=head2 delay
Title : delay
Usage : $secs = $self->delay([$secs])
Function: get/set number of seconds to delay between fetches
Returns : number of seconds to delay
Args : new value
NOTE: the default is to use the value specified by delay_policy().
This can be overridden by calling this method.
=head1 LWP::UserAgent related methods
=head2 proxy
Title : proxy
Usage : $httpproxy = $db->proxy('http') or
$db->proxy(['http','ftp'], 'http://myproxy' )
Function: Get/Set a proxy for use of proxy
Returns : a string indicating the proxy
Args : $protocol : an array ref of the protocol(s) to set/get
$proxyurl : url of the proxy to use for the specified protocol
$username : username (if proxy requires authentication)
$password : password (if proxy requires authentication)
=head2 authentication
Title : authentication
Usage : $db->authentication($user,$pass)
Function: Get/Set authentication credentials
Returns : Array of user/pass
Args : Array or user/pass
=head2 delay_policy
Title : delay_policy
Usage : $secs = $self->delay_policy
Function: return number of seconds to delay between calls to remote db
Returns : number of seconds to delay
Args : none
NOTE: NCBI requests a delay of 3 requests per second. This method implements
that policy. This will likely change to check time of day or number of
requests for lengthening delays.
=head2 get_Parser
Title : get_Parser
Usage : $agent->get_Parser;
Function: Retrieve the parser used for last agent request
Returns : The Bio::Tools::EUtilities parser used to parse the HTTP::Response
content
Args : None
Note : Abstract method; defined by implementation
=head1 Bio::Tools::EUtilities::EUtilParameters-delegating methods
This is only a subset of parameters available from Bio::Tools::EUtilities::EUtilParameters (the
ones deemed absolutely necessary). All others are available by calling
'parameter_base-E<gt>method' when needed.
=head2 set_parameters
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 (i.e. doesn't screen them). In addition to
regular eutil-specific parameters, you can set the following:
-eutil - the eUtil to be used (default 'efetch')
-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)
=head2 reset_parameters
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 also resets eutil(), correspondence(), and the history and request
cache
( run in 0.901 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )