//SequenceFinder.cpp //Coded by Vishakh (vishakh@uci.edu) //ICS 175A, Winter 2004 //Project: Motif detection in yeast //Purpose: Calculates scores for substrings of gene families, finds sequences and constructs //probability matrices. #include #include #include #include "dtable.h" #include "dstring.h" #include "ProbMatrix.h" #include "Permutation.h" using namespace std; struct MatrixPair { DString name; double score; }; class SequenceFinder { public: SequenceFinder(); void setKmerSize(int n); void setOccurenceLimit(int n); void assignScores(DTable& dt_big, DTable& dt_sml); void HTMLOutput(int numOfKmers, char *mainPageName); void sortTable(); void printTopScores(int n); void createMatrices(vector > genes); vector getTable(); vector getMatrices(); // math functions defined double poissonDistribution(double lambda, double poisson_k); double binomialDistribution(double bin_k, double bin_n, double bin_p); double inverseLog10(double log); double logOfFactorial(double n); double factorial(double n); private: vector table_sml; vector table_big; vector matrices; int KMER_SIZE; int OCCURENCE_LIMIT; };