]> git.donarmstrong.com Git - mothur.git/blobdiff - unweighted.cpp
added otu.association command. added calcSpearman, calcKendall and calcPearson functi...
[mothur.git] / unweighted.cpp
index 90b6476543d67ee92d7c59624e2af8da2a7b2345..431323f066665bd07edce8da80c32dadb1600cf2 100644 (file)
@@ -17,7 +17,7 @@ EstOutput Unweighted::getValues(Tree* t, int p, string o) {
                outputDir = o;
                        
                //if the users enters no groups then give them the score of all groups
-               int numGroups = m->Groups.size();
+               int numGroups = m->getNumGroups();
                
                //calculate number of comparsions
                int numComp = 0;
@@ -25,7 +25,7 @@ EstOutput Unweighted::getValues(Tree* t, int p, string o) {
                for (int r=0; r<numGroups; r++) { 
                        for (int l = 0; l < r; l++) {
                                numComp++;
-                               vector<string> groups; groups.push_back(m->Groups[r]); groups.push_back(m->Groups[l]);
+                               vector<string> groups; groups.push_back((m->getGroups())[r]); groups.push_back((m->getGroups())[l]);
                                namesOfGroupCombos.push_back(groups);
                        }
                }
@@ -34,15 +34,15 @@ EstOutput Unweighted::getValues(Tree* t, int p, string o) {
                        vector<string> groups;
                        if (numGroups == 0) {
                                //get score for all users groups
-                               for (int i = 0; i < tmap->namesOfGroups.size(); i++) {
-                                       if (tmap->namesOfGroups[i] != "xxx") {
-                                               groups.push_back(tmap->namesOfGroups[i]);
+                               for (int i = 0; i < (tmap->getNamesOfGroups()).size(); i++) {
+                                       if ((tmap->getNamesOfGroups())[i] != "xxx") {
+                                               groups.push_back((tmap->getNamesOfGroups())[i]);
                                        }
                                }
                                namesOfGroupCombos.push_back(groups);
                        }else {
-                               for (int i = 0; i < m->Groups.size(); i++) {
-                                       groups.push_back(m->Groups[i]);
+                               for (int i = 0; i < m->getNumGroups(); i++) {
+                                       groups.push_back((m->getGroups())[i]);
                                }
                                namesOfGroupCombos.push_back(groups);
                        }
@@ -151,7 +151,7 @@ EstOutput Unweighted::createProcesses(Tree* t, vector< vector<string> > namesOfG
                                m->gobble(in);
                        }
                        in.close();
-                       remove(s.c_str());
+                       m->mothurRemove(s);
                }
                
                m->mothurOut("DONE."); m->mothurOutEndLine(); m->mothurOutEndLine();
@@ -260,7 +260,7 @@ EstOutput Unweighted::getValues(Tree* t, string groupA, string groupB, int p, st
                outputDir = o;
                
                //if the users enters no groups then give them the score of all groups
-               int numGroups = m->Groups.size();
+               int numGroups = m->getNumGroups();
                
                //calculate number of comparsions
                int numComp = 0;
@@ -268,7 +268,7 @@ EstOutput Unweighted::getValues(Tree* t, string groupA, string groupB, int p, st
                for (int r=0; r<numGroups; r++) { 
                        for (int l = 0; l < r; l++) {
                                numComp++;
-                               vector<string> groups; groups.push_back(m->Groups[r]); groups.push_back(m->Groups[l]);
+                               vector<string> groups; groups.push_back((m->getGroups())[r]); groups.push_back((m->getGroups())[l]);
                                namesOfGroupCombos.push_back(groups);
                        }
                }
@@ -277,15 +277,15 @@ EstOutput Unweighted::getValues(Tree* t, string groupA, string groupB, int p, st
                        vector<string> groups;
                        if (numGroups == 0) {
                                //get score for all users groups
-                               for (int i = 0; i < tmap->namesOfGroups.size(); i++) {
-                                       if (tmap->namesOfGroups[i] != "xxx") {
-                                               groups.push_back(tmap->namesOfGroups[i]);
+                               for (int i = 0; i < (tmap->getNamesOfGroups()).size(); i++) {
+                                       if ((tmap->getNamesOfGroups())[i] != "xxx") {
+                                               groups.push_back((tmap->getNamesOfGroups())[i]);
                                        }
                                }
                                namesOfGroupCombos.push_back(groups);
                        }else {
-                               for (int i = 0; i < m->Groups.size(); i++) {
-                                       groups.push_back(m->Groups[i]);
+                               for (int i = 0; i < m->getNumGroups(); i++) {
+                                       groups.push_back((m->getGroups())[i]);
                                }
                                namesOfGroupCombos.push_back(groups);
                        }
@@ -393,7 +393,7 @@ EstOutput Unweighted::createProcesses(Tree* t, vector< vector<string> > namesOfG
                                m->gobble(in);
                        }
                        in.close();
-                       remove(s.c_str());
+                       m->mothurRemove(s);
                }
                
                return results;