class Bio::FlatFileIndex::Indexer::Parser::BlastDefaultParser

Constants

NAMESTYLE
PRIMARY
SECONDARY

Public Class Methods

new(klass, pri_name = nil, sec_names = nil) click to toggle source
# File lib/bio/io/flatfile/indexer.rb, line 392
def initialize(klass, pri_name = nil, sec_names = nil)
  super()
  self.format = 'raw'
  self.dbclass = klass
  self.set_primary_namespace((pri_name or PRIMARY))
  unless sec_names then
    sec_names = []
    @namestyle.each_value do |x|
      sec_names << x.name if x.name != self.primary.name
    end
  end
  self.add_secondary_namespaces(*sec_names)
end

Public Instance Methods

open_flatfile(fileid, file) click to toggle source
# File lib/bio/io/flatfile/indexer.rb, line 405
def open_flatfile(fileid, file)
  super
  @flatfile.rewind
  @flatfile.dbclass = nil
  @flatfile.autodetect
  @flatfile.dbclass = self.dbclass unless @flatfile.dbclass
  @flatfile.rewind
  begin
    pos = @flatfile.pos
    line = @flatfile.gets
  end until (!line or line =~ /^T?BLAST/)
  @flatfile.pos = pos
end