]> git.donarmstrong.com Git - mothur.git/blobdiff - libshuffcommand.cpp
documentation
[mothur.git] / libshuffcommand.cpp
index 9ab9108f23ca4d63c3479bb8c6a27d27e08704ea..a51b3270f855062a0e2ee92fab63779b38b50877 100644 (file)
@@ -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();