]> git.donarmstrong.com Git - mothur.git/blobdiff - readotucommand.cpp
version working on mac with .tellg changed to unget for windows
[mothur.git] / readotucommand.cpp
index 7c3e1995ecf9315839b5f26ab9f7768d59e6ca08..50ee5c103c00a144159b52a8c1779b7627e46079 100644 (file)
@@ -64,6 +64,7 @@ ReadOtuCommand::ReadOtuCommand(string option){
                                globaldata->setGroupFile(groupfile); 
                                groupMap = new GroupMap(groupfile);
                                groupMap->readMap();
+                               globaldata->gGroupmap = groupMap;
                        }
 
                        //you are doing a list and group shared
@@ -106,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);
                        }
 
                }
@@ -155,8 +155,7 @@ void ReadOtuCommand::help(){
 //**********************************************************************************************************************
 
 ReadOtuCommand::~ReadOtuCommand(){
-       if (abort == false) {  delete read;  }
-}
+       }
 
 //**********************************************************************************************************************
 
@@ -165,17 +164,15 @@ int ReadOtuCommand::execute(){
        
                if (abort == true) {    return 0;       }
                
-               read->read(&*globaldata); 
                if (globaldata->getFormat() == "shared") {
-                       groupMap->readMap();
                        
-                       //if (globaldata->gGroupmap != NULL) { delete globaldata->gGroupmap;  }
-                       globaldata->gGroupmap = groupMap;               
-                       shared = new SharedCommand();
-                       shared->execute();
-
                        parselist = new ParseListCommand();
                        parselist->execute();
+                       delete parselist;
+                       
+                       shared = new SharedCommand();
+                       shared->execute();
+                       delete shared;
                        
                        //change format to shared  to speed up commands
                        globaldata->setFormat("sharedfile");