-
- candidateReportFile << queryName << '\t' << queryLength << '\t' << templateName << '\t' << templateLength << '\t';
- candidateReportFile << searchMethod << '\t' << setprecision(2) << fixed << searchScore << '\t';
-
- candidateReportFile << alignmentMethod << '\t' << candidateStartPosition << "\t" << candidateEndPosition << '\t';
- candidateReportFile << templateStartPosition << "\t" << templateEndPosition << '\t';
- candidateReportFile << pairwiseAlignmentLength << '\t' << totalGapsInQuery << '\t' << totalGapsInTemplate << '\t';
- candidateReportFile << longestInsert << '\t';;
- candidateReportFile << setprecision(2) << similarityToTemplate;
-
- candidateReportFile << endl;
- candidateReportFile.flush();
+ try {
+ candidateReportFile << queryName << '\t' << queryLength << '\t' << templateName << '\t' << templateLength << '\t';
+ candidateReportFile << searchMethod << '\t' << setprecision(2) << fixed << searchScore << '\t';
+
+ candidateReportFile << alignmentMethod << '\t' << candidateStartPosition << "\t" << candidateEndPosition << '\t';
+ candidateReportFile << templateStartPosition << "\t" << templateEndPosition << '\t';
+ candidateReportFile << pairwiseAlignmentLength << '\t' << totalGapsInQuery << '\t' << totalGapsInTemplate << '\t';
+ candidateReportFile << longestInsert << '\t';
+ candidateReportFile << setprecision(2) << similarityToTemplate;
+
+ candidateReportFile << endl;
+ candidateReportFile.flush();
+ }
+ catch(exception& e) {
+ m->errorOut(e, "NastReport", "print");
+ exit(1);
+ }
+}
+/******************************************************************************************************************/
+
+string NastReport::getReport(){
+ try {
+ output = "";
+
+ output += queryName + '\t' + toString(queryLength) + '\t' + templateName + '\t' + toString(templateLength) + '\t';
+
+ string temp = toString(searchScore);
+ int pos = temp.find_last_of('.'); //find deicmal point if their is one
+
+ //if there is a decimal
+ if (pos != -1) { temp = temp.substr(0, pos+3); } //set precision to 2 places
+ else{ temp += ".00"; }
+
+ output += searchMethod + '\t' + temp + '\t';
+ output += alignmentMethod + '\t' + toString(candidateStartPosition) + "\t" + toString(candidateEndPosition) + '\t';
+ output += toString(templateStartPosition) + "\t" + toString(templateEndPosition) + '\t';
+ output += toString(pairwiseAlignmentLength) + '\t' + toString(totalGapsInQuery) + '\t' + toString(totalGapsInTemplate) + '\t';
+ output += toString(longestInsert) + '\t';
+
+ temp = toString(similarityToTemplate);
+ pos = temp.find_last_of('.'); //find deicmal point if their is one
+
+ //if there is a decimal
+ if (pos != -1) { temp = temp.substr(0, pos+3); } //set precision to 2 places
+ else{ temp += ".00"; }
+
+ output += temp + '\n';
+
+ return output;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "NastReport", "getReport");
+ exit(1);
+ }