Sha256: 251913874a9b57de89fbaf7580af66fbd4f7983d71137e2873ffff93e6f479c5

Contents?: true

Size: 548 Bytes

Versions: 5

Compression:

Stored size: 548 Bytes

Contents

module Scaffolder::GffRecordHelper

  def flip_strand
    self.strand = (self.strand == '+' ? '-' : '+')
  end

  def change_position_by(distance)
    self.start += distance
    self.end += distance
  end

  def reverse_complement_by(distance)
    self.end   = distance - (self.end - 1)
    self.start = distance - (self.start - 1)

    self.end, self.start = self.start, self.end
    self.flip_strand
  end

  def overlap?(*ranges)
    ranges.flatten.any? do |range|
      range.include?(self.start) || range.include?(self.end)
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
scaffolder-annotation-locator-0.2.0 lib/scaffolder/gff_record_helper.rb
scaffolder-annotation-locator-0.1.4 lib/scaffolder/gff_record_helper.rb
scaffolder-annotation-locator-0.1.2 lib/scaffolder/gff_record_helper.rb
scaffolder-annotation-locator-0.1.1 lib/scaffolder/gff_record_helper.rb
scaffolder-annotation-locator-0.1.0 lib/scaffolder/gff_record_helper.rb