/***********************************************************/
int UnifracWeightedCommand::execute() {
try {
+ Progress* reading;
+ reading = new Progress("Comparing to random:", iters);
//get weighted for users tree
userData.resize(numComp,0); //data[0] = weightedscore AB, data[1] = weightedscore AC...
uScores.resize(numComp); //data[0] = weightedscore AB, data[1] = weightedscore AC...
weightedFile = globaldata->getTreeFile() + toString(i+1) + ".weighted";
weightedFileout = globaldata->getTreeFile() + "temp." + toString(i+1) + ".weighted";
-
+
userData = weighted->getValues(T[i]); //userData[0] = weightedscore
//save users score
count++;
}
}
+
+ //update progress bar
+ reading->update(j);
+
}
//removeValidScoresDuplicates();
validScores.clear();
}
+ //finish progress bar
+ reading->finish();
+ delete reading;
+
printWSummaryFile();
//clear out users groups
for (int i = 0; i < T.size(); i++) {
for (int j = 0; j < numComp; j++) {
if (WScoreSig[count] > (1/(float)iters)) {
- outSum << setprecision(6) << i+1 << '\t' << '\t' << groupComb[j] << '\t' << '\t' << utreeScores[count] << '\t' << setprecision(globaldata->getIters().length()) << WScoreSig[count] << endl;
- cout << setprecision(6) << i+1 << '\t' << '\t' << groupComb[j] << '\t' << '\t' << utreeScores[count] << '\t' << setprecision(globaldata->getIters().length()) << WScoreSig[count] << endl;
+ outSum << setprecision(6) << i+1 << '\t' << groupComb[j] << '\t' << utreeScores[count] << '\t' << setprecision(globaldata->getIters().length()) << WScoreSig[count] << endl;
+ cout << setprecision(6) << i+1 << '\t' << groupComb[j] << '\t' << utreeScores[count] << '\t' << setprecision(globaldata->getIters().length()) << WScoreSig[count] << endl;
}else{
outSum << setprecision(6) << i+1 << '\t' << groupComb[j] << '\t' << utreeScores[count] << '\t' << setprecision(globaldata->getIters().length()) << "<" << (1/float(iters)) << endl;
cout << setprecision(6) << i+1 << '\t' << groupComb[j] << '\t' << utreeScores[count] << '\t' << setprecision(globaldata->getIters().length()) << "<" << (1/float(iters)) << endl;
/***********************************************************/
void UnifracWeightedCommand::setGroups() {
try {
+ numGroups = 0;
//if the user has not entered specific groups to analyze then do them all
if (globaldata->Groups.size() == 0) {
- numGroups = tmap->getNumGroups();
- for (int i=0; i < numGroups; i++) {
- globaldata->Groups.push_back(tmap->namesOfGroups[i]);
+ for (int i=0; i < tmap->getNumGroups(); i++) {
+ if (tmap->namesOfGroups[i] != "xxx") {
+ globaldata->Groups.push_back(tmap->namesOfGroups[i]);
+ numGroups++;
+ }
}
}else {
if (globaldata->getGroups() != "all") {
//if the user only entered invalid groups
if (globaldata->Groups.size() == 0) {
- numGroups = tmap->getNumGroups();
- for (int i=0; i < numGroups; i++) {
- globaldata->Groups.push_back(tmap->namesOfGroups[i]);
+ for (int i=0; i < tmap->getNumGroups(); i++) {
+ if (tmap->namesOfGroups[i] != "xxx") {
+ globaldata->Groups.push_back(tmap->namesOfGroups[i]);
+ numGroups++;
+ }
}
cout << "When using the groups parameter you must have at least 2 valid groups. I will run the command using all the groups in your groupfile." << endl;
}else if (globaldata->Groups.size() == 1) {
cout << "When using the groups parameter you must have at least 2 valid groups. I will run the command using all the groups in your groupfile." << endl;
- numGroups = tmap->getNumGroups();
globaldata->Groups.clear();
- for (int i=0; i < numGroups; i++) {
- globaldata->Groups.push_back(tmap->namesOfGroups[i]);
+ for (int i=0; i < tmap->getNumGroups(); i++) {
+ if (tmap->namesOfGroups[i] != "xxx") {
+ globaldata->Groups.push_back(tmap->namesOfGroups[i]);
+ numGroups++;
+ }
}
}else { numGroups = globaldata->Groups.size(); }
}else { //users wants all groups
- numGroups = tmap->getNumGroups();
globaldata->Groups.clear();
globaldata->setGroups("");
- for (int i=0; i < numGroups; i++) {
- globaldata->Groups.push_back(tmap->namesOfGroups[i]);
+ for (int i=0; i < tmap->getNumGroups(); i++) {
+ if (tmap->namesOfGroups[i] != "xxx") {
+ globaldata->Groups.push_back(tmap->namesOfGroups[i]);
+ numGroups++;
+ }
}
}
}