Sha256: 808a257e3cb7a0d06eec96f464c3d79ae78a0eb1d8537b5c62c9bc39ec0fe7c2

Contents?: true

Size: 1.25 KB

Versions: 12

Compression:

Stored size: 1.25 KB

Contents

#
# bio/util/restriction_enzyme/range/sequence_range/fragment.rb - 
#
# Author::    Trevor Wennblom  <mailto:trevor@corevx.com>
# Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com)
# License::   The Ruby License
#

module Bio

require 'bio/util/restriction_enzyme' unless const_defined?(:RestrictionEnzyme)

class RestrictionEnzyme
class Range
class SequenceRange

class Fragment

  attr_reader :size

  def initialize( primary_bin, complement_bin )
    @primary_bin = primary_bin
    @complement_bin = complement_bin
  end

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

  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
end # Fragment
end # SequenceRange
end # Range
end # RestrictionEnzyme
end # Bio

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
bio-2.0.5 lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb
bio-2.0.4 lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb
bio-2.0.3 lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb
bio-2.0.2 lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb
bio-2.0.1 lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb
bio-2.0.0 lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb
bio-1.6.0.pre.20181210 lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb
bio-1.5.2 lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb
bio-1.5.1 lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb
bio-1.5.0 lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb
bio-1.4.3.0001 lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb
bio-1.4.3 lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb