}
m->runParse = true;
- m->Groups.clear();
- m->namesOfGroups.clear();
+ m->clearGroups();
+ m->clearAllGroups();
m->Treenames.clear();
m->names.clear();
if (randomtree == "") {
//check for required parameters
treefile = validParameter.validFile(parameters, "tree", true);
- if (treefile == "not open") { abort = true; }
+ if (treefile == "not open") { treefile = ""; abort = true; }
else if (treefile == "not found") { //if there is a current design file, use it
treefile = m->getTreeFile();
if (treefile != "") { m->mothurOut("Using " + treefile + " as input file for the tree parameter."); m->mothurOutEndLine(); }
else { m->setGroupFile(groupfile); }
namefile = validParameter.validFile(parameters, "name", true);
- if (namefile == "not open") { abort = true; }
+ if (namefile == "not open") { namefile = ""; abort = true; }
else if (namefile == "not found") { namefile = ""; }
else { m->setNameFile(namefile); }
}
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
groups = validParameter.validFile(parameters, "groups", false);
- if (groups == "not found") { groups = ""; m->Groups.clear(); }
+ if (groups == "not found") { groups = ""; m->clearGroups(); }
else {
m->splitAtDash(groups, Groups);
- m->Groups = Groups;
+ m->setGroups(Groups);
}
itersString = validParameter.validFile(parameters, "iters", false); if (itersString == "not found") { itersString = "1000"; }
- convert(itersString, iters);
+ m->mothurConvert(itersString, iters);
string temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); }
m->setProcessors(temp);
- convert(temp, processors);
+ m->mothurConvert(temp, processors);
+
+ if (namefile == "") {
+ vector<string> files; files.push_back(treefile);
+ parser.getNameFile(files);
+ }
}
read->AssembleTrees();
T = read->getTrees();
delete read;
-
+
//make sure all files match
//if you provide a namefile we will use the numNames in the namefile as long as the number of unique match the tree names size.
int numNamesInTree;
if (m->control_pressed) {
delete tmap; for (int i = 0; i < T.size(); i++) { delete T[i]; }
for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } outputTypes.clear();
- m->Groups.clear();
+ m->clearGroups();
return 0;
}
//set users groups to analyze
util = new SharedUtil();
- util->setGroups(m->Groups, tmap->namesOfGroups, allGroups, numGroups, "parsimony"); //sets the groups the user wants to analyze
- util->getCombos(groupComb, m->Groups, numComp);
+ vector<string> mGroups = m->getGroups();
+ vector<string> tGroups = tmap->getNamesOfGroups();
+ util->setGroups(mGroups, tGroups, allGroups, numGroups, "parsimony"); //sets the groups the user wants to analyze
+ util->getCombos(groupComb, mGroups, numComp);
+ m->setGroups(mGroups);
delete util;
if (numGroups == 1) { numComp++; groupComb.push_back(allGroups); }
delete tmap; for (int i = 0; i < T.size(); i++) { delete T[i]; }
if (randomtree == "") { outSum.close(); }
for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } outputTypes.clear();
- m->Groups.clear();
+ m->clearGroups();
return 0;
}
delete tmap; for (int i = 0; i < T.size(); i++) { delete T[i]; }
if (randomtree == "") { outSum.close(); }
for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } outputTypes.clear();
- m->Groups.clear();
+ m->clearGroups();
return 0;
}
if (randomtree == "") { outSum.close(); }
for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } outputTypes.clear();
delete tmap; for (int i = 0; i < T.size(); i++) { delete T[i]; }
- m->Groups.clear();
+ m->clearGroups();
return 0;
}
delete reading; delete pars; delete output; delete randT;
delete tmap;
for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } outputTypes.clear();
- m->Groups.clear();
+ m->clearGroups();
return 0;
}
delete reading; delete pars; delete output; delete randT;
delete tmap;
for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } outputTypes.clear();
- m->Groups.clear();
+ m->clearGroups();
return 0;
}
delete tmap; for (int i = 0; i < T.size(); i++) { delete T[i]; }
if (randomtree == "") { outSum.close(); }
for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } outputTypes.clear();
- m->Groups.clear();
+ m->clearGroups();
return 0;
}
if (randomtree == "") { printUSummaryFile(); }
//reset groups parameter
- m->Groups.clear();
+ m->clearGroups();
delete pars; delete output;
delete tmap; for (int i = 0; i < T.size(); i++) { delete T[i]; }
count = 1;
numEachGroup.resize(numGroups, 0);
+
for (int i = 1; i <= numGroups; i++) {
m->mothurOut("Please enter the number of sequences in group " + toString(i) + ": ");
cin >> num;
//set tmaps seqsPerGroup
tmap->seqsPerGroup[toString(i)] = num;
- tmap->namesOfGroups.push_back(toString(i));
+ tmap->addGroup(toString(i));
//set tmaps namesOfSeqs
for (int j = 0; j < num; j++) {