class Bio::GFF::GFF3::SequenceRegion
Stores meta-data “##sequence-region seqid start end”.
Attributes
end[RW]
end position
seqid[RW]
sequence ID
start[RW]
start position
Public Class Methods
new(seqid, start, endpos)
click to toggle source
creates a new SequenceRegion class
# File lib/bio/db/gff.rb, line 1060 def initialize(seqid, start, endpos) @seqid = seqid @start = start ? start.to_i : nil @end = endpos ? endpos.to_i : nil end
parse(str)
click to toggle source
parses given string and returns SequenceRegion class
# File lib/bio/db/gff.rb, line 1067 def self.parse(str) dummy, seqid, start, endpos = str.chomp.split(/\s+/, 4).collect { |x| unescape(x) } self.new(seqid, start, endpos) end
Public Instance Methods
==(other)
click to toggle source
Returns true if self == other. Otherwise, returns false.
# File lib/bio/db/gff.rb, line 1091 def ==(other) if other.class == self.class and other.seqid == self.seqid and other.start == self.start and other.end == self.end then true else false end end
to_s()
click to toggle source
string representation
# File lib/bio/db/gff.rb, line 1083 def to_s i = escape_seqid(column_to_s(@seqid)) s = escape_seqid(column_to_s(@start)) e = escape_seqid(column_to_s(@end)) "##sequence-region #{i} #{s} #{e}\n" end