Package org.biojava.bio.program.ssaha
Class NIODataStoreFactory
- java.lang.Object
-
- org.biojava.bio.program.ssaha.NIODataStoreFactory
-
- All Implemented Interfaces:
DataStoreFactory
public class NIODataStoreFactory extends java.lang.Object implements DataStoreFactory
Builder for a datastore that has no practical file size limit.
This implementation of the data store factory uses longs as indecies internaly, so can be used with files exceeding 2 gigs in size.
The data store file has the following structure.
file: header, hash table, nameTable, hitTable header: long hashTablePos, // byte offset in file long hitTablePos, // byte offset in file long nameTablePos, // byte offset in file int wordLength, int serializedPackingLength, byte[] serializedPacking hashTable: long hashTableLength, long[hashTableLength] hits // byte offset into hitTable nameTable: int nameTableSize, // size in bytes (short nameLength, char[nameLength] name)[nameTableSize] names hitTable: long hitTableSize, // size in bytes hitTableRecord[hitTableSize] hits hitTableRecord: int hitCount, hitRecord[hitCount] hit hit: long seqOffset, // byte offset into sequence names table int pos // biological position in sequence
- Author:
- Matthew Pocock
-
-
Constructor Summary
Constructors Constructor Description NIODataStoreFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataStore
buildDataStore(java.io.File storeFile, SequenceDB seqDB, Packing packing, int wordLength, int threshold)
Build a new DataStore.DataStore
getDataStore(java.io.File storeFile)
Get a pre-built data store associated with a file.
-
-
-
Constructor Detail
-
NIODataStoreFactory
public NIODataStoreFactory()
-
-
Method Detail
-
getDataStore
public DataStore getDataStore(java.io.File storeFile) throws java.io.IOException
Description copied from interface:DataStoreFactory
Get a pre-built data store associated with a file.- Specified by:
getDataStore
in interfaceDataStoreFactory
- Parameters:
storeFile
- the File to map in as a data store- Returns:
- the DataStore made by mapping the file
- Throws:
java.io.IOException
- if the file could not be mapped
-
buildDataStore
public DataStore buildDataStore(java.io.File storeFile, SequenceDB seqDB, Packing packing, int wordLength, int threshold) throws IllegalAlphabetException, java.io.IOException, BioException
Description copied from interface:DataStoreFactory
Build a new DataStore.- Specified by:
buildDataStore
in interfaceDataStoreFactory
- Parameters:
storeFile
- the file to store the data storeseqDB
- the SequenceDB to store in the data storepacking
- the Packing used to bit-encode the sequenceswordLength
- the number of symbols per wordthreshold
- the number of times a word must appear to be ignored- Throws:
IllegalAlphabetException
- if the packing does not agree with the sequencesBioException
- if there is a problem building the data storejava.io.IOException
-
-