]> git.donarmstrong.com Git - mothur.git/commitdiff
rarefaction.shared() fixed bug
authorwestcott <westcott>
Thu, 29 Jan 2009 14:36:15 +0000 (14:36 +0000)
committerwestcott <westcott>
Thu, 29 Jan 2009 14:36:15 +0000 (14:36 +0000)
collectsharedcommand.cpp
commandfactory.cpp
fileoutput.h
rarefact.cpp
rarefactsharedcommand.cpp
rarefactsharedcommand.h
sharedsobs.cpp

index 434d4a44311f57300c42623c0b052cff012d9e10..1f5ed558985d4361a4145b9811d19f508b79a630 100644 (file)
@@ -28,32 +28,32 @@ CollectSharedCommand::CollectSharedCommand(){
                globaldata = GlobalData::getInstance();
                string fileNameRoot;
                fileNameRoot = getRootName(globaldata->inputFileName);
-               groupmap = globaldata->gGroupmap;
+               //groupmap = globaldata->gGroupmap;
                
                int i;
                for (i=0; i<globaldata->sharedEstimators.size(); i++) {
                        if (globaldata->sharedEstimators[i] == "sharedChao") { 
-                               cDisplays.push_back(new CollectDisplay(new SharedChao1(), new SharedOneColumnFile(fileNameRoot+"shared.chao", groupmap->namesOfGroups)));
+                               cDisplays.push_back(new CollectDisplay(new SharedChao1(), new SharedOneColumnFile(fileNameRoot+"shared.chao")));
                        }else if (globaldata->sharedEstimators[i] == "sharedSobs") { 
-                               cDisplays.push_back(new CollectDisplay(new SharedSobs(), new SharedOneColumnFile(fileNameRoot+"shared.sobs", groupmap->namesOfGroups)));
+                               cDisplays.push_back(new CollectDisplay(new SharedSobs(), new SharedOneColumnFile(fileNameRoot+"shared.sobs")));
                        }else if (globaldata->sharedEstimators[i] == "sharedAce") { 
-                               cDisplays.push_back(new CollectDisplay(new SharedAce(), new SharedOneColumnFile(fileNameRoot+"shared.ace", groupmap->namesOfGroups)));
+                               cDisplays.push_back(new CollectDisplay(new SharedAce(), new SharedOneColumnFile(fileNameRoot+"shared.ace")));
                        }else if (globaldata->sharedEstimators[i] == "sharedJabund") {  
-                               cDisplays.push_back(new CollectDisplay(new SharedJAbund(), new SharedOneColumnFile(fileNameRoot+"shared.jabund", groupmap->namesOfGroups)));
+                               cDisplays.push_back(new CollectDisplay(new SharedJAbund(), new SharedOneColumnFile(fileNameRoot+"shared.jabund")));
                        }else if (globaldata->sharedEstimators[i] == "sharedSorensonAbund") { 
-                               cDisplays.push_back(new CollectDisplay(new SharedSorAbund(), new SharedOneColumnFile(fileNameRoot+"shared.sorabund", groupmap->namesOfGroups)));
+                               cDisplays.push_back(new CollectDisplay(new SharedSorAbund(), new SharedOneColumnFile(fileNameRoot+"shared.sorabund")));
                        }else if (globaldata->sharedEstimators[i] == "sharedJclass") { 
-                               cDisplays.push_back(new CollectDisplay(new SharedJclass(), new SharedOneColumnFile(fileNameRoot+"shared.jclass", groupmap->namesOfGroups)));
+                               cDisplays.push_back(new CollectDisplay(new SharedJclass(), new SharedOneColumnFile(fileNameRoot+"shared.jclass")));
                        }else if (globaldata->sharedEstimators[i] == "sharedSorClass") { 
-                               cDisplays.push_back(new CollectDisplay(new SharedSorClass(), new SharedOneColumnFile(fileNameRoot+"shared.sorclass", groupmap->namesOfGroups)));
+                               cDisplays.push_back(new CollectDisplay(new SharedSorClass(), new SharedOneColumnFile(fileNameRoot+"shared.sorclass")));
                        }else if (globaldata->sharedEstimators[i] == "sharedJest") { 
-                               cDisplays.push_back(new CollectDisplay(new SharedJest(), new SharedOneColumnFile(fileNameRoot+"shared.jest", groupmap->namesOfGroups)));
+                               cDisplays.push_back(new CollectDisplay(new SharedJest(), new SharedOneColumnFile(fileNameRoot+"shared.jest")));
                        }else if (globaldata->sharedEstimators[i] == "sharedSorEst") { 
-                               cDisplays.push_back(new CollectDisplay(new SharedSorEst(), new SharedOneColumnFile(fileNameRoot+"shared.sorest", groupmap->namesOfGroups)));
+                               cDisplays.push_back(new CollectDisplay(new SharedSorEst(), new SharedOneColumnFile(fileNameRoot+"shared.sorest")));
                        }else if (globaldata->sharedEstimators[i] == "SharedThetaYC") { 
-                               cDisplays.push_back(new CollectDisplay(new SharedThetaYC(), new SharedOneColumnFile(fileNameRoot+"shared.thetayc", groupmap->namesOfGroups)));
+                               cDisplays.push_back(new CollectDisplay(new SharedThetaYC(), new SharedOneColumnFile(fileNameRoot+"shared.thetayc")));
                        }else if (globaldata->sharedEstimators[i] == "SharedThetaN") { 
-                               cDisplays.push_back(new CollectDisplay(new SharedThetaN(), new SharedOneColumnFile(fileNameRoot+"shared.thetan", groupmap->namesOfGroups)));
+                               cDisplays.push_back(new CollectDisplay(new SharedThetaN(), new SharedOneColumnFile(fileNameRoot+"shared.thetan")));
                        }
                }
        }
index 2419369ef4524f984464f4385734de66e4795d31..ed6aebe7cadcf302c180a553ca5f586486371874 100644 (file)
@@ -51,7 +51,7 @@ Command* CommandFactory::getCommand(string commandName){
 
                         if(commandName == "read.dist")                         {       command = new ReadDistCommand();                }
                else if(commandName == "read.otu")                              {       command = new ReadOtuCommand();                 }
-               else if(commandName == "read.tree")                             {       command = new ReadTreeCommand();                }
+               //else if(commandName == "read.tree")                           {       command = new ReadTreeCommand();                }
                else if(commandName == "cluster")                               {       command = new ClusterCommand();                 }
                else if(commandName == "deconvolute")                   {       command = new DeconvoluteCommand();             }
                else if(commandName == "help")                                  {       command = new HelpCommand();                    }
index 6eb5e8d708eca6f102c7a562507ac92e1553e336..b7837d2277ed89d17b54d52ea180ac095856ba34 100644 (file)
@@ -69,7 +69,7 @@ class SharedOneColumnFile : public FileOutput {
        
        
 public:
-       SharedOneColumnFile(string n, vector<string> g) : inName(n), counter(0), outName(getPathName(n) + ".temp." + getSimpleName(n)) {};
+       SharedOneColumnFile(string n) : inName(n), counter(0), outName(getPathName(n) + ".temp." + getSimpleName(n)) {};
        ~SharedOneColumnFile();
        void output(int, vector<double>);
        void initFile(string);
index 0be032727ab5dcb9294b670fe4dffcfa52a328cd..e776393b47318e8a7f9b79016433f75a8ba049d9 100644 (file)
@@ -3,7 +3,7 @@
  *  Dotur
  *
  *  Created by Sarah Westcott on 11/18/08.
- *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *  Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
 
@@ -115,17 +115,10 @@ try {
                        //randomize the groups
                        random_shuffle(lookup.begin(), lookup.end());
                
-                       //send the first group
-                       rcd->updateSharedData(lookup[0], lookup[0], 1, numGroupComb);
-                               
-                       //send each additional group one at a time
-                       int n = 1;
-                       for (int k = 0; k < (lookup.size() - 1); k++) { 
-                               for (int l = n; l < lookup.size(); l++) {
-                                       rcd->updateSharedData(lookup[k], lookup[l], l+1, numGroupComb);
-                                       mergeVectors(lookup[0], lookup[l]);
-                               }
-                               n++;
+                       //send each group one at a time
+                       for (int k = 0; k < lookup.size(); k++) { 
+                               rcd->updateSharedData(lookup[0], lookup[k], k+1, numGroupComb);
+                               mergeVectors(lookup[0], lookup[k]);
                        }
 
                        //resets output files
index 189be88de11e4160b4e185727e324a581063727f..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+"r_shared.observed", groups)));
+                               rDisplays.push_back(new RareDisplay(new SharedSobs(), new SharedThreeColumnFile(fileNameRoot+"shared.rarefaction", "")));
                        }
                }
        }
index e7d2abc239044e7e4e2de376e0503e580e623f5d..1d877106bda0678fadfd99fff7e17f9766daa841 100644 (file)
@@ -17,7 +17,6 @@
 #include "sharedordervector.h"
 #include "sharedlistvector.h"
 #include "inputdata.h"
-#include "groupmap.h"
 #include "rarefact.h"
 #include "display.h"
 #include "readmatrix.hpp"
@@ -45,7 +44,6 @@ public:
        
 private:
        GlobalData* globaldata;
-       GroupMap* groupmap;
        SharedListVector* SharedList;
        ReadMatrix* read;
        SharedOrderVector* order;
index 14f5bf59d6552303d664e275e7c4173643a36179..9c3f4ddb1d47f1518791d6d95e3f94200823f175 100644 (file)
@@ -16,7 +16,7 @@
 EstOutput SharedSobs::getValues(SharedRAbundVector* shared1, SharedRAbundVector* shared2){
        try {
                data.resize(1,0);
-               int observed = 0;;
+               int observed = 0;
 
                //loop through the species in each group
                for (int k = 0; k < shared1->size(); k++) {