Class: Ensembl::Core::Marker
- Inherits:
-
DBConnection
- Object
- ActiveRecord::Base
- DBRegistry::Base
- DBConnection
- Ensembl::Core::Marker
- Defined in:
- lib/bio-ensembl/core/activerecord.rb
Overview
The Marker class provides an interface to the marker table. This table contains primer sequences and PCR product lengths.
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_all_by_name(name) ⇒ Array
The Marker#find_all_by_name class method returns all markers with this name.
-
.find_by_name(name) ⇒ Marker?
The Marker#find_by_name class method returns one marker with this name.
- .inheritance_column ⇒ Object
Instance Method Summary collapse
-
#name ⇒ Object
The Marker#name method returns a comma-separated list of synonyms of this marker.
Methods inherited from DBConnection
connect, ensemblgenomes_connect
Methods inherited from DBRegistry::Base
generic_connect, get_info, get_name_from_db
Class Method Details
.find_all_by_name(name) ⇒ Array
The Marker#find_all_by_name class method returns all markers with this name. If no marker is found, it returns an empty array.
853 854 855 856 857 858 859 860 861 |
# File 'lib/bio-ensembl/core/activerecord.rb', line 853 def self.find_all_by_name(name) marker_synonyms = Ensembl::Core::MarkerSynonym.find_all_by_name(name) answers = Array.new marker_synonyms.each do |ms| answers.push(Ensembl::Core::Marker.find_all_by_marker_id(ms.marker_id)) end answers.flatten! return answers end |
.find_by_name(name) ⇒ Marker?
The Marker#find_by_name class method returns one marker with this name.
840 841 842 843 844 845 846 847 |
# File 'lib/bio-ensembl/core/activerecord.rb', line 840 def self.find_by_name(name) all_names = self.find_all_by_name(name) if all_names.length == 0 return nil else return all_names[0] end end |
.inheritance_column ⇒ Object
823 824 825 |
# File 'lib/bio-ensembl/core/activerecord.rb', line 823 def self.inheritance_column nil end |
Instance Method Details
#name ⇒ Object
The Marker#name method returns a comma-separated list of synonyms of this marker
833 834 835 |
# File 'lib/bio-ensembl/core/activerecord.rb', line 833 def name self.marker_synonyms.collect{|ms| ms.name}.join(',') end |