X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=trimseqscommand.cpp;h=7835b7598ae6ddcc76001788d44daf1faf17cfdd;hb=44b464979e91c2a1f144ac45ca12c14fcf6579f0;hp=5f7c9b2199d28960fe1b619a4df2394be3b352a6;hpb=62568a297aaf939ab753334f17abde82ec8e8531;p=mothur.git diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index 5f7c9b2..7835b75 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -999,13 +999,28 @@ bool TrimSeqsCommand::stripQualThreshold(Sequence& seq, ifstream& qFile){ int seqLength; // = rawSequence.length(); string name, temp, temp2; - qFile >> name >> temp; + qFile >> name; + + //get rest of line + temp = ""; + while (!qFile.eof()) { + char c = qFile.get(); + if (c == 10 || c == 13){ break; } + else { temp += c; } + } + int pos = temp.find("length"); + if (pos == temp.npos) { m->mothurOut("Cannot find length in qfile for " + seq.getName()); m->mothurOutEndLine(); seqLength = 0; } + else { + string tempLength = temp.substr(pos); + istringstream iss (tempLength,istringstream::in); + iss >> temp; + } + splitAtEquals(temp2, temp); //separates length=242, temp=length, temp2=242 convert(temp, seqLength); //converts string to int if (name.length() != 0) { if(name.substr(1) != seq.getName()) { m->mothurOut("sequence name mismatch btwn fasta and qual file"); m->mothurOutEndLine(); } } - while (!qFile.eof()) { char c = qFile.get(); if (c == 10 || c == 13){ break; } } int score; int end = seqLength;