X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=calculator.h;h=5aba3d29b1c15480ef8b8b29674b6a24d45db9e7;hp=6791d830f01c69492251b6110ebe5ba3d04a50a0;hb=b206f634aae1b4ce13978d203247fb64757d5482;hpb=f6b5fea6e0fcc395235dfbfb466b9b6a031b540a diff --git a/calculator.h b/calculator.h index 6791d83..5aba3d2 100644 --- a/calculator.h +++ b/calculator.h @@ -27,6 +27,8 @@ public: Calculator(string n, int c, bool f, bool a) : name(n), cols(c), multiple(f), needsAll(a) { m = MothurOut::getInstance(); }; virtual EstOutput getValues(SAbundVector*) = 0; virtual EstOutput getValues(vector) = 0; + //optional calc that returns the otus labels of shared otus + virtual EstOutput getValues(vector sv , vector&) { data = getValues(sv); return data; } virtual void print(ostream& f) { f.setf(ios::fixed, ios::floatfield); f.setf(ios::showpoint); f << data[0]; for(int i=1;i); //This returns the maximum value in the vector. int numNZ(vector); //This returns the number of non-zero values in the vector. double numNZ(vector); //This returns the number of non-zero values in the vector. - //double numPos(vector); //This returns the number of positive values in the vector. - //double findMaxDiff(vector, vector); //This returns the absolute value of the maximum difference between the two vectors. - //double findDStat(vector, vector, double); //This returns the D-Statistic of the two vectors with the given total number of species. - //vector findQuartiles(vector); //This returns a vector with the first element being the index of the lower quartile of the vector and the second element being the index of the upper quartile of the vector. - //vector add(vector, double); //This adds the given number to every element in the given vector and returns the new vector. - //vector multiply(vector, double); //This multiplies every element in the given vector by the given number and returns the new vector. - //vector power(vector, double); //This raises every element in the given vector to the given number and returns the new vector. - //vector addVecs(vector,vector); //The given vectors must be the same size. This adds the ith element of the first given vector to the ith element of the second given vector and returns the new vector. - //vector multVecs(vector,vector); //The given vectors must be the same size. This multiplies the ith element of the first given vector to the ith element of the second given vector and returns the new vector. - //vector remDup(vector); //This returns a vector that contains 1 of each unique element in the given vector. The order of the elements is not changed. - //vector genCVec(vector); //This returns a cumilative vector of the given vector. The ith element of the returned vector is the sum of all the elements in the given vector up to i. - //vector genRelVec(vector); //This finds the sum of all the elements in the given vector and then divides the ith element in the given vector by that sum and then puts the result into a new vector, which is returned after all of the elements in the given vector have been used. - ///vector genDiffVec(vector, vector);//This subtracts the ith element of the second given vector from the ith element of the first given vector and returns the new vector. - //vector genCSVec(vector);//This calculates the number of species that have the same number of individuals as the ith element of the given vector and then returns a cumulative vector. - //vector genTotVec(vector >); //This adds up the ith element of all the columns and puts that value into a new vector. It those this for all the rows and then returns the new vector. - //vector quicksort(vector); //This sorts the given vector from highest to lowest and returns the sorted vector. - //vector > gen2DVec(vector, int, int); //(vector, #rows/columns, 0 if the second parameter was rows, 1 if the second parameter was columns) Transforms a single vector that was formatted like a table into a 2D vector. - //vector getSData(char[]);//This takes a file name as a parameter and reads all of the data in the file into a vector. }; -/**************************************************************************************************/ - -/*This Class is similar to the GeometricSeries.h class. It calculates -the broken stick distribution of the table and prints the D-Statistic -and the confidence limits for the Kolmogorov-Smirnov 1-Sample test -with a 95% confidence level. - -class BrokenStick -{ - public: - void doBStick(vector); -}; - -//**************************************************************************************************/ -/*This Class calculates the geometric series distribution for the data. -It prints the D-Statistic and the critical values for the Kolmogorov-Smirnov -1-sample test at the 95% confidence interval.*/ - -/*class GeometricSeries -{ - public: - void doGeomTest(vector); -};*/ - -/************************************************************************************************** -//This Class calculates the jackknifed estimate of the data and -//prints it and the confidence limits at a chosen confidence level. - -class Jackknifing -{ - public: - void doJK(vector, double); -}; -/************************************************************************************************** -/*This Class stores calculates the Kolmogorov-Smirnov 2-Sample test between two samples. -It prints the D-Statistic and the critical value for the test at -the 90% and 95% confidence interval. - -class KS2SampleTest -{ - public: - void doKSTest(vector, vector); -}; - -/************************************************************************************************** -//This Class calculates and prints the Q-Statistic for the data. -class QStatistic -{ - public: - void doQStat(vector); -}; -/************************************************************************************************** -class SSBPDiversityIndices -{ - public: - void doSSBP(vector); - double getShan(vector vec);//The Shannon Index - double getSimp(vector vec);//The Simpson Index - double getBP(vector vec);//The Berger-Parker Index -}; /**************************************************************************************************/ //This Class stores the table of the confidence limits of the Student-T distribution. class TDTable @@ -154,26 +78,6 @@ class TDTable public: double getConfLimit(int,int); }; - -/************************************************************************************************** -//This Class stores the table of the confidence limits of the One-Sample Kolmogorov-Smirnov Test. -class KOSTable -{ - public: - double getConfLimit(int); -}; - /**************************************************************************************************/ -/*This Class calculates the truncated lognormal for the data. -It then prints the D-Statistic and the critical values for the -Kolmogorov-Smirnov 1-Sample test.* - -class TrunLN -{ - public: - void doTrunLN(vector, vector); -}; -/**************************************************************************************************/ - #endif