[BioRuby-cvs] bioruby/lib/bio/util/restriction_enzyme/range sequence_range.rb, 1.4, 1.5

Trevor Wennblom trevor at dev.open-bio.org
Sat Jan 6 06:13:24 UTC 2007


Update of /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range
In directory dev.open-bio.org:/tmp/cvs-serv18414/restriction_enzyme/range

Modified Files:
	sequence_range.rb 
Log Message:


Index: sequence_range.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/sequence_range.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** sequence_range.rb	6 Jan 2007 05:52:52 -0000	1.4
--- sequence_range.rb	6 Jan 2007 06:13:22 -0000	1.5
***************
*** 74,94 ****
    end
  
    # Cut occurs immediately after the index supplied.
    # For example, a cut at '0' would mean a cut occurs between bases 0 and 1.
    def add_cut_range( p_cut_left=nil, p_cut_right=nil, c_cut_left=nil, c_cut_right=nil )
      @__fragments_current = false
! 
!     if p_cut_left.kind_of? CutRange
        @cut_ranges << p_cut_left
      else
!       (raise IndexError unless p_cut_left >= @left and p_cut_left <= @right) unless p_cut_left == nil
!       (raise IndexError unless p_cut_right >= @left and p_cut_right <= @right) unless p_cut_right == nil
!       (raise IndexError unless c_cut_left >= @left and c_cut_left <= @right) unless c_cut_left == nil
!       (raise IndexError unless c_cut_right >= @left and c_cut_right <= @right) unless c_cut_right == nil
! 
        @cut_ranges << VerticalCutRange.new( p_cut_left, p_cut_right, c_cut_left, c_cut_right )
      end
    end
  
    def add_cut_ranges(*cut_ranges)
      cut_ranges.flatten.each do |cut_range|
--- 74,109 ----
    end
  
+ 
+   # If the first object is HorizontalCutRange or VerticalCutRange, that is
+   # added to the SequenceRange.  Otherwise this method
+   # builds a VerticalCutRange object and adds it to the SequenceRange.
+   # 
+   # Note:
    # Cut occurs immediately after the index supplied.
    # For example, a cut at '0' would mean a cut occurs between bases 0 and 1.
+   #
+   # ---
+   # *Arguments*
+   # * +p_cut_left+: (_optional_) Left-most cut on the primary strand *or* a CutRange object.  +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
    def add_cut_range( p_cut_left=nil, p_cut_right=nil, c_cut_left=nil, c_cut_right=nil )
      @__fragments_current = false
!     if p_cut_left.kind_of? CutRange # shortcut
        @cut_ranges << p_cut_left
      else
!       [p_cut_left, p_cut_right, c_cut_left, c_cut_right].each { |n| (raise IndexError unless n >= @left and n <= @right) unless n == nil }
        @cut_ranges << VerticalCutRange.new( p_cut_left, p_cut_right, c_cut_left, c_cut_right )
      end
    end
  
+   # Add a series of CutRange objects (HorizontalCutRange or VerticalCutRange).
+   #
+   # ---
+   # *Arguments*
+   # * +cut_ranges+: A series of CutRange objects
+   # *Returns*:: nothing
    def add_cut_ranges(*cut_ranges)
      cut_ranges.flatten.each do |cut_range|
***************
*** 98,101 ****
--- 113,123 ----
    end
  
+   # Builds a HorizontalCutRange object and adds it to the SequenceRange.
+   #
+   # ---
+   # *Arguments*
+   # * +left+: Left-most cut
+   # * +right+: (_optional_) Right side - by default this equals the left side, default is recommended.
+   # *Returns*:: nothing
    def add_horizontal_cut_range( left, right=left )
      @__fragments_current = false




More information about the bioruby-cvs mailing list