//get weighted scores for users trees
for (int i = 0; i < T.size(); i++) {
+
+ if (m->control_pressed) {
+ delete randT;
+ if (random) { delete reading; }
+ outSum.close();
+ for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); }
+ return 0;
+ }
+
counter = 0;
rScores.resize(numComp); //data[0] = weightedscore AB, data[1] = weightedscore AC...
uScores.resize(numComp); //data[0] = weightedscore AB, data[1] = weightedscore AC...
userData = weighted->getValues(T[i]); //userData[0] = weightedscore
+ if (m->control_pressed) {
+ delete randT;
+ if (random) { delete reading; delete output; }
+ outSum.close();
+ for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); }
+ return 0;
+ }
+
+
//save users score
for (int s=0; s<numComp; s++) {
//add users score to vector of user scores
//create a random tree with same topology as T[i], but different labels
randT->assembleRandomUnifracTree(globaldata->Groups[r], globaldata->Groups[l]);
+
+ if (m->control_pressed) {
+ delete randT;
+ if (random) { delete reading; delete output; }
+ outSum.close();
+ for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); }
+ return 0;
+ }
+
+
//get wscore of random tree
randomData = weighted->getValues(randT, globaldata->Groups[r], globaldata->Groups[l]);
+ if (m->control_pressed) {
+ delete randT;
+ if (random) { delete reading; delete output; }
+ outSum.close();
+ for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); }
+ return 0;
+ }
+
//save scores
rScores[count].push_back(randomData[0]);
count++;
validScores.clear();
}
+
+ if (m->control_pressed) {
+ delete randT;
+ if (random) { delete reading; }
+ outSum.close();
+ for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); }
+ return 0;
+ }
+
//finish progress bar
if (random) { reading->finish(); delete reading; }
delete randT;
+ if (m->control_pressed) {
+ for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); }
+ return 0;
+ }
+
m->mothurOutEndLine();
m->mothurOut("Output File Names: "); m->mothurOutEndLine();
for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); }
//flip it so you can print it
for (int r=0; r<globaldata->Groups.size(); r++) {
for (int l = r+1; l < globaldata->Groups.size(); l++) {
- dists[r][l] = (1.0 - utreeScores[count]);
- dists[l][r] = (1.0 - utreeScores[count]);
+ dists[r][l] = utreeScores[count];
+ dists[l][r] = utreeScores[count];
count++;
}
}