Class: Ensembl::Core::Translation

Inherits:
DBConnection show all
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.

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.



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_labelObject 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_idString

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

Returns:

  • (String)

    Ensembl stable ID



1397
1398
1399
# File 'lib/bio-ensembl/core/activerecord.rb', line 1397

def stable_id
	return self.translation_stable_id.stable_id
end