class Bio::GFF

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

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.

Attributes

records[RW]

An array of Bio::GFF::Record objects.

Public Class Methods

new(str = '') click to toggle source

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

# File lib/bio/db/gff.rb, line 63
def initialize(str = '')
  @records = Array.new
  str.each_line do |line|
    @records << Record.new(line)
  end
end