Class: Bio::FlatFileIndex::Indexer::Parser::EMBLParser

Inherits:
TemplateParser show all
Defined in:
lib/bio/io/flatfile/indexer.rb

Overview

class GenPeptParser

Direct Known Subclasses

SPTRParser

Constant Summary

NAMESTYLE =
NameSpaces.new(
             NameSpace.new( 'ID', Proc.new { |x| x.entry_id } ),
             NameSpace.new( 'AC', Proc.new { |x| x.accessions } ),
             NameSpace.new( 'SV', Proc.new { |x| x.sv } ),
             NameSpace.new( 'DR', Proc.new { |x|
                             y = []
                             x.dr.each_value { |z| y << z }
                             y.flatten!
                             y.find_all { |z| z.length > 1 } }
                           )
)
PRIMARY =
'ID'
SECONDARY =
[ 'AC', 'SV' ]

Instance Attribute Summary

Attributes inherited from TemplateParser

#dbclass, #errorlog, #fileid, #format, #primary, #secondary

Instance Method Summary (collapse)

Methods inherited from TemplateParser

#add_secondary_namespaces, #close_flatfile, #each, #open_flatfile, #parse_primary, #parse_secondary, #set_primary_namespace

Constructor Details

- (EMBLParser) initialize(pri_name = nil, sec_names = nil)



219
220
221
222
223
224
225
226
227
228
# File 'lib/bio/io/flatfile/indexer.rb', line 219

def initialize(pri_name = nil, sec_names = nil)
  super()
  self.format = 'embl'
  self.dbclass = Bio::EMBL
  self.set_primary_namespace((pri_name or PRIMARY))
  unless sec_names then
    sec_names = self.class::SECONDARY
  end
  self.add_secondary_namespaces(*sec_names)
end