Class | Bio::GFF::GFF3::Record::Target |
In: |
lib/bio/db/gff.rb
|
Parent: | Object |
Bio:GFF::GFF3::Record::Target is a class to store data of "Target" attribute.
end | [RW] | end position |
start | [RW] | start position |
strand | [RW] | strand (optional). Normally, "+" or "-", or nil. |
target_id | [RW] | target ID |
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 1220: def self.parse(str) 1221: target_id, start, endpos, strand = 1222: str.split(/ +/, 4).collect { |x| unescape(x) } 1223: self.new(target_id, start, endpos, strand) 1224: end
Returns true if self == other. Otherwise, returns false.
# File lib/bio/db/gff.rb, line 1237 1237: def ==(other) 1238: if other.class == self.class and 1239: other.target_id == self.target_id and 1240: other.start == self.start and 1241: other.end == self.end and 1242: other.strand == self.strand then 1243: true 1244: else 1245: false 1246: end 1247: end
returns a string
# File lib/bio/db/gff.rb, line 1227 1227: def to_s 1228: i = escape_seqid(column_to_s(@target_id)) 1229: s = escape_attribute(column_to_s(@start)) 1230: e = escape_attribute(column_to_s(@end)) 1231: strnd = escape_attribute(@strand.to_s) 1232: strnd = " " + strnd unless strnd.empty? 1233: "#{i} #{s} #{e}#{strnd}" 1234: end