Class: Ensembl::Core::Gap

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

Overview

DESCRIPTION

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

DESCRIPTION

Create a new Gap object from scratch.

USAGE

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

Arguments:

  • coord_system: CoordSystem object (required)

  • length: length of the gap (required)

Returns

Gap object



616
617
618
# File 'lib/ensembl/core/slice.rb', line 616

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

Instance Attribute Details

#coord_systemObject

Returns the value of attribute coord_system.



602
603
604
# File 'lib/ensembl/core/slice.rb', line 602

def coord_system
  @coord_system
end

#sizeObject Also known as: length

Returns the value of attribute size.



602
603
604
# File 'lib/ensembl/core/slice.rb', line 602

def size
  @size
end

Instance Method Details

#display_nameObject



621
622
623
# File 'lib/ensembl/core/slice.rb', line 621

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