*
* Created on June 26, 2012, 11:06 AM
*/
+
#include "kruskalwalliscommand.h"
//**********************************************************************************************************************
try {
if (abort == true) { if (calledHelp) { return 0; } return 2; }
+ InputData* input = new InputData(sharedfile, "sharedfile");
+ vector<SharedRAbundVector*> lookup = input->getSharedRAbundVectors();
+ string lastLabel = lookup[0]->getLabel();
+
+ //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
+ set<string> processedLabels;
+ set<string> userLabels = labels;
+
+ ofstream out;
+ string outputFileName = outputDir + m->getRootName(m->getSimpleName(sharedfile)) + getOutputFileNameTag("summary");
+ m->openOutputFile(outputFileName, out);
+ outputNames.push_back(outputFileName); outputTypes["summary"].push_back(outputFileName);
+ out.setf(ios::fixed, ios::floatfield); out.setf(ios::showpoint);
+ out << "H\tpvalue\n";
+
//math goes here
- int N; //= thisLookUp.size();
+ int N = m->getNumGroups();
double H;
double tmp = 0.0;
vector<groupRank> vec;
+ vector<string> groups = m->getGroups();
string group;
int count;
double sum;
//merge all groups into a vector
+
+
+
//rank function here
assignRank(vec);
for (int i=0;i<N;i++) {
count = 0;
sum = 0;
- //group = next group
+ group = groups[i];
for(int j;j<vec.size();j++) {
if (vec[j].group == group) {
count++;
while ( it != vec.end() ) {
j = rank;
oldit = it;
- if (!equalvalue(*it, *it+1)) { *it->rank = rank; rank=rank+1; it++; }
+ if (!equalvalue(*it, *(it+1))) {
+ (*it).rank = rank;
+ rank = rank+1;
+ it++; }
else {
- while(equalrank(*it, *it+1)) {
- j = j + (j+1.0);
+ while(equalrank(*it, *(it+1))) {
+ j = j + (j+1);
rank++;
it++;
}
numRanks = double (distance(oldit, it));
avgRank = j / numRanks;
while(oldit != it) {
- *oldit->rank = avgRank;
+ (*oldit).rank = avgRank;
oldit++;
}
}
}
+
}
catch(exception& e) {
}
//**********************************************************************************************************************
-
+void KruskalWallisCommand::assignValue(vector<groupRank> &vec) {
+
+}
//**********************************************************************************************************************
//**********************************************************************************************************************
//**********************************************************************************************************************
\ No newline at end of file