Class: Bio::RestrictionEnzyme::DoubleStranded::CutLocationsInEnzymeNotation
- Inherits:
-
CutLocations
- Object
- Array
- CutLocations
- Bio::RestrictionEnzyme::DoubleStranded::CutLocationsInEnzymeNotation
- Defined in:
- lib/bio/util/restriction_enzyme/double_stranded/cut_locations_in_enzyme_notation.rb
Overview
Inherits from DoubleStranded::CutLocations. Contains CutLocationPairInEnzymeNotation objects. Adds helper methods to convert from enzyme index notation to 0-based array index notation.
Instance Method Summary (collapse)
-
- (Object) complement_to_array_index
Returns Array of locations of cuts on the complementary strand in 0-based array index notation.
-
- (Object) primary_to_array_index
Returns Array of locations of cuts on the primary strand in 0-based array index notation.
-
- (Object) to_array_index
Returns the contents of the present CutLocationsInEnzymeNotation object as a CutLocations object with the contents converted from enzyme notation to 0-based array index notation.
Methods inherited from CutLocations
#complement, #initialize, #primary
Constructor Details
This class inherits a constructor from Bio::RestrictionEnzyme::DoubleStranded::CutLocations
Instance Method Details
- (Object) complement_to_array_index
Returns Array of locations of cuts on the complementary strand in 0-based array index notation.
Arguments
-
none
Returns |
Array of locations of cuts on the complementary strand in 0-based array index notation. |
40 41 42 |
# File 'lib/bio/util/restriction_enzyme/double_stranded/cut_locations_in_enzyme_notation.rb', line 40 def complement_to_array_index helper_for_to_array_index(self.complement) end |
- (Object) primary_to_array_index
Returns Array of locations of cuts on the primary strand in 0-based array index notation.
Arguments
-
none
Returns |
Array of locations of cuts on the primary strand in 0-based array index notation. |
29 30 31 |
# File 'lib/bio/util/restriction_enzyme/double_stranded/cut_locations_in_enzyme_notation.rb', line 29 def primary_to_array_index helper_for_to_array_index(self.primary) end |
- (Object) to_array_index
Returns the contents of the present CutLocationsInEnzymeNotation object as a CutLocations object with the contents converted from enzyme notation to 0-based array index notation.
Arguments
-
none
Returns |
CutLocations |
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/bio/util/restriction_enzyme/double_stranded/cut_locations_in_enzyme_notation.rb', line 52 def to_array_index unless self.primary_to_array_index.size == self.complement_to_array_index.size err = "Primary and complement strand cut locations are not available in equal numbers.\n" err += "primary: #{self.primary_to_array_index.inspect}\n" err += "primary.size: #{self.primary_to_array_index.size}\n" err += "complement: #{self.complement_to_array_index.inspect}\n" err += "complement.size: #{self.complement_to_array_index.size}" raise IndexError, err end a = self.primary_to_array_index.zip(self.complement_to_array_index) CutLocations.new( *a.collect {|cl| CutLocationPair.new(cl)} ) end |