//dtable.cpp //Coded by Jeff Weiss (jmweiss@uci.edu) //ICS 175A, Winter 2004 //Project: Motif detection in yeast //Purpose: provides a hash table of genomicPairs, to allow for storage of genomic //sequences and their realted statistical values as they relate to this project #ifndef _D_TABLE_H_ // may be included more than once #define _D_TABLE_H_ #include #include "dstring.h" #include "genomicPair.h" #include #include using namespace std; class DTable { public: DTable(const DTable & rhs); DTable(); int getCount(DString toFind); void add(DString toAdd); int getSequenceRepresentedLength(); void setSequenceRepresentedLength(int newLength); void setNumOfSequences(int newLength); int getNumOfSequences(); DTable operator = (const DTable & rhs); void print(); vector flatten(); void writeToFile(const char *fileName); void loadFromFile(const char *fileName); int getTotalSequences(); ~DTable(); private: void add(GenomicPair newPair); static const int LOCAL_MAX_TABLE_SIZE=10000; int MAX_TABLE_SIZE; int getHash(DString toHash); int sequenceRepresentedLength; int numOfSequences; int totalSequenceCount; //start counts at 1 int totalUniqueSequences; //start counts at 1 typedef vector sublist; vector genomicSequenceList; ofstream outputFile; ifstream inputFile; }; #endif