From: pschloss Date: Thu, 3 Mar 2011 22:41:20 +0000 (+0000) Subject: modified reportfile class X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=commitdiff_plain;h=24083a26340293cb3a0e44bcf79edbc9b31f41db modified reportfile class --- diff --git a/mothur.h b/mothur.h index 97a1043..190254a 100644 --- a/mothur.h +++ b/mothur.h @@ -239,5 +239,15 @@ string toString(const T&x, int i){ } //********************************************************************************************************************** +template +T fromString(const string& s){ + istringstream stream (s); + T t; + stream >> t; + return t; +} + +//********************************************************************************************************************** + #endif diff --git a/qualityscores.cpp b/qualityscores.cpp index fca3d9f..1ef074d 100644 --- a/qualityscores.cpp +++ b/qualityscores.cpp @@ -310,6 +310,7 @@ void QualityScores::updateQScoreErrorMap(map >& qualErrorMap, int seqLength = errorSeq.size(); int qIndex = start - 1; + cout << start << '\t' << stop << '\t' << seqLength << endl; for(int i=0;i> 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) { diff --git a/reportfile.h b/reportfile.h index 1bd2c94..067dd14 100644 --- a/reportfile.h +++ b/reportfile.h @@ -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; diff --git a/seqerrorcommand.cpp b/seqerrorcommand.cpp index 2e20c57..db3a4a9 100644 --- a/seqerrorcommand.cpp +++ b/seqerrorcommand.cpp @@ -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();