Class | Bio::GFF::GFF3::Record |
In: |
lib/bio/db/gff.rb
|
Parent: | GFF2::Record |
Represents a single line of a GFF3-formatted file. See Bio::GFF::GFF3 for more information.
seqname | -> | seqid |
aliases for Column 1 (formerly "seqname") | ||
seqname= | -> | seqid= |
feature | -> | feature_type |
aliases for Column 3 (formerly "feature"). In the GFF3 document song.sourceforge.net/gff3.shtml, column3 is called "type", but we used "feature_type" because "type" is already used by Ruby itself. | ||
feature= | -> | feature_type= |
frame | -> | phase |
aliases for Column 8 | ||
frame= | -> | phase= |
Creates a Bio::GFF::GFF3::Record object. Is typically not called directly, but is called automatically when creating a Bio::GFF::GFF3 object.
Arguments:
Arguments:
# File lib/bio/db/gff.rb, line 1157 1157: def initialize(*arg) 1158: super(*arg) 1159: end
Parses a GFF3-formatted line and returns a new Bio::GFF::GFF3::Record object.
# File lib/bio/db/gff.rb, line 1136 1136: def self.parse(str) 1137: self.new.parse(str) 1138: end
shortcut to the ID attribute
# File lib/bio/db/gff.rb, line 1110 1110: def id 1111: get_attribute('ID') 1112: end
set ID attribute
# File lib/bio/db/gff.rb, line 1115 1115: def id=(str) 1116: set_attribute('ID', str) 1117: end
Return the record as a GFF3 compatible string
# File lib/bio/db/gff.rb, line 1168 1168: def to_s 1169: cmnt = if defined?(@comment) and @comment and 1170: !@comment.to_s.strip.empty? then 1171: @comment.gsub(/[\r\n]+/, ' ') 1172: else 1173: false 1174: end 1175: return "\##{cmnt}\n" if self.comment_only? and cmnt 1176: [ 1177: escape_seqid(column_to_s(@seqname)), 1178: escape(column_to_s(@source)), 1179: escape(column_to_s(@feature)), 1180: escape(column_to_s(@start)), 1181: escape(column_to_s(@end)), 1182: escape(column_to_s(@score)), 1183: escape(column_to_s(@strand)), 1184: escape(column_to_s(@frame)), 1185: attributes_to_s(@attributes) 1186: ].join("\t") + 1187: (cmnt ? "\t\##{cmnt}\n" : "\n") 1188: end