Class: Bio::NCBI

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

Defined Under Namespace

Classes: REST, SOAP

Constant Summary

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

+ (Object) default_email

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

+ (Object) default_email=(str)

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

+ (Object) default_tool

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

+ (Object) default_tool=(str)

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

+ (Object) reset_entrez_default_parameters

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