class Ensembl::Core::Marker
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.
@example
marker = Marker.find(52194) puts marker.left_primer puts marker.right_primer puts marker.min_primer_dist.to_s
Public Class Methods
find_all_by_name(name)
click to toggle source
The Marker#find_all_by_name class method returns all markers with this name. If no marker is found, it returns an empty array.
@return [Array] Empty array or array of Marker
objects
# 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)
click to toggle source
The Marker#find_by_name class method returns one marker with this name.
@return [Marker, nil] Marker
object or nil
# 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()
click to toggle source
# File lib/bio-ensembl/core/activerecord.rb, line 823 def self.inheritance_column nil end
Public Instance Methods
name()
click to toggle source
The Marker#name
method returns a comma-separated list of synonyms of this marker
@example
marker = Marker.find(1) puts marker.name --> 58017,D29149
# File lib/bio-ensembl/core/activerecord.rb, line 833 def name self.marker_synonyms.collect{|ms| ms.name}.join(',') end