[BioRuby-cvs] bioruby/lib/bio/util/restriction_enzyme/single_strand cut_locations_in_enzyme_notation.rb, 1.2, 1.3
Trevor Wennblom
trevor at dev.open-bio.org
Mon Jan 1 03:36:39 UTC 2007
Update of /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/single_strand
In directory dev.open-bio.org:/tmp/cvs-serv728/lib/bio/util/restriction_enzyme/single_strand
Modified Files:
cut_locations_in_enzyme_notation.rb
Log Message:
Index: cut_locations_in_enzyme_notation.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/single_strand/cut_locations_in_enzyme_notation.rb,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** cut_locations_in_enzyme_notation.rb 31 Dec 2006 21:50:31 -0000 1.2
--- cut_locations_in_enzyme_notation.rb 1 Jan 2007 03:36:37 -0000 1.3
***************
*** 33,36 ****
--- 33,42 ----
#
# Enzyme index notation:: 1.._n_, value before 1 is -1
+ #
+ # example:: [-3][-2][-1][1][2][3][4][5]
+ #
+ # Negative values are used to indicate when a cut may occur at a specified
+ # distance before the sequence begins. This would be padded with 'n'
+ # nucleotides to represent wildcards.
#
# Notes:
***************
*** 38,43 ****
# * +nil+ is not allowed here as it has no meaning
# * +nil+ values are kept track of in DoubleStranded::CutLocations as they
! # need a reference point on the correlating strand. +nil+ represents no
! # cut or a partial digestion.
#
class CutLocationsInEnzymeNotation < Array
--- 44,50 ----
# * +nil+ is not allowed here as it has no meaning
# * +nil+ values are kept track of in DoubleStranded::CutLocations as they
! # need a reference point on the correlating strand. In
! # DoubleStranded::CutLocations +nil+ represents no cut or a partial
! # digestion.
#
class CutLocationsInEnzymeNotation < Array
***************
*** 45,55 ****
extend CutSymbol
! attr_reader :min, :max
def initialize(*a)
a.flatten! # in case an array was passed as an argument
if a.size == 1 and a[0].kind_of? String and a[0] =~ re_cut_symbol
! # Initialize with a cut symbol pattern such as 'n^ng^arraxt^n'
s = a[0]
a = []
--- 52,77 ----
extend CutSymbol
! # First cut, in enzyme-index notation
! attr_reader :min
!
! # Last cut, in enzyme-index notation
! attr_reader :max
+ # Constructor for CutLocationsInEnzymeNotation
+ #
+ # ---
+ # *Arguments*
+ # * +a+: Locations of cuts represented as a string with cuts or an array of values
+ # Examples:
+ # * n^ng^arraxt^n
+ # * 2
+ # * -1, 5
+ # * [-1, 5]
+ # *Returns*:: nothing
def initialize(*a)
a.flatten! # in case an array was passed as an argument
if a.size == 1 and a[0].kind_of? String and a[0] =~ re_cut_symbol
! # Initialize with a cut symbol pattern such as 'n^ng^arraxt^n'
s = a[0]
a = []
***************
*** 78,81 ****
--- 100,107 ----
# [ -2, 1, 3 ] -> [ 0, 2, 4 ]
#
+ # ---
+ # *Arguments*
+ # * _none_
+ # *Returns*:: +Array+ of cuts in 0-based index notation
def to_array_index
return [] if @min == nil
More information about the bioruby-cvs
mailing list