Class | Bio::GFF::GFF3::SequenceRegion
In: | lib/bio/db/gff.rb
Parent: | Object

Stores meta-data "#sequence-region seqid start end".

### Methods

== new parse to_s

### Included Modules

Escape

### Attributes

end | [RW] | end position
seqid | [RW] | sequence ID
start | [RW] | start position

### Public Class methods

new(seqid, start, endpos)

creates a new SequenceRegion class

[Source]

          # File lib/bio/db/gff.rb, line 1060
    1060:         def initialize(seqid, start, endpos)
    1061:           @seqid = seqid
    1062:           @start = start ? start.to_i : nil
    1063:           @end = endpos ? endpos.to_i : nil
    1064:         end

parse(str)

parses given string and returns SequenceRegion class

[Source]

          # File lib/bio/db/gff.rb, line 1067
    1067:         def self.parse(str)
    1068:           dummy, seqid, start, endpos =
    1069:             str.chomp.split(/\s+/, 4).collect { |x| unescape(x) }
    1070:           self.new(seqid, start, endpos)
    1071:         end

### Public Instance methods

==(other)

Returns true if self == other. Otherwise, returns false.

[Source]

          # File lib/bio/db/gff.rb, line 1091
    1091:         def ==(other)
    1092:           if other.class == self.class and
    1093:               other.seqid == self.seqid and
    1094:               other.start == self.start and
    1095:               other.end == self.end then
    1096:             true
    1097:           else
    1098:             false
    1099:           end
    1100:         end

to_s()

string representation

[Source]

          # File lib/bio/db/gff.rb, line 1083
    1083:         def to_s
    1084:           i = escape_seqid(column_to_s(@seqid))
    1085:           s = escape_seqid(column_to_s(@start))
    1086:           e = escape_seqid(column_to_s(@end))
    1087:           "##sequence-region #{i} #{s} #{e}\n"
    1088:         end

[Validate]