class Bio::RestrictionEnzyme::DoubleStranded::CutLocations

Contains an Array of CutLocationPair objects.

Public Class Methods

new(*args) click to toggle source

CutLocations constructor.

Contains an Array of CutLocationPair objects.

Example:

clp1 = CutLocationPair.new(3,2)
clp2 = CutLocationPair.new(7,9)
pairs = CutLocations.new(clp1, clp2)

Arguments

  • args: Any number of CutLocationPair objects

Returns

nothing

Calls superclass method
# File lib/bio/util/restriction_enzyme/double_stranded/cut_locations.rb, line 33
def initialize(*args)
  validate_args(args)
  super(args)
end

Public Instance Methods

complement() click to toggle source

Returns an Array of locations of cuts on the complementary strand


Arguments

  • none

Returns

Array of locations of cuts on the complementary strand

# File lib/bio/util/restriction_enzyme/double_stranded/cut_locations.rb, line 54
def complement
  self.collect {|a| a[1]}
end
primary() click to toggle source

Returns an Array of locations of cuts on the primary strand


Arguments

  • none

Returns

Array of locations of cuts on the primary strand

# File lib/bio/util/restriction_enzyme/double_stranded/cut_locations.rb, line 44
def primary
  self.collect {|a| a[0]}
end

Protected Instance Methods

validate_args(args) click to toggle source
# File lib/bio/util/restriction_enzyme/double_stranded/cut_locations.rb, line 62
def validate_args(args)
  args.each do |a|
    unless a.class == Bio::RestrictionEnzyme::DoubleStranded::CutLocationPair
      err = "Not a CutLocationPair\n"
      err += "class: #{a.class}\n"
      err += "inspect: #{a.inspect}"
      raise ArgumentError, err
    end
  end
end