]> git.donarmstrong.com Git - mothur.git/blobdiff - mothurout.cpp
added count file to cluster.classic and cluster.split. modified splitting classes...
[mothur.git] / mothurout.cpp
index 14840c16e162bc599c242e289e3c5899fb396de4..9704464bf80326c87d4afa556e3353b95fcbf37e 100644 (file)
@@ -43,7 +43,7 @@ set<string> MothurOut::getCurrentTypes()  {
         types.insert("tree");
         types.insert("flow");
         types.insert("biom");
-        types.insert("counttable");
+        types.insert("count");
         types.insert("processors");
 
                return types;
@@ -79,7 +79,7 @@ void MothurOut::printCurrentFiles()  {
                if (treefile != "")                     {  mothurOut("tree=" + treefile); mothurOutEndLine();                           }
                if (flowfile != "")                     {  mothurOut("flow=" + flowfile); mothurOutEndLine();                           }
         if (biomfile != "")                    {  mothurOut("biom=" + biomfile); mothurOutEndLine();                           }
-        if (counttablefile != "")      {  mothurOut("counttable=" + counttablefile); mothurOutEndLine();       }
+        if (counttablefile != "")      {  mothurOut("count=" + counttablefile); mothurOutEndLine();    }
                if (processors != "1")          {  mothurOut("processors=" + processors); mothurOutEndLine();           }
                
        }
@@ -1052,6 +1052,9 @@ int MothurOut::openInputFile(string fileName, ifstream& fileHandle){
 
 int MothurOut::renameFile(string oldName, string newName){
        try {
+        
+        if (oldName == newName) { return 0; }
+        
                ifstream inTest;
                int exist = openInputFile(newName, inTest, "");
                inTest.close();
@@ -2017,6 +2020,28 @@ bool MothurOut::mothurConvert(string item, int& num){
                exit(1);
        }
 }
+/***********************************************************************/
+bool MothurOut::mothurConvert(string item, intDist& num){
+       try {
+               bool error = false;
+               
+               if (isNumeric1(item)) {
+                       convert(item, num);
+               }else {
+                       num = 0;
+                       error = true;
+                       mothurOut("[ERROR]: cannot convert " + item + " to an integer."); mothurOutEndLine();
+                       commandInputsConvertError = true;
+               }
+               
+               return error;
+       }
+       catch(exception& e) {
+               errorOut(e, "MothurOut", "mothurConvert");
+               exit(1);
+       }
+}
+
 /***********************************************************************/
 bool MothurOut::isNumeric1(string stringToCheck){
        try {