]> git.donarmstrong.com Git - mothur.git/commitdiff
modified reportfile class
authorpschloss <pschloss>
Thu, 3 Mar 2011 22:41:20 +0000 (22:41 +0000)
committerpschloss <pschloss>
Thu, 3 Mar 2011 22:41:20 +0000 (22:41 +0000)
mothur.h
qualityscores.cpp
reportfile.cpp
reportfile.h
seqerrorcommand.cpp

index 97a104398fb584d2d8371e0f9bca440d4aea1f8b..190254a96e4c7d7830f8405035933efda4b003ea 100644 (file)
--- a/mothur.h
+++ b/mothur.h
@@ -239,5 +239,15 @@ string toString(const T&x, int i){
 }
 //**********************************************************************************************************************
 
+template<class T>
+T fromString(const string& s){
+       istringstream stream (s);
+       T t;
+       stream >> t;
+       return t;
+}
+
+//**********************************************************************************************************************
+
 #endif
 
index fca3d9f4c9cd17947116fbdb9a872bfce863fe47..1ef074df88919d9e15ac1655ea217c37b74949f4 100644 (file)
@@ -310,6 +310,7 @@ void QualityScores::updateQScoreErrorMap(map<char, vector<int> >& qualErrorMap,
                int seqLength = errorSeq.size();
                
                int qIndex = start - 1;
+               cout << start << '\t' << stop << '\t' << seqLength << endl;
                for(int i=0;i<seqLength;i++){
                        
                        if(errorSeq[i] == 'm')          {       qualErrorMap['m'][qScores[qIndex]] += weight;   }
index f392ed974c5cd5e535e7593e4e3246b1ff70e524..8e3b746159a02da7082749bea103222540e0c4a6 100644 (file)
@@ -7,6 +7,8 @@
  *
  */
 
+#include "mothur.h"
+#include "mothurout.h"
 #include "reportfile.h"
 
 /**************************************************************************************************/
@@ -49,7 +51,7 @@ ReportFile::ReportFile(ifstream& repFile){
                repFile >> templateName;
                repFile >> templateLength;
                repFile >> searchMethod;
-               repFile >> searchScore;
+               repFile >> dummySearchScore;
                repFile >> alignmentMethod;
                repFile >> queryStart;
                repFile >> queryEnd;
@@ -61,6 +63,14 @@ ReportFile::ReportFile(ifstream& repFile){
                repFile >> longestInsert;
                repFile >> simBtwnQueryAndTemplate;
 
+               if(dummySearchScore != "nan"){
+                       istringstream stream(dummySearchScore);
+                       stream >> searchScore;
+               }
+               else{
+                       searchScore = 0;
+               }
+               
                m->gobble(repFile);             
        }
        catch(exception& e) {
index 1bd2c945074568d65c156de63478ad0024a39e09..067dd14af4563f79d53f2efc93aae6d0cf3c2ee7 100644 (file)
@@ -11,8 +11,6 @@
  */
 
 
-#include "mothur.h"
-#include "mothurout.h"
 
 /**************************************************************************************************/
 
@@ -46,7 +44,7 @@ private:
        
        MothurOut* m;
                
-       string queryName, templateName, searchMethod, alignmentMethod;
+       string queryName, templateName, searchMethod, alignmentMethod, dummySearchScore;
        int queryLength, templateLength, queryStart, queryEnd, templateStart, templateEnd, pairwiseAlignmentLength, gapsInQuery, gapsInTemplate, longestInsert;
        float searchScore, simBtwnQueryAndTemplate;
        
index 2e20c57e6245cc66f4b4f9483f643aacd6c1201a..db3a4a97c9e9e6f64c828bfab5f66cafecfe3b24 100644 (file)
@@ -310,6 +310,7 @@ int SeqErrorCommand::execute(){
                        if (m->control_pressed) { errorSummaryFile.close();     errorSeqFile.close(); for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
                
                        Sequence query(queryFile);
+                       cout << "gotQuery" << endl;
                        
                        int numParentSeqs = chimeraTest.analyzeQuery(query.getName(), query.getAligned());
                        int closestRefIndex = chimeraTest.getClosestRefIndex();
@@ -339,17 +340,23 @@ int SeqErrorCommand::execute(){
 
                        if(qualFileName != "" && reportFileName != ""){
                                report = ReportFile(reportFile);
+                               cout << "gotReport" << endl;
                                
 //                             int origLength = report.getQueryLength();
                                int startBase = report.getQueryStart();
                                int endBase = report.getQueryEnd();
 
                                quality = QualityScores(qualFile);
+                               cout << "gotQuality" << endl;
 
                                if(!ignoreSeq){
+                                       cout << "not ignoring" << endl;
                                        quality.updateQScoreErrorMap(qScoreErrorMap, minCompare.sequence, startBase, endBase, minCompare.weight);
+                                       cout << "updateQScoreErrorMap" << endl;
                                        quality.updateForwardMap(qualForwardMap, startBase, endBase, minCompare.weight);
+                                       cout << "updateForwardMap" << endl;
                                        quality.updateReverseMap(qualReverseMap, startBase, endBase, minCompare.weight);
+                                       cout << "updateReverseMap" << endl;
                                }
                        }                       
 
@@ -367,6 +374,8 @@ int SeqErrorCommand::execute(){
                        }
 
                        index++;
+                       cout << "end of loop:\t" << index << endl;
+                       
                        if(index % 1000 == 0){  cout << index << endl;  }
                }
                queryFile.close();