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 1191 1191: def self.parse(str) 1192: target_id, start, endpos, strand = 1193: str.split(/ +/, 4).collect { |x| URI.unescape(x) } 1194: self.new(target_id, start, endpos, strand) 1195: end
Returns true if self == other. Otherwise, returns false.
# File lib/bio/db/gff.rb, line 1208 1208: def ==(other) 1209: if other.class == self.class and 1210: other.target_id == self.target_id and 1211: other.start == self.start and 1212: other.end == self.end and 1213: other.strand == self.strand then 1214: true 1215: else 1216: false 1217: end 1218: end
returns a string
# File lib/bio/db/gff.rb, line 1198 1198: def to_s 1199: i = escape_seqid(column_to_s(@target_id)) 1200: s = escape_attribute(column_to_s(@start)) 1201: e = escape_attribute(column_to_s(@end)) 1202: strnd = escape_attribute(@strand.to_s) 1203: strnd = " " + strnd unless strnd.empty? 1204: "#{i} #{s} #{e}#{strnd}" 1205: end