Class: Bio::GFF::Record

Inherits:
Object show all
Defined in:
lib/bio/db/gff.rb

Overview

Represents a single line of a GFF-formatted file. See Bio::GFF for more information.

Direct Known Subclasses

GFF2::Record

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Record) initialize(str)

Creates a Bio::GFF::Record object. Is typically not called directly, but is called automatically when creating a Bio::GFF object.


Arguments:

  • str: a tab-delimited line in GFF format



126
127
128
129
130
131
132
# File 'lib/bio/db/gff.rb', line 126

def initialize(str)
  @comment = str.chomp[/#.*/]
  return if /^#/.match(str)
  @seqname, @source, @feature, @start, @end, @score, @strand, @frame,
    attributes, = str.chomp.split("\t")
  @attributes = parse_attributes(attributes) if attributes
end

Instance Attribute Details

- (Object) attributes

List of tag=value pairs (e.g. to store name of the feature: ID=my_id)



104
105
106
# File 'lib/bio/db/gff.rb', line 104

def attributes
  @attributes
end

- (Object) comment

Comments for the GFF record



107
108
109
# File 'lib/bio/db/gff.rb', line 107

def comment
  @comment
end

- (Object) end

End position of feature on reference sequence



92
93
94
# File 'lib/bio/db/gff.rb', line 92

def end
  @end
end

- (Object) feature

Name of the feature



86
87
88
# File 'lib/bio/db/gff.rb', line 86

def feature
  @feature
end

- (Object) frame

For features of type 'exon': indicates where feature begins in the reading frame



101
102
103
# File 'lib/bio/db/gff.rb', line 101

def frame
  @frame
end

- (Object) score

Score of annotation (e.g. e-value for BLAST search)



95
96
97
# File 'lib/bio/db/gff.rb', line 95

def score
  @score
end

- (Object) seqname

Name of the reference sequence



80
81
82
# File 'lib/bio/db/gff.rb', line 80

def seqname
  @seqname
end

- (Object) source

Name of the source of the feature (e.g. program that did prediction)



83
84
85
# File 'lib/bio/db/gff.rb', line 83

def source
  @source
end

- (Object) start

Start position of feature on reference sequence



89
90
91
# File 'lib/bio/db/gff.rb', line 89

def start
  @start
end

- (Object) strand

Strand that feature is located on



98
99
100
# File 'lib/bio/db/gff.rb', line 98

def strand
  @strand
end

Instance Method Details

- (Object) comments

“comments” is deprecated. Instead, use “comment”.



110
111
112
113
# File 'lib/bio/db/gff.rb', line 110

def comments
  #warn "#{self.class.to_s}#comments is deprecated. Instead, use \"comment\"." if $VERBOSE
  self.comment
end

- (Object) comments=(str)

“comments=” is deprecated. Instead, use “comment=”.



116
117
118
119
# File 'lib/bio/db/gff.rb', line 116

def comments=(str)
  #warn "#{self.class.to_s}#comments= is deprecated. Instead, use \"comment=\"." if $VERBOSE
  self.comment = str
end