]> git.donarmstrong.com Git - mothur.git/blobdiff - weighted.cpp
added subsample and consensus parameters to unifrac.weighted command
[mothur.git] / weighted.cpp
index d0defc3394b8aa3dc7010837c12ad4a8d0cfc472..b0a642b1b5024710530e95de5b2a57cc87a7accd 100644 (file)
@@ -19,7 +19,7 @@ EstOutput Weighted::getValues(Tree* t, int p, string o) {
                processors = p;
                outputDir = o;
                
-               numGroups = m->Groups.size();
+               numGroups = m->getNumGroups();
                
                if (m->control_pressed) { return data; }
                
@@ -29,12 +29,12 @@ EstOutput Weighted::getValues(Tree* t, int p, string o) {
                        for (int l = 0; l < i; l++) {   
                                //initialize weighted scores
                                //WScore[globaldata->Groups[i]+globaldata->Groups[l]] = 0.0;
-                               vector<string> groups; groups.push_back(m->Groups[i]); groups.push_back(m->Groups[l]);
+                               vector<string> groups; groups.push_back((m->getGroups())[i]); groups.push_back((m->getGroups())[l]);
                                namesOfGroupCombos.push_back(groups);
                        }
                }
                
-               #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+               #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
                        if(processors == 1){
                                data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size());
                        }else{
@@ -69,7 +69,7 @@ EstOutput Weighted::getValues(Tree* t, int p, string o) {
 
 EstOutput Weighted::createProcesses(Tree* t, vector< vector<string> > namesOfGroupCombos) {
        try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
                int process = 1;
                vector<int> processIDS;
                
@@ -87,7 +87,7 @@ EstOutput Weighted::createProcesses(Tree* t, vector< vector<string> > namesOfGro
                                EstOutput Myresults;
                                Myresults = driver(t, namesOfGroupCombos, lines[process].start, lines[process].num);
                        
-                               m->mothurOut("Merging results."); m->mothurOutEndLine();
+                               //m->mothurOut("Merging results."); m->mothurOutEndLine();
                                
                                //pass numSeqs to parent
                                ofstream out;
@@ -139,10 +139,10 @@ EstOutput Weighted::createProcesses(Tree* t, vector< vector<string> > namesOfGro
                                m->gobble(in);
                        }
                        in.close();
-                       remove(s.c_str());
+                       m->mothurRemove(s);
                }
                
-               m->mothurOut("DONE."); m->mothurOutEndLine(); m->mothurOutEndLine();
+               //m->mothurOut("DONE."); m->mothurOutEndLine(); m->mothurOutEndLine();
                
                return results;
 #endif