else{
seqName = seqName.substr(1);
}
-
string qScoreString = m->getline(qFile);
+ while(qFile.peek() != '>' && qFile.peek() != EOF){
+ qScoreString += ' ' + m->getline(qFile);
+ }
istringstream qScoreStringStream(qScoreString);
+ int count = 0;
while(!qScoreStringStream.eof()){
+ if (m->control_pressed) { break; }
qScoreStringStream >> score;
qScores.push_back(score);
+ count++;
}
qScores.pop_back();
+
+// string scores = "";
+//
+// while(!qFile.eof()){
+//
+// qFile >> seqName;
+//
+// //get name
+// if (seqName.length() != 0) {
+// seqName = seqName.substr(1);
+// while (!qFile.eof()) {
+// char c = qFile.get();
+// //gobble junk on line
+// if (c == 10 || c == 13){ break; }
+// }
+// m->gobble(qFile);
+// }
+//
+// //get scores
+// while(qFile){
+// char letter=qFile.get();
+// if((letter == '>')){ qFile.putback(letter); break; }
+// else if (isprint(letter)) { scores += letter; }
+// }
+// m->gobble(qFile);
+//
+// break;
+// }
+//
+// //convert scores string to qScores
+// istringstream qScoreStringStream(scores);
+//
+// int score;
+// while(!qScoreStringStream.eof()){
+//
+// if (m->control_pressed) { break; }
+//
+// qScoreStringStream >> score;
+// qScores.push_back(score);
+// }
+//
+// qScores.pop_back();
+
seqLength = qScores.size();
+
+
}
catch(exception& e) {
m->errorOut(e, "QualityScores", "QualityScores");
void QualityScores::trimQScores(int start, int end){
try {
vector<int> hold;
-
+
if(end == -1){
hold = vector<int>(qScores.begin()+start, qScores.end());
qScores = hold;
if(rollingSum / (double)(i+1) < qThreshold){
end = i;
-// cout << i+1 << '\t' << seqName << '\t' << rollingSum / (double)(i+1) << endl;
break;
}
}
int seqLength = errorSeq.size();
int qIndex = start - 1;
+
for(int i=0;i<seqLength;i++){
if(errorSeq[i] == 'm') { qualErrorMap['m'][qScores[qIndex]] += weight; }