001package org.biojava.bio.program.ssaha;
002
003import java.io.File;
004import java.io.IOException;
005
006import org.biojava.bio.BioException;
007import org.biojava.bio.seq.db.SequenceDB;
008import org.biojava.bio.symbol.IllegalAlphabetException;
009import org.biojava.bio.symbol.Packing;
010
011/**
012 * <p>
013 * Builder for a data store.
014 * </p>
015 *
016 * @author Matthew Pocock
017 */
018public interface DataStoreFactory {
019  /**
020   * Get a pre-built data store associated with a file.
021   *
022   * @param storeFile  the File to map in as a data store
023   * @return the DataStore made by mapping the file
024   *
025   * @throws IOException if the file could not be mapped
026   */
027  public DataStore getDataStore(File storeFile)
028  throws IOException;
029  
030  /**
031   * Build a new DataStore.
032   *
033   * @param storeFile  the file to store the data store
034   * @param seqDB  the SequenceDB to store in the data store
035   * @param packing  the Packing used to bit-encode the sequences
036   * @param wordLength the number of symbols per word
037   * @param threshold  the number of times a word must appear to be ignored
038   *
039   * @throws IllegalAlphabetException if the packing does not agree with
040   *         the sequences
041   * @throws BioException if there is a problem building the data store
042   */
043  public DataStore buildDataStore(
044    File storeFile,
045    SequenceDB seqDB,
046    Packing packing,
047    int wordLength,
048    int threshold
049  ) throws
050    IllegalAlphabetException,
051    IOException,
052    BioException;
053}