]> git.donarmstrong.com Git - mothur.git/blobdiff - readotucommand.cpp
added sharedochiai and sharedanderberg calculators
[mothur.git] / readotucommand.cpp
index 130ecd0f08a540239e0cbbbf1862611528e1d8a8..7a48f2c5b3b0146c4397325ca531c0bad9005146 100644 (file)
@@ -15,6 +15,10 @@ ReadOtuCommand::ReadOtuCommand(){
                globaldata = GlobalData::getInstance();
                filename = globaldata->inputFileName;
                read = new ReadPhilFile(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,17 @@ 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();
+               }
                return 0;
        }
        catch(exception& e) {
@@ -48,4 +63,4 @@ int ReadOtuCommand::execute(){
                exit(1);
        }
 }
-//**********************************************************************************************************************
\ No newline at end of file
+//**********************************************************************************************************************