]> git.donarmstrong.com Git - mothur.git/blobdiff - rarefactsharedcommand.cpp
rarefaction.shared() fixed bug
[mothur.git] / rarefactsharedcommand.cpp
index 4ed479555ab7ac66a75e789e71f9be5053ec3ae2..5e36299505246ecbdbae8c64822a59e916f54dcc 100644 (file)
 RareFactSharedCommand::RareFactSharedCommand(){
        try {
                globaldata = GlobalData::getInstance();
-               string fileNameRoot, groups;
+               string fileNameRoot;
                fileNameRoot = getRootName(globaldata->inputFileName);
-               groupmap = globaldata->gGroupmap;
-               
-               //initialize groups for label
-               groups = "";
-               for (int i = 0; i < groupmap->namesOfGroups.size(); i++) {
-                       groups = groups + groupmap->namesOfGroups[i];
-               }
-               
+                               
                int i;
                for (i=0; i<globaldata->sharedRareEstimators.size(); i++) {
                        if (globaldata->sharedRareEstimators[i] == "sharedobserved") { 
-                               rDisplays.push_back(new RareDisplay(new SharedSobs(), new SharedThreeColumnFile(fileNameRoot+"sharedObserved", groups)));
+                               rDisplays.push_back(new RareDisplay(new SharedSobs(), new SharedThreeColumnFile(fileNameRoot+"shared.rarefaction", "")));
                        }
                }
        }
@@ -61,8 +54,8 @@ int RareFactSharedCommand::execute(){
                read->read(&*globaldata); 
                
                input = globaldata->ginput;
-               list = globaldata->glist;
-               order = list->getSharedOrderVector();
+               SharedList = globaldata->gSharedList;
+               order = SharedList->getSharedOrderVector();
                
                while(order != NULL){
                
@@ -78,9 +71,9 @@ int RareFactSharedCommand::execute(){
                                cout << order->getLabel() << '\t' << count << endl;
                        }
                        
-                       list = input->getListVector(); //get new list vector to process
-                       if (list != NULL) {
-                               order = list->getSharedOrderVector(); //gets new order vector with group info.
+                       SharedList = input->getSharedListVector(); //get new list vector to process
+                       if (SharedList != NULL) {
+                               order = SharedList->getSharedOrderVector(); //gets new order vector with group info.
                                count++;
                        }else {
                                break;