]> git.donarmstrong.com Git - mothur.git/blobdiff - readotucommand.cpp
added screen.seqs command - pds
[mothur.git] / readotucommand.cpp
index 130ecd0f08a540239e0cbbbf1862611528e1d8a8..c8ec791c5c667e1f01bfdc59944ed2811e345d6c 100644 (file)
@@ -14,7 +14,11 @@ ReadOtuCommand::ReadOtuCommand(){
        try {
                globaldata = GlobalData::getInstance();
                filename = globaldata->inputFileName;
-               read = new ReadPhilFile(filename);
+               read = new ReadOTUFile(filename);
+               if (globaldata->getFormat() == "shared") {
+                       //read in group map info.
+                       groupMap = new GroupMap(globaldata->getGroupFile());
+               }
        }
        catch(exception& e) {
                cout << "Standard Error: " << e.what() << " has occurred in the ReadOtuCommand class Function ReadOtuCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
@@ -37,6 +41,23 @@ ReadOtuCommand::~ReadOtuCommand(){
 int ReadOtuCommand::execute(){
        try {
                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();
+                       
+                       //change format to shared  to speed up commands
+                       globaldata->setFormat("sharedfile");
+                       globaldata->setListFile("");
+                       globaldata->setGroupFile("");
+                       globaldata->setSharedFile(getRootName(filename) + "shared");
+               }
                return 0;
        }
        catch(exception& e) {
@@ -48,4 +69,4 @@ int ReadOtuCommand::execute(){
                exit(1);
        }
 }
-//**********************************************************************************************************************
\ No newline at end of file
+//**********************************************************************************************************************