+ //get shared file
+ sharedfile = validParameter.validFile(parameters, "shared", true);
+ if (sharedfile == "not open") { sharedfile = ""; abort = true; }
+ else if (sharedfile == "not found") {
+ //if there is a current shared file, use it
+ sharedfile = m->getSharedFile();
+ if (sharedfile != "") { m->mothurOut("Using " + sharedfile + " as input file for the shared parameter."); m->mothurOutEndLine(); }
+ else { m->mothurOut("You have no current sharedfile and the shared parameter is required."); m->mothurOutEndLine(); abort = true; }
+ }else { m->setSharedFile(sharedfile); }
+
+
+ //if the user changes the output directory command factory will send this info to us in the output parameter
+ outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = m->hasPath(sharedfile); }
+ }
+ }
+ catch(exception& e) {
+ m->errorOut(e, "GetgroupCommand", "GetgroupCommand");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+
+int GetgroupCommand::execute(){
+ try {
+
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
+
+ //open output file
+ outputFile = outputDir + m->getRootName(m->getSimpleName(sharedfile)) + "bootGroups";
+ m->openOutputFile(outputFile, out);
+
+ InputData input(sharedfile, "sharedfile");
+ vector<SharedRAbundVector*> lookup = input.getSharedRAbundVectors();
+
+ for (int i = 0; i < lookup.size(); i++) {
+ out << lookup[i]->getGroup() << '\t' << lookup[i]->getGroup() << endl;
+ m->mothurOut(lookup[i]->getGroup()); m->mothurOutEndLine();
+ delete lookup[i];