Module: EnsemblRest::Lookup

Defined in:
lib/bio-ensembl-rest/lookup.rb

Class Method Summary collapse

Class Method Details

.lookup_id(id, opts = {}) ⇒ Object

Query for an identifier’s location in the available Ensembl databases



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/bio-ensembl-rest/lookup.rb', line 6

def self.lookup_id(id, opts = {})
  opts = EnsemblRest.parse_options opts
  path = EnsemblRest.build_path "/lookup/id/#{id}", opts

  if opts['content-type'] == 'ruby'
    plain_opts = opts.clone
    plain_opts['content-type'] = 'application/json'
    return JSON.parse lookup_id id, plain_opts
  end

  return EnsemblRest.fetch_data path, opts, 'lookup' 
end