while(!inFASTA.eof()){
Sequence currSeq(inFASTA);
- bool goodSeq = 1; // innocent until proven guilty
- if(goodSeq == 1 && startPos != -1 && startPos < currSeq.getStartPos()) { goodSeq = 0; }
- if(goodSeq == 1 && endPos != -1 && endPos > currSeq.getEndPos()) { goodSeq = 0; }
- if(goodSeq == 1 && maxAmbig != -1 && maxAmbig < currSeq.getAmbigBases()) { goodSeq = 0; }
- if(goodSeq == 1 && maxHomoP != -1 && maxHomoP < currSeq.getLongHomoPolymer()) { goodSeq = 0; }
- if(goodSeq == 1 && minLength != -1 && minLength > currSeq.getNumBases()) { goodSeq = 0; }
- if(goodSeq == 1 && maxLength != -1 && maxLength < currSeq.getNumBases()) { goodSeq = 0; }
-
- if(goodSeq == 1){
- currSeq.printSequence(goodSeqOut);
- }
- else{
- currSeq.printSequence(badSeqOut);
- badSeqNames.insert(currSeq.getName());
+ if (currSeq.getName() != "") {
+ bool goodSeq = 1; // innocent until proven guilty
+ if(goodSeq == 1 && startPos != -1 && startPos < currSeq.getStartPos()) { goodSeq = 0; }
+ if(goodSeq == 1 && endPos != -1 && endPos > currSeq.getEndPos()) { goodSeq = 0; }
+ if(goodSeq == 1 && maxAmbig != -1 && maxAmbig < currSeq.getAmbigBases()) { goodSeq = 0; }
+ if(goodSeq == 1 && maxHomoP != -1 && maxHomoP < currSeq.getLongHomoPolymer()) { goodSeq = 0; }
+ if(goodSeq == 1 && minLength != -1 && minLength > currSeq.getNumBases()) { goodSeq = 0; }
+ if(goodSeq == 1 && maxLength != -1 && maxLength < currSeq.getNumBases()) { goodSeq = 0; }
+
+ if(goodSeq == 1){
+ currSeq.printSequence(goodSeqOut);
+ }
+ else{
+ currSeq.printSequence(badSeqOut);
+ badSeqNames.insert(currSeq.getName());
+ }
}
gobble(inFASTA);
}
goodNameOut.close();
badNameOut.close();
+ //we were unable to remove some of the bad sequences
+ if (badSeqNames.size() != 0) {
+ for (it = badSeqNames.begin(); it != badSeqNames.end(); it++) {
+ mothurOut("Your namefile does not include the sequence " + *it + " please correct.");
+ mothurOutEndLine();
+ }
+ }
+
if(groupfile != ""){
ifstream inputGroups;
inputGroups.close();
goodGroupOut.close();
badGroupOut.close();
+
+ //we were unable to remove some of the bad sequences
+ if (badSeqGroups.size() != 0) {
+ for (it = badSeqGroups.begin(); it != badSeqGroups.end(); it++) {
+ mothurOut("Your namefile does not include the sequence " + *it + " please correct.");
+ mothurOutEndLine();
+ }
+ }
}
}
}
gobble(inputGroups);
}
+
+ //we were unable to remove some of the bad sequences
+ if (badSeqNames.size() != 0) {
+ for (it = badSeqNames.begin(); it != badSeqNames.end(); it++) {
+ mothurOut("Your groupfile does not include the sequence " + *it + " please correct.");
+ mothurOutEndLine();
+ }
+ }
+
inputGroups.close();
goodGroupOut.close();
badGroupOut.close();
}
gobble(inputAlignReport);
}
+
+ //we were unable to remove some of the bad sequences
+ if (badSeqNames.size() != 0) {
+ for (it = badSeqNames.begin(); it != badSeqNames.end(); it++) {
+ mothurOut("Your file does not include the sequence " + *it + " please correct.");
+ mothurOutEndLine();
+ }
+ }
+
inputAlignReport.close();
goodAlignReportOut.close();
badAlignReportOut.close();