class Scaffolder::Region::Insert

Inserts are used to additional usually smaller sequences to larger sequences. The attributes in the sequence class are used to specify where the host sequence is ‘opened’ and ‘closed’ to add the insert. Either one of these two attributes may be ommitted. Omitting the ‘open’ attribute will cause the insert open position to be calculated based on the close minus the sequence length. The reverse is true if the close position is ommittted.

@see Scaffolder::Region::Sequence Scaffolder::Region::Sequence for an

example on adding inserts to a sequence.

Public Instance Methods

<=>(other) click to toggle source

Inserts are comparable by close position.

@return [Integer] @param [Scaffolder::Region::Insert]

# File lib/scaffolder/region/insert.rb, line 47
def <=>(other)
  self.close <=> other.close
end
position() click to toggle source

Insertion position as a Range

@return [Range] @raise [CoordinateError] if both the open and close positions are nil.

# File lib/scaffolder/region/insert.rb, line 38
def position
  raise CoordinateError if @close.nil? && @open.nil?
  open-1..close-1
end
size_diff() click to toggle source

The difference in the insert sequence size and the insert location

@return [Integer]

# File lib/scaffolder/region/insert.rb, line 54
def size_diff
  insert_size = (close - open) + 1
  sequence.length - insert_size
end