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, line 50
def self.default_email
  ENTREZ_DEFAULT_PARAMETERS['email']
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, line 78
def self.default_email=(str)
  ENTREZ_DEFAULT_PARAMETERS['email'] = str
end
default_tool() click to toggle source

Gets default tool name for Entrez (eUtils).


Returns

String or nil

# File lib/bio/io/ncbirest.rb, line 85
def self.default_tool
  ENTREZ_DEFAULT_PARAMETERS['tool']
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, line 106
def self.default_tool=(str)
  ENTREZ_DEFAULT_PARAMETERS['tool'] = str
end
reset_entrez_default_parameters() click to toggle source

Resets Entrez (eUtils) default parameters.


Returns

(Hash) default parameters

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