class Bio::NCBI

Constants

ENTREZ_DEFAULT_PARAMETERS

(Hash) Default parameters for Entrez (eUtils). They may also be used for other NCBI services.

Public Class Methods

default_email() click to toggle source

Gets default email address for Entrez (eUtils).


Returns

String or nil

   # File lib/bio/io/ncbirest.rb
50 def self.default_email
51   ENTREZ_DEFAULT_PARAMETERS['email']
52 end
default_email=(str) click to toggle source

Sets default email address used for Entrez (eUtils). It may also be used for other NCBI services.

In www.ncbi.nlm.nih.gov/books/NBK25497/ NCBI says: “The value of email should be a complete and valid e-mail address of the software developer and not that of a third-party end user.”

By default, email address of BioRuby staffs is set.

From the above NCBI documentation, the tool and email value is used only for unblocking IP addresses blocked by NCBI due to excess requests. For the purpose, NCBI says: “Please be aware that merely providing values for tool and email in requests is not sufficient to comply with this policy; these values must be registered with NCBI.”

Please use your own email address and tool name when registering tool and email values to NCBI.


Arguments:

  • (required) str: (String) email address

Returns

same as given argument

   # File lib/bio/io/ncbirest.rb
78 def self.default_email=(str)
79   ENTREZ_DEFAULT_PARAMETERS['email'] = str
80 end
default_tool() click to toggle source

Gets default tool name for Entrez (eUtils).


Returns

String or nil

   # File lib/bio/io/ncbirest.rb
85 def self.default_tool
86   ENTREZ_DEFAULT_PARAMETERS['tool']
87 end
default_tool=(str) click to toggle source

Sets default tool name for Entrez (eUtils). It may also be used for other NCBI services.

In www.ncbi.nlm.nih.gov/books/NBK25497/ NCBI says: “The value of tool should be a string with no internal spaces that uniquely identifies the software producing the request.”

“bioruby” is set by default. Please use your own tool name when registering to NCBI.

See the document of default_email= for more information.


Arguments:

  • (required) str: (String) tool name

Returns

same as given argument

    # File lib/bio/io/ncbirest.rb
106 def self.default_tool=(str)
107   ENTREZ_DEFAULT_PARAMETERS['tool'] = str
108 end
reset_entrez_default_parameters() click to toggle source

Resets Entrez (eUtils) default parameters.


Returns

(Hash) default parameters

   # File lib/bio/io/ncbirest.rb
38 def self.reset_entrez_default_parameters
39   h = {
40     'tool'  => "bioruby",
41     'email' => 'staff@bioruby.org',
42   }
43   ENTREZ_DEFAULT_PARAMETERS.clear
44   ENTREZ_DEFAULT_PARAMETERS.update(h)
45 end