+ MPI_Status statusAcc;
+ int length = outAccString.length();
+ char* buf = new char[length];
+ memcpy(buf, outAccString.c_str(), length);
+
+ MPI_File_write_shared(outAcc, buf, length, MPI_CHAR, &statusAcc);
+ delete buf;
+
+ return *querySeq;
+ }
+ outputString += "Observed\t";
+
+ for (int j = 0; j < obsDistance.size(); j++) { outputString += toString(obsDistance[j]) + "\t"; }
+ outputString += "\n";
+
+ outputString += "Expected\t";
+
+ for (int m = 0; m < expectedDistance.size(); m++) { outputString += toString(expectedDistance[m]) + "\t"; }
+ outputString += "\n";
+
+ MPI_Status status;
+ int length = outputString.length();
+ char* buf2 = new char[length];
+ memcpy(buf2, outputString.c_str(), length);
+
+ MPI_File_write_shared(out, buf2, length, MPI_CHAR, &status);
+ delete buf2;
+
+ return *querySeq;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "Pintail", "print");
+ exit(1);
+ }
+}
+#endif
+//***************************************************************************************************************
+int Pintail::getChimeras(Sequence* query) {
+ try {
+ querySeq = query;
+ trimmed.clear();
+ windowSizes = window;
+
+ //find pairs has to be done before a mask
+ bestfit = findPairs(query);
+
+ if (m->control_pressed) { return 0; }
+
+ //if they mask
+ if (seqMask != "") {
+ decalc->runMask(query);
+ decalc->runMask(bestfit);
+ }
+
+ if (filter) { //must be done after a mask
+ runFilter(query);
+ runFilter(bestfit);
+ }
+
+
+ //trim seq
+ decalc->trimSeqs(query, bestfit, trimmed);
+
+ //find windows
+ it = trimmed.begin();
+ windowsForeachQuery = decalc->findWindows(query, it->first, it->second, windowSizes, increment);
+
+ //find observed distance
+ obsDistance = decalc->calcObserved(query, bestfit, windowsForeachQuery, windowSizes);
+
+ if (m->control_pressed) { return 0; }
+
+ Qav = decalc->findQav(windowsForeachQuery, windowSizes, probabilityProfile);
+
+ if (m->control_pressed) { return 0; }
+
+ //find alpha
+ seqCoef = decalc->getCoef(obsDistance, Qav);
+
+ //calculating expected distance
+ expectedDistance = decalc->calcExpected(Qav, seqCoef);
+
+ if (m->control_pressed) { return 0; }
+
+ //finding de
+ DE = decalc->calcDE(obsDistance, expectedDistance);
+
+ if (m->control_pressed) { return 0; }
+
+ //find distance between query and closest match
+ it = trimmed.begin();
+ deviation = decalc->calcDist(query, bestfit, it->first, it->second);
+
+ delete bestfit;
+
+ return 0;