- //get data created by processes
- for (int i=0;i<processors;i++) {
- ifstream in;
- string s = toString(processIDS[i]) + ".temp";
- openInputFile(s, in);
-
- int size;
- in >> size; gobble(in);
-
- //get observed distances
- int count = lines[i]->start;
- for (int m = 0; m < size; m++) {
- int num;
- in >> num;
-
- vector<float> obs; float w;
- for (int j = 0; j < num; j++) {
- in >> w;
- obs.push_back(w);
- }
-
- obsDistance[count] = obs;
- count++;
- gobble(in);
- }
-
- gobble(in);
-
- //get expected distances
- count = lines[i]->start;
- for (int m = 0; m < size; m++) {
- int num;
- in >> num;
-
- vector<float> exp; float w;
- for (int j = 0; j < num; j++) {
- in >> w;
- exp.push_back(w);
- }
-
- expectedDistance[count] = exp;
- count++;
- gobble(in);
- }
-
- gobble(in);
-
- count = lines[i]->start;
- for (int m = 0; m < size; m++) {
- float num;
- in >> num;
-
- DE[count] = num;
- count++;
- }
-
- gobble(in);
-
- count = lines[i]->start;
- for (int m = 0; m < size; m++) {
- float num;
- in >> num;
-
- deviation[count] = num;
- count++;
- }
-
- in.close();
- remove(s.c_str());
- }
-
-
-#else
- mothurOut("Calculating observed distance... "); cout.flush();
- for (int i = lines[0]->start; i < lines[0]->end; i++) {
- vector<float> obsi = decalc->calcObserved(querySeqs[i], bestfit[i], windows[i], windowSizes[i]);
- obsDistance[i] = obsi;
- }
- mothurOut("Done."); mothurOutEndLine();
-
-
-
- mothurOut("Finding variability... "); cout.flush();
- for (int i = lines[0]->start; i < lines[0]->end; i++) {
- vector<float> q = decalc->findQav(windows[i], windowSizes[i], probabilityProfile, h[i]);
- Qav[i] = q;
- }
- mothurOut("Done."); mothurOutEndLine();
-
-
-
- mothurOut("Calculating alpha... "); cout.flush();
- for (int i = lines[0]->start; i < lines[0]->end; i++) {
- float alpha = decalc->getCoef(obsDistance[i], Qav[i]);
- seqCoef.push_back(alpha);
- }
- mothurOut("Done."); mothurOutEndLine();
-
-
-
- mothurOut("Calculating expected distance... "); cout.flush();
- for (int i = lines[0]->start; i < lines[0]->end; i++) {
- vector<float> exp = decalc->calcExpected(Qav[i], seqCoef[i]);
- expectedDistance[i] = exp;
- }
- mothurOut("Done."); mothurOutEndLine();
-
-
-
- mothurOut("Finding deviation... "); cout.flush();
- for (int i = lines[0]->start; i < lines[0]->end; i++) {
- float de = decalc->calcDE(obsDistance[i], expectedDistance[i]);
- DE[i] = de;
-
- it = trimmed[i].begin();
- float dist = decalc->calcDist(querySeqs[i], bestfit[i], it->first, it->second);
- deviation[i] = dist;
- }
- mothurOut("Done."); mothurOutEndLine();
-
-#endif