]> git.donarmstrong.com Git - mothur.git/blobdiff - heatmapcommand.cpp
added log10 and log2 scalers for heatmap
[mothur.git] / heatmapcommand.cpp
index 5da80d8179f4cb29f3c005490526ef6e8c5a93ab..82aa12ce66821443c9cedce4628fad3e43d01674 100644 (file)
 HeatMapCommand::HeatMapCommand(){
        try {
                globaldata = GlobalData::getInstance();
+               heatmap = new HeatMap();
                format = globaldata->getFormat();
+               util = new SharedUtil();
+               
        }
        catch(exception& e) {
                cout << "Standard Error: " << e.what() << " has occurred in the HeatMapCommand class Function HeatMapCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
@@ -31,6 +34,8 @@ HeatMapCommand::HeatMapCommand(){
 HeatMapCommand::~HeatMapCommand(){
        delete input;
        delete read;
+       delete heatmap;
+       delete util;
 }
 
 //**********************************************************************************************************************
@@ -63,13 +68,20 @@ int HeatMapCommand::execute(){
                        input = globaldata->ginput;
                }
                
+                               
                if (format != "list") { 
+               
+                       util->setGroups(globaldata->Groups, globaldata->gGroupmap->namesOfGroups, "heat");
+                       globaldata->setGroups("");
+
+
                        while(order != NULL){
                
                                if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(order->getLabel()) == 1){                       
        
                                        cout << order->getLabel() << '\t' << count << endl;
-//call heatmap class to make file
+                                       heatmap->getPic(order);
+
                                }
                                                
                                //get next line to process
@@ -88,15 +100,16 @@ int HeatMapCommand::execute(){
                        }
                        
                        //reset groups parameter
-                       globaldata->Groups.clear();  globaldata->setGroups("");
+                       globaldata->Groups.clear();  
                        
                }else{
                        while(ordersingle != NULL){
                
-                               if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(order->getLabel()) == 1){                       
+                               if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(ordersingle->getLabel()) == 1){                 
        
-                                       cout << order->getLabel() << '\t' << count << endl;
-//call heatmap class to make file
+                                       cout << ordersingle->getLabel() << '\t' << count << endl;
+                                       heatmap->getPic(ordersingle);
+                                       
                                }
                                
                                ordersingle = (input->getOrderVector());
@@ -118,3 +131,4 @@ int HeatMapCommand::execute(){
 
 //**********************************************************************************************************************
 
+