class Bio::GFF::GFF3::Record::Target
Bio:GFF::GFF3::Record::Target is a class to store data of “Target” attribute.
Attributes
end position
start position
strand (optional). Normally, “+” or “-”, or nil.
target ID
Public Class Methods
Source
# File lib/bio/db/gff.rb 1205 def initialize(target_id, start, endpos, strand = nil) 1206 @target_id = target_id 1207 @start = start ? start.to_i : nil 1208 @end = endpos ? endpos.to_i : nil 1209 @strand = strand 1210 end
Creates a new Target
object.
Source
# File lib/bio/db/gff.rb 1228 def self.parse(str) 1229 target_id, start, endpos, strand = 1230 str.split(/ +/, 4).collect { |x| unescape(x) } 1231 self.new(target_id, start, endpos, strand) 1232 end
parses “target_id start end [strand]”-style string (for example, “ABC789 123 456 +”) and creates a new Target
object.
Public Instance Methods
Source
# File lib/bio/db/gff.rb 1245 def ==(other) 1246 if other.class == self.class and 1247 other.target_id == self.target_id and 1248 other.start == self.start and 1249 other.end == self.end and 1250 other.strand == self.strand then 1251 true 1252 else 1253 false 1254 end 1255 end
Returns true if self == other. Otherwise, returns false.
Source
# File lib/bio/db/gff.rb 1235 def to_s 1236 i = escape_seqid(column_to_s(@target_id)) 1237 s = escape_attribute(column_to_s(@start)) 1238 e = escape_attribute(column_to_s(@end)) 1239 strnd = escape_attribute(@strand.to_s) 1240 strnd = " " + strnd unless strnd.empty? 1241 "#{i} #{s} #{e}#{strnd}" 1242 end
returns a string