5 * Created by Pat Schloss on 12/19/08.
6 * Copyright 2008 Patrick D. Schloss. All rights reserved.
12 #include "sequence.hpp"
14 #include "alignment.hpp"
15 #include "nastreport.hpp"
17 /******************************************************************************************************************/
19 NastReport::NastReport(string candidateReportFName) {
20 openOutputFile(candidateReportFName, candidateReportFile);
22 candidateReportFile << "QueryName\tQueryLength\tTemplateName\tTemplateLength\t";
23 candidateReportFile << "SearchMethod\tSearchScore\t";
24 candidateReportFile << "AlignmentMethod\tQueryStart\tQueryEnd\tTemplateStart\tTemplateEnd\t";
25 candidateReportFile << "PairwiseAlignmentLength\tGapsInQuery\tGapsInTemplate\t";
26 candidateReportFile << "LongestInsert\t";
27 candidateReportFile << "SimBtwnQuery&Template" << endl;
30 /******************************************************************************************************************/
32 void NastReport::print(){
34 candidateReportFile << queryName << '\t' << queryLength << '\t' << templateName << '\t' << templateLength << '\t';
35 candidateReportFile << searchMethod << '\t' << setprecision(2) << fixed << searchScore << '\t';
37 candidateReportFile << alignmentMethod << '\t' << candidateStartPosition << "\t" << candidateEndPosition << '\t';
38 candidateReportFile << templateStartPosition << "\t" << templateEndPosition << '\t';
39 candidateReportFile << pairwiseAlignmentLength << '\t' << totalGapsInQuery << '\t' << totalGapsInTemplate << '\t';
40 candidateReportFile << longestInsert << '\t';;
41 candidateReportFile << setprecision(2) << similarityToTemplate;
43 candidateReportFile << endl;
44 candidateReportFile.flush();
47 /******************************************************************************************************************/
49 void NastReport::setCandidate(Sequence* candSeq){
50 queryName = candSeq->getName();
51 queryLength = candSeq->getUnalignLength();
54 /******************************************************************************************************************/
56 void NastReport::setTemplate(Sequence* tempSeq){
57 templateName = tempSeq->getName();
58 templateLength = tempSeq->getUnalignLength();
61 /******************************************************************************************************************/
63 void NastReport::setSearchParameters(string method, float score){
64 searchMethod = method;
68 /******************************************************************************************************************/
70 void NastReport::setAlignmentParameters(string method, Alignment* align){
71 alignmentMethod = method;
73 candidateStartPosition = align->getCandidateStartPos();
74 candidateEndPosition = align->getCandidateEndPos();
75 templateStartPosition = align->getTemplateStartPos();
76 templateEndPosition = align->getTemplateEndPos();
77 pairwiseAlignmentLength = align->getPairwiseLength();
79 totalGapsInQuery = pairwiseAlignmentLength - (candidateEndPosition - candidateStartPosition + 1);
80 totalGapsInTemplate = pairwiseAlignmentLength - (templateEndPosition - templateStartPosition + 1);
83 /******************************************************************************************************************/
85 void NastReport::setNastParameters(Nast nast){
87 longestInsert = nast.getMaxInsertLength();
88 similarityToTemplate = nast.getSimilarityScore();
92 /******************************************************************************************************************/