X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sequence.cpp;h=ddc7d4c5a410ca99a415ee1e15d7c60b2199060f;hb=70491a12902e89b85cfa6b44a7b7fbe066ee2ac1;hp=224ecb10cb1529db7d6bdb10c268be047dae5834;hpb=eb71e28b7b7afd82540f4a8f0bac9429c5b9d713;p=mothur.git diff --git a/sequence.cpp b/sequence.cpp index 224ecb1..ddc7d4c 100644 --- a/sequence.cpp +++ b/sequence.cpp @@ -220,7 +220,7 @@ Sequence::Sequence(ifstream& fastaFile, string& extraInfo, bool getInfo){ //read info after sequence name while (!fastaFile.eof()) { char c = fastaFile.get(); - if (c == 10 || c == 13){ break; } + if (c == 10 || c == 13 || c == -1){ break; } extraInfo += c; } @@ -683,12 +683,12 @@ int Sequence::filterToPos(int start){ if (start > aligned.length()) { start = aligned.length(); m->mothurOut("[ERROR]: start to large.\n"); } - for(int j = 0; j < start-1; j++) { + for(int j = 0; j < start; j++) { aligned[j] = '.'; } //things like ......----------AT become ................AT - for(int j = start-1; j < aligned.length(); j++) { + for(int j = start; j < aligned.length(); j++) { if (isalpha(aligned[j])) { break; } else { aligned[j] = '.'; } } @@ -772,6 +772,8 @@ void Sequence::trim(int length){ if(numBases > length){ unaligned = unaligned.substr(0,length); numBases = length; + aligned = ""; + isAligned = 0; } }