Class: Ensembl::Core::Translation

Inherits:
DBConnection show all
Defined in:
lib/ensembl/core/activerecord.rb

Overview

The Translation class provides an interface to the translation table. This table contains the translation start and stop positions and exons for a given Transcript

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.

Examples:

#TODO

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DBConnection

connect, ensemblgenomes_connect

Methods inherited from DBRegistry::Base

generic_connect, get_info, get_name_from_db

Class Method Details

.find_by_stable_id(stable_id) ⇒ Object

The Translation#find_by_stable_id class method fetches a Translation object based on its stable ID (i.e. the “ENSP” accession number). If the name is not found, it returns nil.



1409
1410
1411
1412
1413
1414
1415
1416
# File 'lib/ensembl/core/activerecord.rb', line 1409

def self.find_by_stable_id(stable_id)
  translation_stable_id = TranslationStableId.find_by_stable_id(stable_id)
  if translation_stable_id.nil?
    return nil
  else
    return translation_stable_id.translation
  end
end

Instance Method Details

#display_labelObject Also known as: display_name, label, name

The Translation#display_label method returns the default name of the translation.



1399
1400
1401
# File 'lib/ensembl/core/activerecord.rb', line 1399

def display_label
  return Xref.find(self.display_xref_id).display_label
end

#stable_idString

The Translation#stable_id method returns the stable ID of the translation.

Returns:

  • (String)

    Ensembl stable ID



1394
1395
1396
# File 'lib/ensembl/core/activerecord.rb', line 1394

def stable_id
	return self.translation_stable_id.stable_id
end