X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=sharedkstest.cpp;h=d91478801678c53ddb87dce7b1474272a2b30275;hp=fefe14f4c192a872d0142cfa81a6a867a10fb32e;hb=1a20e24ee786195ab0e1cccd4f5aede7a88f3f4e;hpb=50ed3b6104d5821d6184f882e1e1423d47dcbf10 diff --git a/sharedkstest.cpp b/sharedkstest.cpp index fefe14f..d914788 100644 --- a/sharedkstest.cpp +++ b/sharedkstest.cpp @@ -13,8 +13,8 @@ EstOutput KSTest::getValues(vector shared){ try { - data.resize(2,0); - + data.resize(3,0); + //Must return shared1 and shared2 to original order at conclusion of kstest vector initData1 = shared[0]->getData(); vector initData2 = shared[1]->getData(); @@ -43,35 +43,22 @@ EstOutput KSTest::getValues(vector shared){ //double pVal = exp(-2*pow(maxDiff/a,2)); double critVal = 1.36*a*numNZ1*numNZ2; - /*cout << "Kolmogorov-Smirnov 2-sample test:\n"; - if(numNZ1 > 25 && numNZ2 > 25) //If the sample sizes are both bigger than 25. - cout << "P-Value = " << pVal << "\nP-Value is the probability that the data sets are significantly different.\n"; - else - { - //cout << "90% Confidence Critical Value = " << 1.22*a*numNZ1*numNZ2 << "\n"; - cout << "D-Statistic = " << DStatistic << "\n"; - cout << "95% Confidence Critical Value = " << critVal << "\n"; - cout << "If D-Statistic is greater than the critical value then the data sets are significantly different at the 95% confidence level.\n\n"; - }*/ - shared[0]->setData(initData1); shared[1]->setData(initData2); data[0] = DStatistic; data[1] = critVal; + data[2] = 0; + if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; } if (isnan(data[1]) || isinf(data[1])) { data[1] = 0; } return data; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the KSTest class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "KSTest", "getValues"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the KSTest class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } /***********************************************************************/