inFile.close();
outFile.close();
remove(outName.c_str());
-};
+}
/***********************************************************************/
openInputFile(inName, inFile);
string inputBuffer;
- getline(inFile, inputBuffer);
+ inputBuffer = getline(inFile);
outFile << inputBuffer << '\t' << label << "\tlci\thci" << endl;
}
outFile.setf(ios::showpoint);
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ThreeColumnFile class Function initFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ThreeColumnFile class function initFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "ThreeColumnFile", "initFile");
exit(1);
}
}
try {
if(counter != 0){
string inputBuffer;
- getline(inFile, inputBuffer);
+ inputBuffer = getline(inFile);
outFile << inputBuffer << setprecision(4) << '\t' << data[0] << '\t' << data[1] << '\t' << data[2] << endl;
}
}
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ThreeColumnFile class Function output. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "ThreeColumnFile", "output");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the ThreeColumnFile class function output. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-};
+}
/***********************************************************************/
remove(inName.c_str());
renameOk = rename(outName.c_str(), inName.c_str());
+ //renameFile(outName, inName);
+
//checks to make sure user was able to rename and remove successfully
- if ((renameOk != 0)) { cout << "Unable to rename necessary files." << endl; }
-
+ if ((renameOk != 0)) {
+ m->mothurOut("Unable to rename " + outName); m->mothurOutEndLine();
+ perror(" : ");
+ }
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ThreeColumnFile class Function resetFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "ThreeColumnFile", "resetFile");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the ThreeColumnFile class function resetFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
}
/***********************************************************************/
inFile.close();
outFile.close();
remove(outName.c_str());
-};
+}
/***********************************************************************/
openInputFile(inName, inFile);
string inputBuffer;
- getline(inFile, inputBuffer);
+ inputBuffer = getline(inFile);
outFile << inputBuffer << '\t';
for(int i = 0; i < tags.size(); i++) {
outFile.setf(ios::showpoint);
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ColumnFile class Function initFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ColumnFile class function initFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "ColumnFile", "initFile");
exit(1);
}
}
if(counter != 0){
string inputBuffer;
- getline(inFile, inputBuffer);
+ inputBuffer = getline(inFile);
- outFile << inputBuffer << '\t' << setprecision(6) << data[0] << setprecision(globaldata->getIters().length());
+ outFile << inputBuffer << '\t' << setprecision(6) << data[0] << setprecision(iters.length());
for (int i = 1; i< data.size(); i++) {
outFile << '\t' << data[i];
}
outFile << endl;
}
else{
- outFile << setprecision(6) << data[0] << setprecision(globaldata->getIters().length());
+ outFile << setprecision(6) << data[0] << setprecision(iters.length());
for (int i = 1; i< data.size(); i++) {
outFile << '\t' << data[i];
}
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ColumnFile class Function output. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "ColumnFile", "output");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the ColumnFile class function output. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-};
+}
/***********************************************************************/
remove(inName.c_str());
renameOk = rename(outName.c_str(), inName.c_str());
+ //renameFile(outName, inName);
+
//checks to make sure user was able to rename and remove successfully
- if ((renameOk != 0)) { cout << "Unable to rename necessary files." << endl; }
-
+ if ((renameOk != 0)) {
+ m->mothurOut("Unable to rename " + outName); m->mothurOutEndLine();
+ perror(" : ");
+ }
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ColumnFile class Function resetFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "ColumnFile", "resetFile");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the ColumnFile class function resetFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
}
/***********************************************************************/
inFile.close();
outFile.close();
remove(outName.c_str());
-};
+}
/***********************************************************************/
openInputFile(inName, inFile);
string inputBuffer;
- getline(inFile, inputBuffer);
+ inputBuffer = getline(inFile);
outFile << inputBuffer << '\t' << label << "\tlci\thci" << endl;
}
outFile.setf(ios::showpoint);
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the SharedThreeColumnFile class Function initFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the SharedThreeColumnFile class function initFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "SharedThreeColumnFile", "initFile");
exit(1);
}
}
try {
if(counter != 0){
string inputBuffer;
- getline(inFile, inputBuffer);
+ inputBuffer = getline(inFile);
outFile << inputBuffer << setprecision(4) << '\t' << data[0] << '\t' << data[1] << '\t' << data[2] << endl;
}
}
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the SharedThreeColumnFile class Function output. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "SharedThreeColumnFile", "output");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the SharedThreeColumnFile class function output. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-};
+}
/***********************************************************************/
outFile.close();
}
counter = 1;
+
remove(inName.c_str());
renameOk = rename(outName.c_str(), inName.c_str());
+ //renameFile(outName, inName);
+
//checks to make sure user was able to rename and remove successfully
- if ((renameOk != 0)) { cout << "Unable to rename necessary files." << endl; }
-
+ if ((renameOk != 0)) {
+ m->mothurOut("Unable to rename " + outName); m->mothurOutEndLine();
+ perror(" : ");
+ }
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the SharedThreeColumnFile class Function resetFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "SharedThreeColumnFile", "resetFile");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the SharedThreeColumnFile class function resetFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
}
/***********************************************************************/
inFile.close();
outFile.close();
remove(outName.c_str());
-};
+}
/***********************************************************************/
openInputFile(inName, inFile);
string inputBuffer;
- getline(inFile, inputBuffer);
+ inputBuffer = getline(inFile);
outFile << inputBuffer << '\t' << label << endl;
}
else{
openOutputFile(outName, outFile);
- outFile << "numsequences\t" << label << endl;
+ outFile << "numsampled\t" << label << endl;
}
outFile.setf(ios::fixed, ios::floatfield);
outFile.setf(ios::showpoint);
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the OneColumnFile class Function initFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "OneColumnFile", "initFile");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the OneColumnFile class function initFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
}
/***********************************************************************/
try {
if(counter != 0){
string inputBuffer;
- getline(inFile, inputBuffer);
+ inputBuffer = getline(inFile);
outFile << inputBuffer << setprecision(4) << '\t' << data[0] << endl;
}
}
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the OneColumnFile class Function output. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "OneColumnFile", "output");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the OneColumnFile class function output. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-};
+}
/***********************************************************************/
if(counter != 0){
outFile.close();
inFile.close();
- }
- else{
+ }else{
outFile.close();
}
counter = 1;
+
remove(inName.c_str());
renameOk = rename(outName.c_str(), inName.c_str());
+ //renameFile(outName, inName);
+
//checks to make sure user was able to rename and remove successfully
- if ((renameOk != 0)) { cout << "Unable to rename necessary files." << endl; }
+ if ((renameOk != 0)) {
+ m->mothurOut("Unable to rename " + outName); m->mothurOutEndLine();
+ perror(" : ");
+ }
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the OneColumnFile class Function resetFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "OneColumnFile", "resetFile");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the OneColumnFile class function resetFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
}
/***********************************************************************/
inFile.close();
outFile.close();
remove(outName.c_str());
-};
+}
/***********************************************************************/
openInputFile(inName, inFile);
string inputBuffer;
- getline(inFile, inputBuffer);
+ inputBuffer = getline(inFile);
outFile << inputBuffer << '\t' << label << endl;
outFile.setf(ios::showpoint);
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the OneColumnFile class Function initFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "SharedOneColumnFile", "initFile");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the OneColumnFile class function initFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
}
/***********************************************************************/
}
if(counter != 0){
string inputBuffer;
- getline(inFile, inputBuffer);
+ inputBuffer = getline(inFile);
outFile << inputBuffer << setprecision(2) << '\t' << dataOutput << endl;
}
}
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the OneColumnFile class Function output. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "SharedOneColumnFile", "output");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the OneColumnFile class function output. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-};
+}
/***********************************************************************/
outFile.close();
}
counter = 1;
-
+
remove(inName.c_str());
renameOk = rename(outName.c_str(), inName.c_str());
- //checks to make sure user was able to rename and remove successfully
- if ((renameOk != 0)) { cout << "Unable to rename necessary files." << endl; }
-
+ //renameFile(outName, inName);
+ //checks to make sure user was able to rename and remove successfully
+ if ((renameOk != 0)) {
+ m->mothurOut("Unable to rename " + outName); m->mothurOutEndLine();
+ perror(" : ");
+ }
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the OneColumnFile class Function resetFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "SharedOneColumnFile", "resetFile");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the OneColumnFile class function resetFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
}
/***********************************************************************/