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 1130
    1130:         def initialize(*arg)
    1131:           super(*arg)
    1132:         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 1109
    1109:         def self.parse(str)
    1110:           self.new.parse(str)
    1111:         end

### Public Instance methods

id()

shortcut to the ID attribute

[Source]

          # File lib/bio/db/gff.rb, line 1083
    1083:         def id
    1084:           get_attribute('ID')
    1085:         end

id=(str)

set ID attribute

[Source]

          # File lib/bio/db/gff.rb, line 1088
    1088:         def id=(str)
    1089:           set_attribute('ID', str)
    1090:         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 1136
    1136:         def parse(string)
    1137:           super
    1138:         end

to_s()

Return the record as a GFF3 compatible string

[Source]

          # 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

[Validate]