/***********************************************************/
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...
count++;
}
}
+
+ //update progress bar
+ reading->update(j);
+
}
//removeValidScoresDuplicates();
validScores.clear();
}
+ //finish progress bar
+ reading->finish();
+ delete reading;
+
printWSummaryFile();
//clear out users groups
/***********************************************************/
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++;
+ }
}
}
}