Module: EnsemblREST::Xref

Defined in:
lib/ensemblrest/xref.rb

Class Method Summary collapse

Class Method Details

.external(symbol, species = 'human', options = {}) ⇒ JSON

Looks up an external symbol and returns all Ensembl objects linked to it. This can be a display name for a gene/transcript/translation, a synonym or an externally linked reference. If a gene’s transcript is linked to the supplied symbol the service will return both gene and transcript (it supports transient links).

Parameters:

  • symbol (String)

    Symbol or display name of a gene

  • species (String) (defaults to: 'human')

    Species name/alias

  • options (Hash) (defaults to: {})

    Optional arguments for the service please goto rest.ensembl.org/documentation/info/xref_external

Returns:

  • (JSON)

    Cross references



25
26
27
# File 'lib/ensemblrest/xref.rb', line 25

def external(symbol, species = 'human', options = {})
  return EnsemblREST.get("xrefs/symbol/#{species}/#{symbol}", {format: 'json'}.merge(options))
end

.id(id, options = {}) ⇒ JSON

Perform lookups of Ensembl Identifiers and retrieve their external references in other databases

Parameters:

Returns:

  • (JSON)

    Cross references



34
35
36
# File 'lib/ensemblrest/xref.rb', line 34

def id(id, options = {})
  return EnsemblREST.get("xrefs/id/#{id}", {format: 'json'}.merge(options))
end

.name(name, species = 'human', options = {}) ⇒ JSON

Performs a lookup based upon the primary accession or display label of an external reference and returning the information we hold about the entry

Parameters:

  • name (String)

    Symbol or display name of a gene

  • species (String) (defaults to: 'human')

    Species name/alias

  • options (Hash) (defaults to: {})

    Optional arguments for the service please goto rest.ensembl.org/documentation/info/xref_name

Returns:

  • (JSON)

    Cross references



45
46
47
# File 'lib/ensemblrest/xref.rb', line 45

def name(name, species = 'human', options = {})
  return EnsemblREST.get("xrefs/name/#{species}/#{name}", {format: 'json'}.merge(options))
end