Class: Bio::NCBI

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

Defined Under Namespace

Classes: REST

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



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

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



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

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



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

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



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

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



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

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