]> git.donarmstrong.com Git - mothur.git/blobdiff - heatmapcommand.cpp
added count file to cluster.classic and cluster.split. modified splitting classes...
[mothur.git] / heatmapcommand.cpp
index 9051a5d94ffd07d1ba5444f5d777556faf7fab77..d160525c70174131e8d32ac9803f5bcc756cb80f 100644 (file)
@@ -61,6 +61,28 @@ string HeatMapCommand::getHelpString(){
        }
 }
 
+//**********************************************************************************************************************
+
+string HeatMapCommand::getOutputFileNameTag(string type, string inputName=""){ 
+       try {
+        string outputFileName = "";
+               map<string, vector<string> >::iterator it;
+        
+        //is this a type this command creates
+        it = outputTypes.find(type);
+        if (it == outputTypes.end()) {  m->mothurOut("[ERROR]: this command doesn't create a " + type + " output file.\n"); }
+        else {
+            if (type == "svg")            {   outputFileName =  "svg";   }
+            else { m->mothurOut("[ERROR]: No definition for type " + type + " output file tag.\n"); m->control_pressed = true;  }
+        }
+        return outputFileName;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "HeatMapCommand", "getOutputFileNameTag");
+               exit(1);
+       }
+}
+
 //**********************************************************************************************************************
 HeatMapCommand::HeatMapCommand(){      
        try {
@@ -222,14 +244,14 @@ HeatMapCommand::HeatMapCommand(string option) {
                        if (groups == "not found") { groups = ""; }
                        else { 
                                m->splitAtDash(groups, Groups);
-                               m->Groups = Groups;
+                               m->setGroups(Groups);
                        }
                        
                        string temp = validParameter.validFile(parameters, "numotu", false);            if (temp == "not found") { temp = "0"; }
-                       convert(temp, numOTU);
+                       m->mothurConvert(temp, numOTU);
                        
                        temp = validParameter.validFile(parameters, "fontsize", false);                         if (temp == "not found") { temp = "24"; }
-                       convert(temp, fontSize);
+                       m->mothurConvert(temp, fontSize);
                        
                        sorted = validParameter.validFile(parameters, "sorted", false);                         
                        if (sorted == "not found") { 
@@ -287,7 +309,7 @@ int HeatMapCommand::execute(){
                                if (m->control_pressed) {
                                        for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  }
                                        for (int i = 0; i < outputNames.size(); i++) {  if (outputNames[i] != "control") {  m->mothurRemove(outputNames[i]);  } } outputTypes.clear();
-                                       m->Groups.clear(); 
+                                       m->clearGroups(); 
                                        delete input; delete heatmap; return 0;
                                }
                
@@ -330,7 +352,7 @@ int HeatMapCommand::execute(){
                        
                        if (m->control_pressed) {
                                for (int i = 0; i < outputNames.size(); i++) {  if (outputNames[i] != "control") {  m->mothurRemove(outputNames[i]);  } } outputTypes.clear();
-                               m->Groups.clear(); 
+                               m->clearGroups(); 
                                delete input; delete heatmap; return 0;
                        }
 
@@ -359,7 +381,7 @@ int HeatMapCommand::execute(){
                        }
                
                        //reset groups parameter
-                       m->Groups.clear();  
+                       m->clearGroups();  
                        
                }else if ((format == "list") || (format == "rabund") || (format == "sabund")) {
        
@@ -440,7 +462,7 @@ int HeatMapCommand::execute(){
                                if (m->control_pressed) {
                                        for (int i = 0; i < lookupFloat.size(); i++) {  delete lookupFloat[i];  }
                                        for (int i = 0; i < outputNames.size(); i++) {  if (outputNames[i] != "control") {  m->mothurRemove(outputNames[i]);  } } outputTypes.clear();
-                                       m->Groups.clear(); 
+                                       m->clearGroups(); 
                                        delete input; delete heatmap; return 0;
                                }
                
@@ -482,7 +504,7 @@ int HeatMapCommand::execute(){
                        
                        if (m->control_pressed) {
                                for (int i = 0; i < outputNames.size(); i++) {  if (outputNames[i] != "control") {  m->mothurRemove(outputNames[i]);  } } outputTypes.clear();
-                               m->Groups.clear(); 
+                               m->clearGroups(); 
                                delete input; delete heatmap; return 0;
                        }
 
@@ -511,7 +533,7 @@ int HeatMapCommand::execute(){
                        }
                
                        //reset groups parameter
-                       m->Groups.clear();  
+                       m->clearGroups();  
 
                }