module Bio::GFFbrowser::FastLineParser

The fast line parse takes the least number of actions to parse a GFF3 line (record).

Public Instance Methods

parse_attributes_fast(attribstring, options = {}) click to toggle source
# File lib/bio/db/gff/gff3parserec.rb, line 50
def parse_attributes_fast attribstring, options = {}
  Hash[attribstring.split(/;/).map { | a |
    a.split(/=/,2)
  }]
end
parse_line_fast(string, options = {}) click to toggle source

Returns a (partial) record, assuming it is a valid GFF3 format, no validation takes place, other than field counting (!)

Start and End are always set to int values. ID and Parent are returned in features.

The options define further parsing of fields. Options are

An array is returned, with appropriate fields

# File lib/bio/db/gff/gff3parserec.rb, line 40
def parse_line_fast string, options = {}
  fs = string.split(/\t/)
  if fs.size != 9 
    error "Record should have 9 fields, but has #{fs.size} <#{string}>"
    return nil
  end

  fs
end