Class: Bio::NCBI

Inherits:
Object show all
Defined in:
lib/bio/io/ncbirest.rb,
lib/bio/io/ncbisoap.rb

Defined Under Namespace

Classes: REST, SOAP

Constant Summary collapse

ENTREZ_DEFAULT_PARAMETERS =

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

{
  'tool' => "#{$0} (bioruby/#{Bio::BIORUBY_VERSION_ID})",
  'email' => nil,
}

Class Method Summary collapse

Class Method Details

.default_emailObject

Gets default email address for Entrez (eUtils).


Returns

String or nil



42
43
44
# File 'lib/bio/io/ncbirest.rb', line 42

def self.default_email
  ENTREZ_DEFAULT_PARAMETERS['email']
end

.default_email=(str) ⇒ Object

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


Arguments:

  • (required) str: (String) email address

Returns

same as given argument



52
53
54
# File 'lib/bio/io/ncbirest.rb', line 52

def self.default_email=(str)
  ENTREZ_DEFAULT_PARAMETERS['email'] = str
end

.default_toolObject

Gets default tool name for Entrez (eUtils).


Returns

String or nil



59
60
61
# File 'lib/bio/io/ncbirest.rb', line 59

def self.default_tool
  ENTREZ_DEFAULT_PARAMETERS['tool']
end

.default_tool=(str) ⇒ Object

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


Arguments:

  • (required) str: (String) tool name

Returns

same as given argument



69
70
71
# File 'lib/bio/io/ncbirest.rb', line 69

def self.default_tool=(str)
  ENTREZ_DEFAULT_PARAMETERS['tool'] = str
end

.reset_entrez_default_parametersObject

Resets Entrez (eUtils) default parameters.


Returns

(Hash) default parameters



30
31
32
33
34
35
36
37
# File 'lib/bio/io/ncbirest.rb', line 30

def self.reset_entrez_default_parameters
  h = {
    'tool' => "#{$0} (bioruby/#{Bio::BIORUBY_VERSION_ID})",
    'email' => nil,
  }
  ENTREZ_DEFAULT_PARAMETERS.clear
  ENTREZ_DEFAULT_PARAMETERS.update(h)
end