Class: Bio::Fetch::EBI

Inherits:
Bio::Fetch show all
Defined in:
lib/bio/io/fetch.rb

Overview

Bio::Fetch::EBI is a client of EBI Dbfetch (www.ebi.ac.uk/Tools/dbfetch/dbfetch).

An instance of this class works the same as:

obj = Bio::Fetch.new("http://www.ebi.ac.uk/Tools/dbfetch/dbfetch")
obj.database = "ena_sequence"

See the documents of Bio::Fetch for more details.

Constant Summary collapse

URL =

EBI Dbfetch server URL

"http://www.ebi.ac.uk/Tools/dbfetch/dbfetch".freeze

Instance Attribute Summary

Attributes inherited from Bio::Fetch

#database

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Bio::Fetch

#databases, #fetch, #formats, #get_by_id, #maxids

Constructor Details

#initialize(url = URL) ⇒ EBI

For the usage, see the document of Bio::Fetch.new.


103
104
105
106
# File 'lib/bio/io/fetch.rb', line 103

def initialize(url = URL)
  @database = "ena_sequence"
  super
end

Class Method Details

.query(*args) ⇒ Object

Shortcut for using EBI Dbfetch server. You can fetch an entry without creating an instance of Bio::Fetch::EBI. This method uses EBI Dbfetch server www.ebi.ac.uk/Tools/dbfetch/dbfetch .

Example:

puts Bio::Fetch::EBI.query('refseq','NM_123456')
puts Bio::Fetch::EBI.query('ena_sequence','J00231')

Arguments:

  • database: name of database to query (see Bio::Fetch#databases to get list of supported databases)

  • id: single ID or ID list separated by commas or white space

  • style: [raw|html] (default = 'raw')

  • format: name of output format (see Bio::Fetch#formats)


122
123
124
# File 'lib/bio/io/fetch.rb', line 122

def self.query(*args)
  self.new.fetch(*args)
end