string name, firstCol, secondCol;
bool wroteSomething = false;
- int numSeqsInNames = 0;
+
while(!in.eof()){
if (m->control_pressed) { in.close(); out.close(); remove(outputFileName.c_str()); return 0; }
validSecond.push_back(parsedNames[i]);
}
}
- numSeqsInNames += parsedNames.size();
+
if ((dups) && (validSecond.size() != parsedNames.size())) { //if dups is true and we want to get rid of anyone, get rid of everyone
for (int i = 0; i < parsedNames.size(); i++) { names.insert(parsedNames[i]); }
}else {
}
in.close();
out.close();
-cout << "your names file contains " << numSeqsInNames << endl;
+
if (wroteSomething == false) {
m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();
remove(outputFileName.c_str());
openInputFile(fastafile, inFASTA);
numSeqs=count(istreambuf_iterator<char>(inFASTA),istreambuf_iterator<char>(), '>');
inFASTA.close();
-
+ cout << numSeqs << endl;
lines.push_back(new linePair(0, numSeqs));
driverCreateSummary(startPosition, endPosition, seqLength, ambigBases, longHomoPolymer, fastafile, summaryFile, lines[0]);
if (m->control_pressed) { in.close(); outSummary.close(); return 1; }
Sequence current(in);
+
if (current.getName() != "") {
startPosition.push_back(current.getStartPos());
endPosition.push_back(current.getEndPos());
m = MothurOut::getInstance();
initialize();
fastaFile >> name;
- name = name.substr(1);
- string sequence;
+
+ if (name.length() != 0) {
- //read comments
- while ((name[0] == '#') && fastaFile) {
- while (!fastaFile.eof()) { char c = fastaFile.get(); if (c == 10 || c == 13){ break; } } // get rest of line if there's any crap there
- sequence = getCommentString(fastaFile);
+ name = name.substr(1);
- if (fastaFile) {
- fastaFile >> name;
- name = name.substr(1);
- }else {
- name = "";
- break;
- }
- }
+ string sequence;
- //read real sequence
- while (!fastaFile.eof()) { char c = fastaFile.get(); if (c == 10 || c == 13){ break; } } // get rest of line if there's any crap there
+ //read comments
+ while ((name[0] == '#') && fastaFile) {
+ while (!fastaFile.eof()) { char c = fastaFile.get(); if (c == 10 || c == 13){ break; } } // get rest of line if there's any crap there
+ sequence = getCommentString(fastaFile);
+
+ if (fastaFile) {
+ fastaFile >> name;
+ name = name.substr(1);
+ }else {
+ name = "";
+ break;
+ }
+ }
+
+ //read real sequence
+ while (!fastaFile.eof()) { char c = fastaFile.get(); if (c == 10 || c == 13){ break; } } // get rest of line if there's any crap there
+
+ sequence = getSequenceString(fastaFile);
- sequence = getSequenceString(fastaFile);
+ setAligned(sequence);
+ //setUnaligned removes any gap characters for us
+ setUnaligned(sequence);
+ }
- setAligned(sequence);
- //setUnaligned removes any gap characters for us
- setUnaligned(sequence);
}
catch(exception& e) {
m->errorOut(e, "Sequence", "Sequence");