class Bio::GFF::GFF3::Record
Represents a single line of a GFF3-formatted file. See Bio::GFF::GFF3
for more information.
Public Class Methods
Source
# File lib/bio/db/gff.rb 1165 def initialize(*arg) 1166 super(*arg) 1167 end
Creates a Bio::GFF::GFF3::Record
object. Is typically not called directly, but is called automatically when creating a Bio::GFF::GFF3
object.
Arguments:
-
str: a tab-delimited line in
GFF3
format
Arguments:
-
seqid: sequence ID (String or nil)
-
source: source (String or nil)
-
feature_type: type of feature (String)
-
start_position: start (Integer)
-
end_position: end (Integer)
-
score: score (Float or nil)
-
strand: strand (String or nil)
-
phase: phase (Integer or nil)
-
attributes: attributes (Array or nil)
Bio::GFF::GFF2::Record::new
Source
# File lib/bio/db/gff.rb 1144 def self.parse(str) 1145 self.new.parse(str) 1146 end
Parses a GFF3-formatted line and returns a new Bio::GFF::GFF3::Record
object.
Public Instance Methods
Source
# File lib/bio/db/gff.rb 1118 def id 1119 get_attribute('ID') 1120 end
shortcut to the ID attribute
Source
# File lib/bio/db/gff.rb 1123 def id=(str) 1124 set_attribute('ID', str) 1125 end
set ID attribute
Source
# File lib/bio/db/gff.rb 1171 def parse(string) 1172 super 1173 end
Parses a GFF3-formatted line and stores data from the string. Note that all existing data is wiped out.
Bio::GFF::GFF2::Record::parse
Source
# File lib/bio/db/gff.rb 1176 def to_s 1177 cmnt = if defined?(@comment) and @comment and 1178 !@comment.to_s.strip.empty? then 1179 @comment.gsub(/[\r\n]+/, ' ') 1180 else 1181 false 1182 end 1183 return "\##{cmnt}\n" if self.comment_only? and cmnt 1184 [ 1185 escape_seqid(column_to_s(@seqname)), 1186 escape(column_to_s(@source)), 1187 escape(column_to_s(@feature)), 1188 escape(column_to_s(@start)), 1189 escape(column_to_s(@end)), 1190 escape(column_to_s(@score)), 1191 escape(column_to_s(@strand)), 1192 escape(column_to_s(@frame)), 1193 attributes_to_s(@attributes) 1194 ].join("\t") + 1195 (cmnt ? "\t\##{cmnt}\n" : "\n") 1196 end
Return the record as a GFF3
compatible string