Class | Bio::RestrictionEnzyme::Range::SequenceRange::Fragment
In: | lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb
Parent: | Object

### Methods

for_display new

### Constants

DisplayFragment | = | Struct.new(:primary, :complement, :p_left, :p_right, :c_left, :c_right)

### Attributes

size | [R] |

### Public Class methods

new( primary_bin, complement_bin )

[Source]

        # File lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb, line 22
    22:   def initialize( primary_bin, complement_bin )
    23:     @primary_bin = primary_bin
    24:     @complement_bin = complement_bin
    25:   end

### Public Instance methods

for_display(p_str=nil, c_str=nil)

[Source]

        # File lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb, line 29
    29:   def for_display(p_str=nil, c_str=nil)
    30:     df = DisplayFragment.new
    31:     df.primary = ''
    32:     df.complement = ''
    33:
    34:     both_bins = (@primary_bin + @complement_bin).sort.uniq
    35:     both_bins.each do |item|
    36:       @primary_bin.include?(item) ? df.primary << p_str[item] : df.primary << ' '
    37:       @complement_bin.include?(item) ? df.complement << c_str[item] : df.complement << ' '
    38:     end
    39:
    40:     df.p_left  = @primary_bin.first
    41:     df.p_right = @primary_bin.last
    42:     df.c_left  = @complement_bin.first
    43:     df.c_right = @complement_bin.last
    44:
    45:     df
    46:   end

[Validate]