Class: Bio::NCBIDB

Inherits:
DB show all
Defined in:
lib/bio/db.rb,
lib/bio/db/genbank/common.rb

Overview

Stores a NCBI style (GenBank, KEGG etc.) entry.

Direct Known Subclasses

GenBank, GenPept, KEGGDB, LITDB, MEDLINE

Defined Under Namespace

Modules: Common

Instance Method Summary collapse

Methods inherited from DB

#entry_id, #exists?, #fetch, #get, open, #tags

Constructor Details

#initialize(entry, tagsize) ⇒ NCBIDB

The entire entry is passed as a String. The length of the tag field is passed as an Integer. Parses the entry roughly by the entry2hash method and returns a database object.



256
257
258
259
260
# File 'lib/bio/db.rb', line 256

def initialize(entry, tagsize)
  @tagsize = tagsize
  @orig = entry2hash(entry.strip) # Hash of the original entry
  @data = {}        # Hash of the parsed entry
end