class Bio::RestrictionEnzyme::Range::HorizontalCutRange

Attributes

c_cut_left[R]
c_cut_right[R]
hcuts[R]
max[R]
min[R]
p_cut_left[R]
p_cut_right[R]

Public Class Methods

new( left, right=left ) click to toggle source
# File lib/bio/util/restriction_enzyme/range/horizontal_cut_range.rb, line 22
def initialize( left, right=left )
  raise "left > right" if left > right

  # The 'range' here is actually off by one on the left
  # side in relation to a normal CutRange, so using the normal
  # variables from CutRange would result in bad behavior.
  #
  # See below - the first horizontal cut is the primary cut plus one.
  #
  #    1 2 3 4 5 6 7
  #    G A|T T A C A
  #       +-----+
  #    C T A A T|G T
  #    1 2 3 4 5 6 7
  # 
  # Primary cut = 2
  # Complement cut = 5
  # Horizontal cuts = 3, 4, 5

  @p_cut_left = nil
  @p_cut_right = nil
  @c_cut_left = nil
  @c_cut_right = nil
  @min = left  # NOTE this used to be 'nil', make sure all tests work
  @max = right # NOTE this used to be 'nil', make sure all tests work
  @range = (@min..@max) unless @min == nil or @max == nil # NOTE this used to be 'nil', make sure all tests work
  

  @hcuts = (left..right)
end

Public Instance Methods

include?(i) click to toggle source

Check if a location falls within the minimum or maximum values of this range.


Arguments

  • i: Location to check if it is included in the range

Returns

true or false

# File lib/bio/util/restriction_enzyme/range/horizontal_cut_range.rb, line 60
def include?(i)
  @range.include?(i)
end