Class: EupathDBGFFRecord

Inherits:
JgiGffRecord show all
Defined in:
lib/eupathdb_gff.rb

Constant Summary

Constants inherited from JgiGffRecord

JgiGffRecord::ATTRIBUTES_COL, JgiGffRecord::END_COL, JgiGffRecord::FEATURE_COL, JgiGffRecord::FRAME_COL, JgiGffRecord::SCORE_COL, JgiGffRecord::SEQNAME_COL, JgiGffRecord::SOURCE_COL, JgiGffRecord::START_COL, JgiGffRecord::STRAND_COL

Instance Method Summary collapse

Methods inherited from JgiGffRecord

#initialize, #parse_mandatory_columns, #to_s

Constructor Details

This class inherits a constructor from JgiGffRecord

Instance Method Details

#parse_attributes(attributes_string) ⇒ Object

eg. ID=apidb|X95275;Name=X95275;description=Plasmodium+falciparum+complete+gene+map+of+plastid-like+DNA+%28IR-A%29.



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/eupathdb_gff.rb', line 188

def parse_attributes(attributes_string)
  @attributes = Hash.new
  parts = attributes_string.split ';'
  if parts
    parts.each {|couple|
      cs = couple.split '='
      #deal with attributes like 'Note=;' by ignoring them
      # I once found one of these in the yeast genome gff
      next if cs.length == 1 and couple.match(/=/)
      if cs.length != 2
        raise Exception, "Badly handled attributes bit in api db gff: '#{cs}' from '#{attributes_string}'"
      end
      @attributes[cs[0]] = cs[1]
    }
  end
end