]> git.donarmstrong.com Git - mothur.git/blobdiff - sharedrabundvector.cpp
added multiple processors option for Windows users to align.seqs, dist.seqs, summary...
[mothur.git] / sharedrabundvector.cpp
index 7952859bccb3048bd796bdb05f74d2d920ed9c05..56b7d094b1444a2afada95807a36b52e235c70e8 100644 (file)
@@ -59,8 +59,9 @@ SharedRAbundVector::SharedRAbundVector(string id, vector<individual> rav) : Data
 //reads a shared file
 SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0), numBins(0), numSeqs(0) {
        try {
-               m->namesOfGroups.clear();
-                               
+               m->clearAllGroups();
+               vector<string> allGroups;
+               
                int num, inputData, count;
                count = 0;  
                string holdLabel, nextLabel, groupN;
@@ -112,7 +113,7 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0),
                lookup[0]->setLabel(label);
                lookup[0]->setGroup(groupN);
                
-               m->namesOfGroups.push_back(groupN);
+               allGroups.push_back(groupN);
                
                //fill vector.  data = first sharedrabund in file
                for(int i=0;i<num;i++){
@@ -133,7 +134,7 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0),
                        f >> groupN >> num;
                        count++;
                        
-                       m->namesOfGroups.push_back(groupN);
+                       allGroups.push_back(groupN);
                        
                        //add new vector to lookup
                        temp = new SharedRAbundVector();
@@ -152,7 +153,8 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0),
                                
                        if (f.eof() != true) { f >> nextLabel; }
                }
-                       m->saveNextLabel = nextLabel;
+               m->saveNextLabel = nextLabel;
+               m->setAllGroups(allGroups);
                
        }
        catch(exception& e) {
@@ -418,12 +420,14 @@ vector<SharedRAbundVector*> SharedRAbundVector::getSharedRAbundVectors(){
                SharedUtil* util;
                util = new SharedUtil();
                
-               util->setGroups(m->Groups, m->namesOfGroups);
+               vector<string> Groups = m->getGroups();
+               vector<string> allGroups = m->getAllGroups();
+               util->setGroups(Groups, allGroups);
                
                bool remove = false;
                for (int i = 0; i < lookup.size(); i++) {
                        //if this sharedrabund is not from a group the user wants then delete it.
-                       if (util->isValidGroup(lookup[i]->getGroup(), m->Groups) == false) { 
+                       if (util->isValidGroup(lookup[i]->getGroup(), m->getGroups()) == false) { 
                                remove = true;
                                delete lookup[i]; lookup[i] = NULL;
                                lookup.erase(lookup.begin()+i);