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.

### Methods

id id= new parse parse to_s

### Included Modules

GFF3::Escape

### Classes and Modules

Class Bio::GFF::GFF3::Record::Gap
Class Bio::GFF::GFF3::Record::Target

### External Aliases

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=

### Public Class methods

new(*arg)

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)

[Source]

          # File lib/bio/db/gff.rb, line 1157
    1157:         def initialize(*arg)
    1158:           super(*arg)
    1159:         end

parse(str)

Parses a GFF3-formatted line and returns a new Bio::GFF::GFF3::Record object.

[Source]

          # File lib/bio/db/gff.rb, line 1136
    1136:         def self.parse(str)
    1137:           self.new.parse(str)
    1138:         end

### Public Instance methods

id()

shortcut to the ID attribute

[Source]

          # File lib/bio/db/gff.rb, line 1110
    1110:         def id
    1111:           get_attribute('ID')
    1112:         end

id=(str)

set ID attribute

[Source]

          # File lib/bio/db/gff.rb, line 1115
    1115:         def id=(str)
    1116:           set_attribute('ID', str)
    1117:         end

parse(string)

Parses a GFF3-formatted line and stores data from the string. Note that all existing data is wiped out.

[Source]

          # File lib/bio/db/gff.rb, line 1163
    1163:         def parse(string)
    1164:           super
    1165:         end

to_s()

Return the record as a GFF3 compatible string

[Source]

          # 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

[Validate]