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 1130 1130: def initialize(*arg) 1131: super(*arg) 1132: end
Parses a GFF3-formatted line and returns a new Bio::GFF::GFF3::Record object.
# File lib/bio/db/gff.rb, line 1109 1109: def self.parse(str) 1110: self.new.parse(str) 1111: end
shortcut to the ID attribute
# File lib/bio/db/gff.rb, line 1083 1083: def id 1084: get_attribute('ID') 1085: end
set ID attribute
# File lib/bio/db/gff.rb, line 1088 1088: def id=(str) 1089: set_attribute('ID', str) 1090: end
Return the record as a GFF3 compatible string
# File lib/bio/db/gff.rb, line 1141 1141: def to_s 1142: cmnt = if @comment and !@comment.to_s.strip.empty? then 1143: @comment.gsub(/[\r\n]+/, ' ') 1144: else 1145: false 1146: end 1147: return "\##{cmnt}\n" if self.comment_only? and cmnt 1148: [ 1149: escape_seqid(column_to_s(@seqname)), 1150: escape(column_to_s(@source)), 1151: escape(column_to_s(@feature)), 1152: escape(column_to_s(@start)), 1153: escape(column_to_s(@end)), 1154: escape(column_to_s(@score)), 1155: escape(column_to_s(@strand)), 1156: escape(column_to_s(@frame)), 1157: attributes_to_s(@attributes) 1158: ].join("\t") + 1159: (cmnt ? "\t\##{cmnt}\n" : "\n") 1160: end