]> git.donarmstrong.com Git - mothur.git/blobdiff - heatmapcommand.cpp
added get.repseqs command, started matrix output command
[mothur.git] / heatmapcommand.cpp
index be25f091516022e5a6414184c7ecb58518e60a94..09dfb5a15bde8e52a967c1ef9cdae0e4130a0b3a 100644 (file)
@@ -40,7 +40,7 @@ HeatMapCommand::~HeatMapCommand(){
 int HeatMapCommand::execute(){
        try {
                int count = 1;  
-               
+       
                if (format == "sharedfile") {
                        //you have groups
                        read = new ReadOTUFile(globaldata->inputFileName);      
@@ -48,14 +48,6 @@ int HeatMapCommand::execute(){
                        
                        input = globaldata->ginput;
                        lookup = input->getSharedRAbundVectors();
-               }else if (format == "shared") {
-                       //you are using a list and a groupfile
-                       read = new ReadOTUFile(globaldata->inputFileName);      
-                       read->read(&*globaldata); 
-               
-                       input = globaldata->ginput;
-                       SharedList = globaldata->gSharedList;
-                       lookup = SharedList->getSharedRAbundVector();
                }else if (format == "list") {
                        //you are using just a list file and have only one group
                        read = new ReadOTUFile(globaldata->inputFileName);      
@@ -74,7 +66,10 @@ int HeatMapCommand::execute(){
                                        cout << lookup[0]->getLabel() << '\t' << count << endl;
                                        heatmap->getPic(lookup);
                                }
-                                               
+                               
+                               //prevent memory leak
+                               for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  }
+                               
                                //get next line to process
                                lookup = input->getSharedRAbundVectors();                               
                                count++;
@@ -93,6 +88,7 @@ int HeatMapCommand::execute(){
                                        heatmap->getPic(rabund);
                                }
                                
+                               delete rabund;
                                rabund = input->getRAbundVector();
                                count++;
                        }