]> git.donarmstrong.com Git - mothur.git/commitdiff
fixed bug in heatmap
authorwestcott <westcott>
Fri, 15 May 2009 12:33:58 +0000 (12:33 +0000)
committerwestcott <westcott>
Fri, 15 May 2009 12:33:58 +0000 (12:33 +0000)
collectsharedcommand.cpp
heatmap.cpp
sharedchao1.cpp
sharedrabundvector.cpp

index 06dbce79b1685a93c13c38f0b3906e6b8f7e9fe3..4a3a338944958aa8e9342661847898c20e598f3d 100644 (file)
@@ -142,8 +142,11 @@ int CollectSharedCommand::execute(){
                util->updateGroupIndex(globaldata->Groups, globaldata->gGroupmap->groupIndex);
 
                while(order != NULL){
+               
                        orderList.insert(order->getLabel());
+                       
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(order->getLabel()) == 1){
+                               
                                //create collectors curve
                                cCurve = new Collect(order, cDisplays);
                                convert(globaldata->getFreq(), freq);
@@ -163,6 +166,7 @@ int CollectSharedCommand::execute(){
                for(i = globaldata->labels.begin(); i != globaldata->labels.end(); ++i)
                        if(orderList.count(*i) == 0)
                                cout << "'" << *i << "'" << " is not a valid label.\n";
+                               
                for(int i=0;i<cDisplays.size();i++){    delete cDisplays[i];    }       
                
                //reset groups parameter
index 0b1a80e6e9dca67a794653ce171d1b4011287b4a..90b11159f4ea8016d397f72a045c1e2031e48476 100644 (file)
@@ -218,6 +218,9 @@ void HeatMap::sortSharedVectors(vector<SharedRAbundVector*>& lookup){
                }
                
                //clear out lookup to create sorted lookup
+               for (int j = 0; j < lookup.size(); j++) {
+                       delete lookup[j];
+               }
                lookup.clear();
                
                //create and initialize lookup to empty vectors
index 0df0eabf8c2829ce6f6184276871687da66d4120..c3388fd621d8ec6e33aac32891b54831a524417d 100644 (file)
@@ -78,6 +78,11 @@ EstOutput SharedChao1::getValues(vector<SharedRAbundVector*> shared){
                        Chao += leftvalue + rightvalue;
                }
                
+               for (int i = 0; i < numNodes; i++) {
+                       delete f1leaves[i];
+                       delete f2leaves[i];
+               }
+               
        //      cout << "exiting " << endl;
                data[0] = Chao;
                return data;
index 1b8023d8ea190bcde9b64dae1ca815fea84c8136..a6ade30725644ef9da4cfd303a17530e26eff3d8 100644 (file)
@@ -78,7 +78,7 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0),
                holdLabel = label;
                
                //add new vector to lookup
-               lookup.push_back(new SharedRAbundVector(num));
+               lookup.push_back(new SharedRAbundVector());
                lookup[0]->setLabel(label);
                lookup[0]->setGroup(groupN);
                
@@ -117,7 +117,7 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0),
                        }
                        
                        //add new vector to lookup
-                       lookup.push_back(new SharedRAbundVector(num));
+                       lookup.push_back(new SharedRAbundVector());
                        lookup[count]->setLabel(label);
                        lookup[count]->setGroup(groupN);