Class: Ensembl::Core::Gap
- Inherits:
-
Object
- Object
- Ensembl::Core::Gap
- 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
-
#coord_system ⇒ Object
Returns the value of attribute coord_system.
-
#size ⇒ Object
(also: #length)
Returns the value of attribute size.
Instance Method Summary collapse
- #display_name ⇒ Object
-
#initialize(coord_system, size) ⇒ Gap
constructor
DESCRIPTION Create a new Gap object from scratch.
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_system ⇒ Object
Returns the value of attribute coord_system.
602 603 604 |
# File 'lib/ensembl/core/slice.rb', line 602 def coord_system @coord_system end |
#size ⇒ Object 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_name ⇒ Object
621 622 623 |
# File 'lib/ensembl/core/slice.rb', line 621 def display_name return @coord_system.name + ":gap:" + @size.to_s end |