class Ensembl::Core::ExternalDb

The ExternalDb class provides an interface to the external_db table. This table contains references to databases to which xrefs can point to

This class uses ActiveRecord to access data in the Ensembl database. See the general documentation of the Ensembl module for more information on what this means and what methods are available.

@example

embl_db = ExternalDb.find_by_db_name('EMBL')
puts embl_db.xrefs.length.to_s

Public Class Methods

find_all_by_display_label(label) click to toggle source

The ExternalDb#find_all_by_display_label method returns all external databases that have this label. There should normally be no more than one. If no databases are found with this name, this method returns an empty array.

# File lib/bio-ensembl/core/activerecord.rb, line 1544
def self.find_all_by_display_label(label)
  answer = Array.new
  xrefs = Xref.find_all_by_display_label(label)
  xrefs.each do |xref|
    answer.push(self.class.find_by_xref_id(xref.xref_id))
  end

  return answer
end
find_by_display_label(label) click to toggle source

The ExternalDb#find_by_display_label method returns a database that has this label. If no databases are found with this name, this method returns nil. empty array.

# File lib/bio-ensembl/core/activerecord.rb, line 1558
def self.find_by_display_label(label)
  all_dbs = self.find_all_by_display_label(label)
  if all_dbs.length == 0
    return nil
  else
    return all_dbs[0]
  end
end
inheritance_column() click to toggle source
# File lib/bio-ensembl/core/activerecord.rb, line 1536
def self.inheritance_column
  nil
end