Class | Bio::RestrictionEnzyme::Range::VerticalCutRange
In: | lib/bio/util/restriction_enzyme/range/vertical_cut_range.rb
Parent: | CutRange

FIXME docs are kind of out of date. Change this to VerticalAndHorizontalCutRange

### Methods

include? new

### Attributes

c_cut_left | [R] |
c_cut_right | [R] |
max | [R] |
min | [R] |
p_cut_left | [R] |
p_cut_right | [R] |
range | [R] |

### Public Class methods

new( p_cut_left=nil, p_cut_right=nil, c_cut_left=nil, c_cut_right=nil )

VerticalCutRange provides an extremely raw, yet precise, method of defining the location of cuts on primary and complementary sequences.

Many VerticalCutRange objects are used with HorizontalCutRange objects to be contained in CutRanges to define the cut pattern that a specific enzyme may make.

VerticalCutRange takes up to four possible cuts, two on the primary strand and two on the complementary strand. In typical usage you will want to make a single cut on the primary strand and a single cut on the complementary strand.

However, you can construct it with whatever cuts you desire to accomadate the most eccentric of imaginary restriction enzymes.

Arguments

- `p_cut_left`: (optional) Left-most cut on the primary strand. `nil` to skip
- `p_cut_right`: (optional) Right-most cut on the primary strand. `nil` to skip
- `c_cut_left`: (optional) Left-most cut on the complementary strand. `nil` to skip
- `c_cut_right`: (optional) Right-most cut on the complementary strand. `nil` to skip

Returns: | nothing

[Source]

        # File lib/bio/util/restriction_enzyme/range/vertical_cut_range.rb, line 46
    46:   def initialize( p_cut_left=nil, p_cut_right=nil, c_cut_left=nil, c_cut_right=nil )
    47:     @p_cut_left = p_cut_left
    48:     @p_cut_right = p_cut_right
    49:     @c_cut_left = c_cut_left
    50:     @c_cut_right = c_cut_right
    51:
    52:     a = [@p_cut_left, @c_cut_left, @p_cut_right, @c_cut_right]
    53:     a.delete(nil)
    54:     a.sort!
    55:     @min = a.first
    56:     @max = a.last
    57:
    58:     @range = nil
    59:     @range = (@min..@max) unless @min == nil or @max == nil
    60:     return
    61:   end

### Public Instance methods

include?(i)

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`

[Source]

        # File lib/bio/util/restriction_enzyme/range/vertical_cut_range.rb, line 70
    70:   def include?(i)
    71:     return false if @range == nil
    72:     @range.include?(i)
    73:   end

[Validate]