]> git.donarmstrong.com Git - mothur.git/blobdiff - rarefactsharedcommand.cpp
fixed bug with get.oturep and fixed problem with errorcheckor that did not allow...
[mothur.git] / rarefactsharedcommand.cpp
index 45c2e2ebbdfc0004a8e1d6acb551649fe82b1239..dc71b22b3cab606d13f1e86a743aee1b5bf104a5 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "rarefactsharedcommand.h"
 #include "sharedsobs.h"
+#include "sharednseqs.h"
 
 //**********************************************************************************************************************
 
@@ -19,13 +20,17 @@ RareFactSharedCommand::RareFactSharedCommand(){
                fileNameRoot = getRootName(globaldata->inputFileName);
                format = globaldata->getFormat();
                validCalculator = new ValidCalculators();
+               util = new SharedUtil();
                                
                int i;
                for (i=0; i<globaldata->Estimators.size(); i++) {
                        if (validCalculator->isValidCalculator("sharedrarefaction", globaldata->Estimators[i]) == true) { 
                                if (globaldata->Estimators[i] == "sharedobserved") { 
                                        rDisplays.push_back(new RareDisplay(new SharedSobs(), new SharedThreeColumnFile(fileNameRoot+"shared.rarefaction", "")));
+                               }else if (globaldata->Estimators[i] == "sharednseqs") { 
+                                       rDisplays.push_back(new RareDisplay(new SharedNSeqs(), new SharedThreeColumnFile(fileNameRoot+"shared.r_nseqs", "")));
                                }
+
                        }
                }
                
@@ -51,6 +56,7 @@ RareFactSharedCommand::~RareFactSharedCommand(){
        delete input;
        delete rCurve;
        delete read;
+       delete util;
 }
 
 //**********************************************************************************************************************
@@ -78,6 +84,9 @@ int RareFactSharedCommand::execute(){
                        order = SharedList->getSharedOrderVector();
                }
                
+               //set users groups
+               util->setGroups(globaldata->Groups, globaldata->gGroupmap->namesOfGroups, "rarefact");
+               
                while(order != NULL){
                
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(order->getLabel()) == 1){
@@ -109,6 +118,10 @@ int RareFactSharedCommand::execute(){
                }
        
                for(int i=0;i<rDisplays.size();i++){    delete rDisplays[i];    }       
+               
+               //reset groups parameter
+               globaldata->Groups.clear();  globaldata->setGroups("");
+
                return 0;
        }
        catch(exception& e) {