if (taxonomyfile != "") { mothurOut("taxonomy=" + taxonomyfile); mothurOutEndLine(); }
if (treefile != "") { mothurOut("tree=" + treefile); mothurOutEndLine(); }
if (flowfile != "") { mothurOut("flow=" + flowfile); mothurOutEndLine(); }
+ if (biomfile != "") { mothurOut("biom=" + biomfile); mothurOutEndLine(); }
if (processors != "1") { mothurOut("processors=" + processors); mothurOutEndLine(); }
}
if (taxonomyfile != "") { return true; }
if (treefile != "") { return true; }
if (flowfile != "") { return true; }
+ if (biomfile != "") { return true; }
if (processors != "1") { return true; }
return hasCurrent;
accnosfile = "";
taxonomyfile = "";
flowfile = "";
+ biomfile = "";
processors = "1";
}
catch(exception& e) {
}
/***********************************************************************/
+bool MothurOut::dirCheck(string& dirName){
+ try {
+
+ string tag = "";
+ #ifdef USE_MPI
+ int pid;
+ MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are
+
+ tag = toString(pid);
+ #endif
+
+ //add / to name if needed
+ string lastChar = dirName.substr(dirName.length()-1);
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
+ if (lastChar != "/") { dirName += "/"; }
+ #else
+ if (lastChar != "\\") { dirName += "\\"; }
+ #endif
+
+ //test to make sure directory exists
+ dirName = getFullPathName(dirName);
+ string outTemp = dirName + tag + "temp";
+ ofstream out;
+ out.open(outTemp.c_str(), ios::trunc);
+ if(!out) {
+ mothurOut(dirName + " directory does not exist or is not writable."); mothurOutEndLine();
+ }else{
+ out.close();
+ mothurRemove(outTemp);
+ return true;
+ }
+
+ return false;
+ }
+ catch(exception& e) {
+ errorOut(e, "MothurOut", "dirCheck");
+ exit(1);
+ }
+
+}
+/***********************************************************************/
+
string MothurOut::hasPath(string longName){
try {
string path = "";
string MothurOut::getExtension(string longName){
try {
- string extension = longName;
+ string extension = "";
if(longName.find_last_of('.') != longName.npos){
int pos = longName.find_last_of('.');
int numLines = 0;
if (ableToOpen == 0) { //you opened it
- while(char c = input.get()){
+ while(!input.eof()){
+ char c = input.get();
if(input.eof()) { break; }
else { output << c; if (c == '\n') {numLines++;} }
}
}
in.close();
- return 0;
+ return nameMap.size();
}
catch(exception& e) {
}
in.close();
- return 0;
+ return nameMap.size();
}
catch(exception& e) {
if (control_pressed) { break; }
string firstCol, secondCol;
- in >> firstCol >> secondCol; gobble(in);
+ in >> firstCol; gobble(in);
+ in >> secondCol; gobble(in);
int num = getNumNames(secondCol);
exit(1);
}
}
+/***********************************************************************/
+//This function splits up the various option parameters
+void MothurOut::splitAtChar(string& prefix, string& suffix, char c){
+ try {
+ prefix = suffix.substr(0,suffix.find_first_of(c));
+ if ((suffix.find_first_of(c)+2) <= suffix.length()) { //checks to make sure you don't have comma at end of string
+ suffix = suffix.substr(suffix.find_first_of(c)+1, suffix.length());
+ string space = " ";
+ while(suffix.at(0) == ' ')
+ suffix = suffix.substr(1, suffix.length());
+ }
+
+ }
+ catch(exception& e) {
+ errorOut(e, "MothurOut", "splitAtComma");
+ exit(1);
+ }
+}
+
/***********************************************************************/
//This function splits up the various option parameters