+//**********************************************************************************************************************
+int GetOTURepCommand::process(ListVector* processList) {
+ try{
+ string nameRep, name, sequence;
+
+ //create output file
+ string outputFileName = getRootName(globaldata->getListFile()) + processList->getLabel() + ".rep.fasta";
+ openOutputFile(outputFileName, out);
+
+ //for each bin in the list vector
+ for (int i = 0; i < processList->size(); i++) {
+ string groups;
+ nameRep = FindRep(i, groups, processList);
+
+ //print out name and sequence for that bin
+ sequence = fasta->getSequence(nameRep);
+
+ if (sequence != "not found") {
+ if (groupfile == "") {
+ nameRep = nameRep + "|" + toString(i+1);
+ out << ">" << nameRep << endl;
+ out << sequence << endl;
+ }else {
+ nameRep = nameRep + "|" + groups + "|" + toString(i+1);
+ out << ">" << nameRep << endl;
+ out << sequence << endl;
+ }
+ }else {
+ cout << nameRep << " is missing from your fasta or name file. Please correct. " << endl;
+ remove(outputFileName.c_str());
+ return 1;
+ }
+ }
+
+ out.close();
+ return 0;
+
+ }
+ catch(exception& e) {
+ cout << "Standard Error: " << e.what() << " has occurred in the GetOTURepCommand class Function process. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+ catch(...) {
+ cout << "An unknown error has occurred in the GetOTURepCommand class function process. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+}
+
+//**********************************************************************************************************************
+