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 void NastReport::print(){
32 candidateReportFile << queryName << '\t' << queryLength << '\t' << templateName << '\t' << templateLength << '\t';
33 candidateReportFile << searchMethod << '\t' << setprecision(2) << fixed << searchScore << '\t';
35 candidateReportFile << alignmentMethod << '\t' << candidateStartPosition << "\t" << candidateEndPosition << '\t';
36 candidateReportFile << templateStartPosition << "\t" << templateEndPosition << '\t';
37 candidateReportFile << pairwiseAlignmentLength << '\t' << totalGapsInQuery << '\t' << totalGapsInTemplate << '\t';
38 candidateReportFile << longestInsert << '\t';;
39 candidateReportFile << setprecision(2) << similarityToTemplate;
41 candidateReportFile << endl;
42 candidateReportFile.flush();
45 /******************************************************************************************************************/
47 void NastReport::setCandidate(Sequence* candSeq){
48 queryName = candSeq->getName();
49 queryLength = candSeq->getNumBases();
52 /******************************************************************************************************************/
54 void NastReport::setTemplate(Sequence* tempSeq){
55 templateName = tempSeq->getName();
56 templateLength = tempSeq->getNumBases();
59 /******************************************************************************************************************/
61 void NastReport::setSearchParameters(string method, float score){
62 searchMethod = method;
66 /******************************************************************************************************************/
68 void NastReport::setAlignmentParameters(string method, Alignment* align){
69 alignmentMethod = method;
71 candidateStartPosition = align->getCandidateStartPos();
72 candidateEndPosition = align->getCandidateEndPos();
73 templateStartPosition = align->getTemplateStartPos();
74 templateEndPosition = align->getTemplateEndPos();
75 pairwiseAlignmentLength = align->getPairwiseLength();
77 totalGapsInQuery = pairwiseAlignmentLength - (candidateEndPosition - candidateStartPosition + 1);
78 totalGapsInTemplate = pairwiseAlignmentLength - (templateEndPosition - templateStartPosition + 1);
81 /******************************************************************************************************************/
83 void NastReport::setNastParameters(Nast nast){
85 longestInsert = nast.getMaxInsertLength();
86 similarityToTemplate = nast.getSimilarityScore();
90 /******************************************************************************************************************/