class Ensembl::Core::Exon

The Exon class describes an exon.

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.

This class includes the mixin Sliceable, which means that it is mapped to a SeqRegion object and a Slice can be created for objects of this class. See Sliceable and Slice for more information.

@example

seq_region = SeqRegion.find(1)
puts seq_region.exons.length

Public Class Methods

find_by_stable_id(stable_id) click to toggle source
# File lib/bio-ensembl/core/activerecord.rb, line 682
def self.find_by_stable_id(stable_id)
    exon_stable_id = ExonStableId.find_by_stable_id(stable_id)
    if exon_stable_id.nil?
      return nil
    else
      return exon_stable_id.exon
    end
end

Public Instance Methods

seq() click to toggle source

The Exon#seq method returns the sequence of the exon.

# File lib/bio-ensembl/core/activerecord.rb, line 669
def seq
  seq_region = nil
  if Ensembl::SESSION.seq_regions.has_key?(self.seq_region_id)
    seq_region = Ensembl::SESSION.seq_regions[self.seq_region_id]
  else
    seq_region = self.seq_region
    Ensembl::SESSION.seq_regions[seq_region.id] = seq_region
  end
  slice = Ensembl::Core::Slice.new(seq_region, seq_region_start, seq_region_end, seq_region_strand)
  return slice.seq
end
stable_id() click to toggle source
# File lib/bio-ensembl/core/activerecord.rb, line 664
def stable_id
  return self.exon_stable_id.stable_id
end