Method: Bio::FlatFileIndex::Indexer.addindex_bdb
- Defined in:
- lib/bio/io/flatfile/indexer.rb
.addindex_bdb(db, flag, need_update, parser, options) ⇒ Object
def
476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 |
# File 'lib/bio/io/flatfile/indexer.rb', line 476 def self.addindex_bdb(db, flag, need_update, parser, ) DEBUG.print "reading files...\n" pn = db.primary pn.file.close pn.file.flag = flag db.secondary.each_files do |x| x.file.close x.file.flag = flag x.file.open x.file.close end need_update.each do |fileid| filename = db.fileids[fileid].filename parser.open_flatfile(fileid, filename) parser.each do |pos, len| p = parser.parse_primary #pn.file.add_exclusive(p, [ fileid, pos, len ]) pn.file.add_overwrite(p, [ fileid, pos, len ]) #DEBUG.print "#{p} #{fileid} #{pos} #{len}\n" parser.parse_secondary do |sn, sp| db.secondary[sn].file.add_nr(sp, p) #DEBUG.print "#{sp} #{p}\n" end end parser.close_flatfile end true end |