Class | Bio::GFF
In: | lib/bio/db/gff.rb
Parent: | Object

## DESCRIPTION

The Bio::GFF and Bio::GFF::Record classes describe data contained in a GFF-formatted file. For information on the GFF format, see www.sanger.ac.uk/Software/formats/GFF/. Data are represented in tab- delimited format, including

- seqname
- source
- feature
- start
- end
- score
- strand
- frame
- attributes (optional)

For example:

     SEQ1     EMBL        atg       103   105     .       +       0
     SEQ1     EMBL        exon      103   172     .       +       0
     SEQ1     EMBL        splice5   172   173     .       +       .
     SEQ1     netgene     splice5   172   173     0.94    +       .
     SEQ1     genie       sp5-20    163   182     2.3     +       .
     SEQ1     genie       sp5-10    168   177     2.1     +       .
     SEQ1     grail       ATG       17    19      2.1     -       0

The Bio::GFF object is a container for Bio::GFF::Record objects, each representing a single line in the GFF file.

### Methods

new

### Classes and Modules

Class Bio::GFF::GFF2
Class Bio::GFF::GFF3
Class Bio::GFF::Record

### Attributes

records | [RW] | An array of Bio::GFF::Record objects.

### Public Class methods

new(str = '')

Creates a Bio::GFF object by building a collection of Bio::GFF::Record objects.

Create a Bio::GFF object the hard way

     this_gff =  "SEQ1\tEMBL\tatg\t103\t105\t.\t+\t0\n"
     this_gff << "SEQ1\tEMBL\texon\t103\t172\t.\t+\t0\n"
     this_gff << "SEQ1\tEMBL\tsplice5\t172\t173\t.\t+\t.\n"
     this_gff << "SEQ1\tnetgene\tsplice5\t172\t173\t0.94\t+\t.\n"
     this_gff << "SEQ1\tgenie\tsp5-20\t163\t182\t2.3\t+\t.\n"
     this_gff << "SEQ1\tgenie\tsp5-10\t168\t177\t2.1\t+\t.\n"
     this_gff << "SEQ1\tgrail\tATG\t17\t19\t2.1\t-\t0\n"
     p Bio::GFF.new(this_gff)

or create one based on a GFF-formatted file:

     p Bio::GFF.new(File.open('my_data.gff')

Arguments:

- str: string in GFF format

Returns: | Bio::GFF object

[Source]

        # File lib/bio/db/gff.rb, line 64
    64:     def initialize(str = '')
    65:       @records = Array.new
    66:       str.each_line do |line|
    67:         @records << Record.new(line)
    68:       end
    69:     end

[Validate]