//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;
}
int Sequence::getNumBases(){
return numBases;
}
+//********************************************************************************************************************
+
+int Sequence::getNumNs(){
+ int numNs = 0;
+ for (int i = 0; i < unaligned.length(); i++) {
+ if(toupper(unaligned[i]) == 'N') { numNs++; }
+ }
+ return numNs;
+}
//********************************************************************************************************************
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] = '.'; }
}
if(numBases > length){
unaligned = unaligned.substr(0,length);
numBases = length;
+ aligned = "";
+ isAligned = 0;
}
}