5 * Created by Pat Schloss on 12/19/08.
6 * Copyright 2008 Patrick D. Schloss. All rights reserved.
10 #include "sequence.hpp"
12 #include "alignment.hpp"
13 #include "nastreport.hpp"
15 /******************************************************************************************************************/
17 NastReport::NastReport(string candidateReportFName) {
18 openOutputFile(candidateReportFName, candidateReportFile);
20 candidateReportFile << "QueryName\tQueryLength\tTemplateName\tTemplateLength\t";
21 candidateReportFile << "SearchMethod\tSearchScore\t";
22 candidateReportFile << "AlignmentMethod\tQueryStart\tQueryEnd\tTemplateStart\tTemplateEnd\t";
23 candidateReportFile << "PairwiseAlignmentLength\tGapsInQuery\tGapsInTemplate\t";
24 candidateReportFile << "LongestInsert\t";
25 candidateReportFile << "SimBtwnQuery&Template" << endl;
28 /******************************************************************************************************************/
30 NastReport::~NastReport() {
31 candidateReportFile.close();
34 /******************************************************************************************************************/
36 void NastReport::print(){
38 candidateReportFile << queryName << '\t' << queryLength << '\t' << templateName << '\t' << templateLength << '\t';
39 candidateReportFile << searchMethod << '\t' << setprecision(2) << fixed << searchScore << '\t';
41 candidateReportFile << alignmentMethod << '\t' << candidateStartPosition << "\t" << candidateEndPosition << '\t';
42 candidateReportFile << templateStartPosition << "\t" << templateEndPosition << '\t';
43 candidateReportFile << pairwiseAlignmentLength << '\t' << totalGapsInQuery << '\t' << totalGapsInTemplate << '\t';
44 candidateReportFile << longestInsert << '\t';
45 candidateReportFile << setprecision(2) << similarityToTemplate;
47 candidateReportFile << endl;
48 candidateReportFile.flush();
51 /******************************************************************************************************************/
53 void NastReport::setCandidate(Sequence* candSeq){
54 queryName = candSeq->getName();
55 queryLength = candSeq->getNumBases();
58 /******************************************************************************************************************/
60 void NastReport::setTemplate(Sequence* tempSeq){
61 templateName = tempSeq->getName();
62 templateLength = tempSeq->getNumBases();
65 /******************************************************************************************************************/
67 void NastReport::setSearchParameters(string method, float score){
68 searchMethod = method;
72 /******************************************************************************************************************/
74 void NastReport::setAlignmentParameters(string method, Alignment* align){
75 alignmentMethod = method;
77 candidateStartPosition = align->getCandidateStartPos();
78 candidateEndPosition = align->getCandidateEndPos();
79 templateStartPosition = align->getTemplateStartPos();
80 templateEndPosition = align->getTemplateEndPos();
81 pairwiseAlignmentLength = align->getPairwiseLength();
83 totalGapsInQuery = pairwiseAlignmentLength - (candidateEndPosition - candidateStartPosition + 1);
84 totalGapsInTemplate = pairwiseAlignmentLength - (templateEndPosition - templateStartPosition + 1);
87 /******************************************************************************************************************/
89 void NastReport::setNastParameters(Nast nast){
91 longestInsert = nast.getMaxInsertLength();
92 similarityToTemplate = nast.getSimilarityScore();
96 /******************************************************************************************************************/