]> git.donarmstrong.com Git - mothur.git/blob - reportfile.cpp
added modify names parameter to set.dir
[mothur.git] / reportfile.cpp
1 /*
2  *  reportfile.cpp
3  *  Mothur
4  *
5  *  Created by Pat Schloss on 12/19/10.
6  *  Copyright 2010 Schloss Lab. All rights reserved.
7  *
8  */
9
10 #include "mothur.h"
11 #include "mothurout.h"
12 #include "reportfile.h"
13
14 /**************************************************************************************************/
15
16 ReportFile::ReportFile(){
17         try {
18                 m = MothurOut::getInstance();
19         }
20         catch(exception& e) {
21                 m->errorOut(e, "ReportFile", "ReportFile");
22                 exit(1);
23         }                                                       
24 }
25
26 /**************************************************************************************************/
27
28 ReportFile::ReportFile(ifstream& repFile, string repFileName){
29         try {           
30                 m = MothurOut::getInstance();
31                 
32                 m->openInputFile(repFileName, repFile);
33                 m->getline(repFile);
34         }
35         catch(exception& e) {
36                 m->errorOut(e, "ReportFile", "ReportFile");
37                 exit(1);
38         }                                                       
39 }
40
41
42 /**************************************************************************************************/
43
44 ReportFile::ReportFile(ifstream& repFile){
45         try {
46                 
47                 m = MothurOut::getInstance();
48                 
49                 repFile >> queryName;
50                 repFile >> queryLength;
51                 repFile >> templateName;
52                 repFile >> templateLength;
53                 repFile >> searchMethod;
54                 repFile >> dummySearchScore;
55                 repFile >> alignmentMethod;
56                 repFile >> queryStart;
57                 repFile >> queryEnd;
58                 repFile >> templateStart;
59                 repFile >> templateEnd;
60                 repFile >> pairwiseAlignmentLength;
61                 repFile >> gapsInQuery;
62                 repFile >> gapsInTemplate;
63                 repFile >> longestInsert;
64                 repFile >> simBtwnQueryAndTemplate;
65
66                 if(dummySearchScore != "nan"){
67                         istringstream stream(dummySearchScore);
68                         stream >> searchScore;
69                 }
70                 else{
71                         searchScore = 0;
72                 }
73                 
74                 m->gobble(repFile);             
75         }
76         catch(exception& e) {
77                 m->errorOut(e, "ReportFile", "ReportFile");
78                 exit(1);
79         }                                                       
80         
81 }
82
83 /**************************************************************************************************/