Class: Ensembl::Core::Translation
- Inherits:
-
DBConnection
- Object
- ActiveRecord::Base
- DBRegistry::Base
- DBConnection
- Ensembl::Core::Translation
- Defined in:
- lib/bio-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.
Class Method Summary collapse
-
.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).
Instance Method Summary collapse
-
#display_label ⇒ Object
(also: #display_name, #label, #name)
The Translation#display_label method returns the default name of the translation.
-
#stable_id ⇒ String
The Translation#stable_id method returns the stable ID of the translation.
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.
1412 1413 1414 1415 1416 1417 1418 1419 |
# File 'lib/bio-ensembl/core/activerecord.rb', line 1412 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_label ⇒ Object Also known as: display_name, label, name
The Translation#display_label method returns the default name of the translation.
1402 1403 1404 |
# File 'lib/bio-ensembl/core/activerecord.rb', line 1402 def display_label return Xref.find(self.display_xref_id).display_label end |
#stable_id ⇒ String
The Translation#stable_id method returns the stable ID of the translation.
1397 1398 1399 |
# File 'lib/bio-ensembl/core/activerecord.rb', line 1397 def stable_id return self.translation_stable_id.stable_id end |