+ m->mothurOut("Done."); m->mothurOutEndLine();
+ }
+
+ if (reRead) {
+ for (int i = 0; i < templateSeqs.size(); i++) { delete templateSeqs[i]; }
+ templateSeqs.clear();
+ templateSeqs = readSeqs(templateFileName);
+ }
+
+
+ //free memory
+ for (int i = 0; i < templateLines.size(); i++) { delete templateLines[i]; }
+
+ return 0;
+
+ }
+ catch(exception& e) {
+ m->errorOut(e, "Pintail", "doPrep");
+ exit(1);
+ }
+}
+//***************************************************************************************************************
+Sequence Pintail::print(ostream& out, ostream& outAcc) {
+ try {
+
+ int index = ceil(deviation);
+
+ //is your DE value higher than the 95%
+ string chimera;
+ if (index != 0) { //if index is 0 then its an exact match to a template seq
+ if (quantiles[index][4] == 0.0) {
+ chimera = "Your template does not include sequences that provide quantile values at distance " + toString(index);
+ }else {
+ if (DE > quantiles[index][4]) { chimera = "Yes"; }
+ else { chimera = "No"; }
+ }
+ }else{ chimera = "No"; }
+
+ out << querySeq->getName() << '\t' << "div: " << deviation << "\tstDev: " << DE << "\tchimera flag: " << chimera << endl;
+ if (chimera == "Yes") {
+ m->mothurOut(querySeq->getName() + "\tdiv: " + toString(deviation) + "\tstDev: " + toString(DE) + "\tchimera flag: " + chimera); m->mothurOutEndLine();
+ outAcc << querySeq->getName() << endl;
+ }
+ out << "Observed\t";
+
+ for (int j = 0; j < obsDistance.size(); j++) { out << obsDistance[j] << '\t'; }
+ out << endl;
+
+ out << "Expected\t";
+
+ for (int m = 0; m < expectedDistance.size(); m++) { out << expectedDistance[m] << '\t'; }
+ out << endl;
+
+ return *querySeq;
+
+ }
+ catch(exception& e) {
+ m->errorOut(e, "Pintail", "print");
+ exit(1);
+ }
+}
+#ifdef USE_MPI
+//***************************************************************************************************************
+Sequence Pintail::print(MPI_File& out, MPI_File& outAcc) {
+ try {
+
+ string outputString = "";
+ int index = ceil(deviation);
+
+ //is your DE value higher than the 95%
+ string chimera;
+ if (index != 0) { //if index is 0 then its an exact match to a template seq
+ if (quantiles[index][4] == 0.0) {
+ chimera = "Your template does not include sequences that provide quantile values at distance " + toString(index);
+ }else {
+ if (DE > quantiles[index][4]) { chimera = "Yes"; }
+ else { chimera = "No"; }
+ }
+ }else{ chimera = "No"; }
+
+ outputString += querySeq->getName() + "\tdiv: " + toString(deviation) + "\tstDev: " + toString(DE) + "\tchimera flag: " + chimera + "\n";
+ if (chimera == "Yes") {
+ cout << querySeq->getName() << "\tdiv: " << toString(deviation) << "\tstDev: " << toString(DE) << "\tchimera flag: " << chimera << endl;
+ string outAccString = querySeq->getName() + "\n";