EstOutput Weighted::getValues(Tree* t, int p, string o) {
try {
- globaldata = GlobalData::getInstance();
-
data.clear(); //clear out old values
int numGroups;
vector<double> D;
processors = p;
outputDir = o;
+
+ TreeMap* tmap = t->getTreeMap();
- numGroups = globaldata->Groups.size();
+ numGroups = m->getNumGroups();
if (m->control_pressed) { return data; }
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(globaldata->Groups[i]); groups.push_back(globaldata->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());
+ data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size(), tmap);
}else{
int numPairs = namesOfGroupCombos.size();
lines.push_back(linePair(startPos, numPairsPerProcessor));
}
- data = createProcesses(t, namesOfGroupCombos);
+ data = createProcesses(t, namesOfGroupCombos, tmap);
lines.clear();
}
#else
- data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size());
+ data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size(), tmap);
#endif
return data;
}
/**************************************************************************************************/
-EstOutput Weighted::createProcesses(Tree* t, vector< vector<string> > namesOfGroupCombos) {
+EstOutput Weighted::createProcesses(Tree* t, vector< vector<string> > namesOfGroupCombos, TreeMap* tmap) {
try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 1;
vector<int> processIDS;
}else if (pid == 0){
EstOutput Myresults;
- Myresults = driver(t, namesOfGroupCombos, lines[process].start, lines[process].num);
+ Myresults = driver(t, namesOfGroupCombos, lines[process].start, lines[process].num, tmap);
- m->mothurOut("Merging results."); m->mothurOutEndLine();
+ //m->mothurOut("Merging results."); m->mothurOutEndLine();
//pass numSeqs to parent
ofstream out;
}
}
- results = driver(t, namesOfGroupCombos, lines[0].start, lines[0].num);
+ results = driver(t, namesOfGroupCombos, lines[0].start, lines[0].num, tmap);
//force parent to wait until all the processes are done
for (int i=0;i<(processors-1);i++) {
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
}
}
/**************************************************************************************************/
-EstOutput Weighted::driver(Tree* t, vector< vector<string> > namesOfGroupCombos, int start, int num) {
+EstOutput Weighted::driver(Tree* t, vector< vector<string> > namesOfGroupCombos, int start, int num, TreeMap* tmap) {
try {
EstOutput results;
vector<double> D;
/**************************************************************************************************/
EstOutput Weighted::getValues(Tree* t, string groupA, string groupB) {
try {
- globaldata = GlobalData::getInstance();
data.clear(); //clear out old values
+
+ TreeMap* tmap = t->getTreeMap();
if (m->control_pressed) { return data; }