class Bio::RestrictionEnzyme::Range::SequenceRange::Fragment

Constants

DisplayFragment

Attributes

size[R]

Public Class Methods

new( primary_bin, complement_bin ) click to toggle source
# File lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb, line 21
def initialize( primary_bin, complement_bin )
  @primary_bin = primary_bin
  @complement_bin = complement_bin
end

Public Instance Methods

for_display(p_str=nil, c_str=nil) click to toggle source
# File lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb, line 28
def for_display(p_str=nil, c_str=nil)
  df = DisplayFragment.new
  df.primary = ''
  df.complement = ''

  both_bins = @primary_bin + @complement_bin
  both_bins.each do |item|
    @primary_bin.include?(item) ? df.primary << p_str[item] : df.primary << ' '
    @complement_bin.include?(item) ? df.complement << c_str[item] : df.complement << ' '
  end
  
  df.p_left  = @primary_bin.first
  df.p_right = @primary_bin.last
  df.c_left  = @complement_bin.first
  df.c_right = @complement_bin.last

  df
end