+ abort = false;
+ Groups.clear();
+
+ //allow user to run help
+ if(option == "help") { help(); abort = true; }
+
+ else {
+ //valid paramters for this command
+ string Array[] = {"groups","iters"};
+ vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+
+ parser = new OptionParser();
+ parser->parse(option, parameters); delete parser;
+
+ ValidParameters* validParameter = new ValidParameters();
+
+ //check to make sure all parameters are valid for command
+ for (it4 = parameters.begin(); it4 != parameters.end(); it4++) {
+ if (validParameter->isValidParameter(it4->first, myArray, it4->second) != true) { abort = true; }
+ }
+
+ if (globaldata->gTree.size() == 0) {//no trees were read
+ cout << "You must execute the read.tree command, before you may execute the unifrac.unweighted command." << endl; abort = true; }
+
+ //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 = ""; }
+ else {
+ splitAtDash(groups, Groups);
+ globaldata->Groups = Groups;
+ }
+
+ itersString = validParameter->validFile(parameters, "iters", false); if (itersString == "not found") { itersString = "1000"; }
+ convert(itersString, iters);
+
+ delete validParameter;
+
+ if (abort == false) {
+ T = globaldata->gTree;
+ tmap = globaldata->gTreemap;
+ sumFile = globaldata->getTreeFile() + ".uwsummary";
+ openOutputFile(sumFile, outSum);
+
+ util = new SharedUtil();
+ util->setGroups(globaldata->Groups, tmap->namesOfGroups, allGroups, numGroups, "unweighted"); //sets the groups the user wants to analyze
+ util->getCombos(groupComb, globaldata->Groups, numComp);
+
+ if (numGroups == 1) { numComp++; groupComb.push_back(allGroups); }
+
+ unweighted = new Unweighted(tmap);
+
+ }
+
+ }