Bio:GFF::GFF3::Record::Target is a class to store data of “Target” attribute.
Creates a new Target object.
# File lib/bio/db/gff.rb, line 1197 def initialize(target_id, start, endpos, strand = nil) @target_id = target_id @start = start ? start.to_i : nil @end = endpos ? endpos.to_i : nil @strand = strand end
parses “target_id start end [strand]”-style string (for example, “ABC789 123 456 +”) and creates a new Target object.
# File lib/bio/db/gff.rb, line 1220 def self.parse(str) target_id, start, endpos, strand = str.split(/ +/, 4).collect { |x| unescape(x) } self.new(target_id, start, endpos, strand) end
Returns true if self == other. Otherwise, returns false.
# File lib/bio/db/gff.rb, line 1237 def ==(other) if other.class == self.class and other.target_id == self.target_id and other.start == self.start and other.end == self.end and other.strand == self.strand then true else false end end
returns a string
# File lib/bio/db/gff.rb, line 1227 def to_s i = escape_seqid(column_to_s(@target_id)) s = escape_attribute(column_to_s(@start)) e = escape_attribute(column_to_s(@end)) strnd = escape_attribute(@strand.to_s) strnd = " " + strnd unless strnd.empty? "#{i} #{s} #{e}#{strnd}" end
Generated with the Darkfish Rdoc Generator 2.