X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=libshuffcommand.cpp;h=a51b3270f855062a0e2ee92fab63779b38b50877;hb=81ff02ef4064fe4dec986ea3110c1cb8e1285fe6;hp=9ab9108f23ca4d63c3479bb8c6a27d27e08704ea;hpb=9e07ea7484097a73e0e9ce3e379c12bfa0a4e55d;p=mothur.git diff --git a/libshuffcommand.cpp b/libshuffcommand.cpp index 9ab9108..a51b327 100644 --- a/libshuffcommand.cpp +++ b/libshuffcommand.cpp @@ -7,6 +7,12 @@ * */ +/* This class is designed to implement an integral form of the Cramer-von Mises statistic. + you may refer to the "Integration of Microbial Ecology and Statistics: A Test To Compare Gene Libraries" + paper in Applied and Environmental Microbiology, Sept. 2004, p. 5485-5492 0099-2240/04/$8.00+0 + DOI: 10.1128/AEM.70.9.5485-5492.2004 Copyright 2004 American Society for Microbiology for more information. */ + + #include "libshuffcommand.h" //********************************************************************************************************************** @@ -108,7 +114,7 @@ int LibShuffCommand::execute(){ //don't save AA to AA if (i != j) { //(Caa - Cab)^2 - deltaValues[p].push_back( (abs(cValues[p][i][i]-cValues[p][i][j]) * abs(cValues[p][i][i]-cValues[p][i][j])) ); + deltaValues[p].push_back((cValues[p][i][i]-cValues[p][i][j]) * (cValues[p][i][i]-cValues[p][i][j])); sumDelta[count] += deltaValues[p][count]; count++; } @@ -146,24 +152,18 @@ int LibShuffCommand::execute(){ //don't save AA to AA if (i != j) { //(Caa - Cab)^2 - rsumDelta[count][m] += ((abs(cValues[p][i][i]-cValues[p][i][j]) * abs(cValues[p][i][i]-cValues[p][i][j]))); + rsumDelta[count][m] += ((cValues[p][i][i]-cValues[p][i][j]) * (cValues[p][i][i]-cValues[p][i][j])); count++; } } } } -//cout << "iter " << m << endl; + //clear out old Values reading->update(m); cValues.clear(); -//cout << "random sum delta for iter " << m << endl; -//for (int i = 0; i < rsumDelta.size(); i++) { -// cout << setprecision(6) << rsumDelta[i][m] << '\t'; -//} -//cout << endl; - } reading->finish();