Class: Ensembl::Core::Gap

Inherits:
Object
  • Object
show all
Defined in:
lib/bio-ensembl/core/slice.rb

Overview

The Gap class is similar to the Slice object, but describes a gap and therefore can easily be described by coordinate system and size.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(coord_system, size) ⇒ Gap

Create a new Gap object from scratch.

Examples:

my_coord_system = CoordSystem.find_by_name('chromosome')
# Create a gap of 10kb.
gap = Gap.new(my_coord_system, 10000)

Parameters:

  • coord_system (CoordSystem)

    Coordinate system object

  • size (Integer)

    Length of the gap



646
647
648
# File 'lib/bio-ensembl/core/slice.rb', line 646

def initialize(coord_system, size)
  @coord_system, @size = coord_system, size
end

Instance Attribute Details

#coord_systemObject

Returns the value of attribute coord_system.



634
635
636
# File 'lib/bio-ensembl/core/slice.rb', line 634

def coord_system
  @coord_system
end

#sizeObject Also known as: length

Returns the value of attribute size.



634
635
636
# File 'lib/bio-ensembl/core/slice.rb', line 634

def size
  @size
end

Instance Method Details

#display_nameObject



651
652
653
# File 'lib/bio-ensembl/core/slice.rb', line 651

def display_name
  return @coord_system.name + ":gap:" + @size.to_s
end