Class: Ensembl::Core::Translation

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

Overview

DESCRIPTION

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.

USAGE

#TODO

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DBConnection

connect

Class Method Details

.find_by_stable_id(stable_id) ⇒ Object

DESCRIPTION

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.



1428
1429
1430
1431
1432
1433
1434
1435
# File 'lib/ensembl/core/activerecord.rb', line 1428

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

DESCRIPTION

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



1417
1418
1419
# File 'lib/ensembl/core/activerecord.rb', line 1417

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

#stable_idObject

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


Arguments

none

Returns

String



1411
1412
1413
# File 'lib/ensembl/core/activerecord.rb', line 1411

def stable_id
	return self.translation_stable_id.stable_id
end