]> git.donarmstrong.com Git - mothur.git/commitdiff
version working on mac with .tellg changed to unget for windows
authorwestcott <westcott>
Fri, 19 Jun 2009 17:15:00 +0000 (17:15 +0000)
committerwestcott <westcott>
Fri, 19 Jun 2009 17:15:00 +0000 (17:15 +0000)
readotu.cpp
readotucommand.cpp
screenseqscommand.cpp
shared.cpp
shared.h
sharedcommand.cpp
sharedrabundvector.cpp

index b97c902d7712e957ea44819d24cd7af0ae22cd4a..a99f343c83e35cd42724ddef6b32d26f4d0c88a6 100644 (file)
@@ -44,12 +44,15 @@ void ReadOTUFile::read(GlobalData* globaldata){
                        sabund = inputSabund->getSAbundVector(); 
                        //if (globaldata->sabund != NULL) { delete globaldata->sabund;  }
                        globaldata->sabund = sabund; //saving to be used by summary command.
+                       delete inputSabund;
                        rabund = inputRabund->getRAbundVector(); 
                        //if (globaldata->rabund != NULL) { delete globaldata->rabund;  }
                        globaldata->rabund = rabund; //saving to be used by heatmap.bin command.
+                       delete inputRabund;
                        list = inputList->getListVector();
                        //if (globaldata->gListVector != NULL) { delete globaldata->gListVector;  }
                        globaldata->gListVector = list;
+                       delete inputList;
 
                }else if (globaldata->getFormat() == "shared") {
                        SharedList = input->getSharedListVector(); //you are reading for collect.shared, rarefaction.shared, summary.shared, parselist command, or shared commands.
index 2df74e4e6c3283db6808754ede700c66d9c56b6e..50ee5c103c00a144159b52a8c1779b7627e46079 100644 (file)
@@ -107,7 +107,6 @@ ReadOtuCommand::ReadOtuCommand(string option){
                        if (abort == false) {
                                //gets whichever one of the above is set
                                filename = globaldata->inputFileName;
-                               //read = new ReadOTUFile(filename);
                        }
 
                }
@@ -156,9 +155,7 @@ void ReadOtuCommand::help(){
 //**********************************************************************************************************************
 
 ReadOtuCommand::~ReadOtuCommand(){
-       if (abort == false) {  //delete read; 
-        }
-}
+       }
 
 //**********************************************************************************************************************
 
@@ -167,9 +164,7 @@ int ReadOtuCommand::execute(){
        
                if (abort == true) {    return 0;       }
                
-               //read->read(&*globaldata); 
                if (globaldata->getFormat() == "shared") {
-                       //groupMap->readMap();
                        
                        parselist = new ParseListCommand();
                        parselist->execute();
index ca1d616a867c33a3d42dd98131960db6d2224177..70094f2f3afe77711dcb4fe7b46d70f3d35f4835 100644 (file)
@@ -39,7 +39,7 @@ ScreenSeqsCommand::ScreenSeqsCommand(string option){
                        fastafile = validParameter.validFile(parameters, "fasta", true);
                        if (fastafile == "not found") { cout << "fasta is a required parameter for the screen.seqs command." << endl; abort = true; }
                        else if (fastafile == "not open") { abort = true; }     
-               
+       
                        groupfile = validParameter.validFile(parameters, "group", true);
                        if (groupfile == "not open") { abort = true; }  
                        else if (groupfile == "not found") { groupfile = ""; }
@@ -50,7 +50,7 @@ ScreenSeqsCommand::ScreenSeqsCommand(string option){
 
                        alignreport = validParameter.validFile(parameters, "alignreport", true);
                        if (alignreport == "not open") { abort = true; }
-                       else if (alignreport == "not found") { namefile = ""; } 
+                       else if (alignreport == "not found") { alignreport = ""; }      
                        
                        //check for optional parameter and set defaults
                        // ...at some point should added some additional type checking...
index 36dbbb1117067253b04150cbf5a4c6f592906861..b15ef93f32b58f7b294704cbe44aaa90472cf349 100644 (file)
@@ -40,7 +40,7 @@ void Shared::getSharedVectors(SharedListVector* list) {
                }
                
                //updates sharedVector
-               sharedRAbund.push_back(sharedGroups);
+               //sharedRAbund.push_back(sharedGroups);
 }
 
 
index c80ef6606216b6747f0d407cf1895ebbb33ed22e..515c2a0da33ab4b2bfc63c25c409ba37fd2ecd49 100644 (file)
--- a/shared.h
+++ b/shared.h
@@ -26,7 +26,7 @@ class Shared {
                GlobalData* globaldata;
                map<string, SharedRAbundVector*>::iterator it;
                void parse(int, SharedListVector*);
-               vector< map<string, SharedRAbundVector*> > sharedRAbund;  //contains all the info needed to create the .shared file not sure if we will need 
+               //vector< map<string, SharedRAbundVector*> > sharedRAbund;  //contains all the info needed to create the .shared file not sure if we will need 
 };
 
 #endif
index dd900643a741d576d1595c1a9c346d6b6c334361..42601f48ead5e872d000e35c9b64852ddccd5eb8 100644 (file)
@@ -81,6 +81,7 @@ int SharedCommand::execute(){
                        if (count != 1) { delete lastList; }
                        lastList = SharedList;                  
                        SharedList = input->getSharedListVector(); //get new list vector to process
+                       count++;
                        
                        //if (count != 1) { for (int i = 0; i < lastLookup.size(); i++) {  delete lastLookup[i];  } }
                        //lastLookup = lookup; 
@@ -106,7 +107,7 @@ int SharedCommand::execute(){
                        printSharedData(); //prints info to the .shared file
                }
                
-               delete lastList;
+               delete lastList; globaldata->gSharedList = NULL;
                delete shared;
                out.close();
                
index f60562a75a5202a366a6bf9cbd831421133feab0..6bf4916ea2ceb2a412a7833faa1386eb9d43d06f 100644 (file)
@@ -63,7 +63,7 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0),
                
                if (globaldata->gGroupmap == NULL) {  groupmap = new GroupMap(); }
                
-               int num, inputData, pos, count;
+               int num, inputData, count;
                count = 0;  
                string holdLabel, nextLabel, groupN;
                individual newguy;
@@ -99,9 +99,6 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0),
                        
                }
                
-               //save position in file in case next line is a new label.
-               pos = f.tellg();
-               
                if (f.eof() != true) { f >> nextLabel; }
                
                //read the rest of the groups info in
@@ -127,14 +124,12 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0),
                                lookup[count]->push_back(inputData, i, groupN); //abundance, bin, group
                        }
                        
-                       //save position in file in case next line is a new label.
-                       pos = f.tellg();
-       
+                               
                        if (f.eof() != true) { f >> nextLabel; }
                }
                
                //put file pointer back since you are now at a new distance label
-               f.seekg(pos, ios::beg);
+               for (int i = 0; i < nextLabel.length(); i++) { f.unget();  }
        
                if (globaldata->gGroupmap == NULL) { globaldata->gGroupmap = groupmap;  }
                
@@ -392,7 +387,9 @@ vector<SharedRAbundVector*> SharedRAbundVector::getSharedRAbundVectors(){
                                i--; 
                        }
                }
-
+               
+               delete util;
+       
                return lookup;
        }
        catch(exception& e) {