if (qualfile != "") { readQual(); }
if (accnosfile2 != "") { compareAccnos(); }
- if (m->control_pressed) { outputTypes.clear(); for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
+ if (m->control_pressed) { outputTypes.clear(); for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } return 0; }
- m->mothurOut("Selected " + toString(names.size()) + " sequences."); m->mothurOutEndLine();
if (outputNames.size() != 0) {
m->mothurOutEndLine();
string name;
bool wroteSomething = false;
+ int selectedCount = 0;
while(!in.eof()){
- if (m->control_pressed) { in.close(); out.close(); remove(outputFileName.c_str()); return 0; }
+ if (m->control_pressed) { in.close(); out.close(); m->mothurRemove(outputFileName); return 0; }
Sequence currSeq(in);
name = currSeq.getName();
wroteSomething = true;
currSeq.printSequence(out);
+ selectedCount++;
}
}
m->gobble(in);
if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
outputNames.push_back(outputFileName); outputTypes["fasta"].push_back(outputFileName);
+ m->mothurOut("Selected " + toString(selectedCount) + " sequences from your fasta file."); m->mothurOutEndLine();
+
return 0;
}
string name;
bool wroteSomething = false;
+ int selectedCount = 0;
while(!in.eof()){
wroteSomething = true;
out << name << endl << scores;
+ selectedCount++;
}
m->gobble(in);
if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
outputNames.push_back(outputFileName); outputTypes["qfile"].push_back(outputFileName);
+ m->mothurOut("Selected " + toString(selectedCount) + " sequences from your quality file."); m->mothurOutEndLine();
+
+
return 0;
}
m->openInputFile(listfile, in);
bool wroteSomething = false;
+ int selectedCount = 0;
while(!in.eof()){
- if (m->control_pressed) { in.close(); out.close(); remove(outputFileName.c_str()); return 0; }
+ selectedCount = 0;
+
+ if (m->control_pressed) { in.close(); out.close(); m->mothurRemove(outputFileName); return 0; }
//read in list vector
ListVector list(in);
binnames = binnames.substr(binnames.find_first_of(',')+1, binnames.length());
//if that name is in the .accnos file, add it
- if (names.count(name) != 0) { newNames += name + ","; }
+ if (names.count(name) != 0) { newNames += name + ","; selectedCount++; }
}
//get last name
- if (names.count(binnames) != 0) { newNames += binnames + ","; }
+ if (names.count(binnames) != 0) { newNames += binnames + ","; selectedCount++; }
//if there are names in this bin add to new list
if (newNames != "") {
if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
outputNames.push_back(outputFileName); outputTypes["list"].push_back(outputFileName);
+ m->mothurOut("Selected " + toString(selectedCount) + " sequences from your list file."); m->mothurOutEndLine();
+
return 0;
}
string name, firstCol, secondCol;
bool wroteSomething = false;
-
+ int selectedCount = 0;
while(!in.eof()){
- if (m->control_pressed) { in.close(); out.close(); remove(outputFileName.c_str()); return 0; }
+ if (m->control_pressed) { in.close(); out.close(); m->mothurRemove(outputFileName); return 0; }
in >> firstCol;
in >> secondCol;
for (int i = 0; i < parsedNames.size(); i++) { names.insert(parsedNames[i]); }
out << firstCol << '\t' << hold << endl;
wroteSomething = true;
+ selectedCount += parsedNames.size();
}else {
+ selectedCount += validSecond.size();
+
//if the name in the first column is in the set then print it and any other names in second column also in set
if (names.count(firstCol) != 0) {
if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
outputNames.push_back(outputFileName); outputTypes["name"].push_back(outputFileName);
+ m->mothurOut("Selected " + toString(selectedCount) + " sequences from your name file."); m->mothurOutEndLine();
+
return 0;
}
string name, group;
bool wroteSomething = false;
+ int selectedCount = 0;
while(!in.eof()){
- if (m->control_pressed) { in.close(); out.close(); remove(outputFileName.c_str()); return 0; }
+ if (m->control_pressed) { in.close(); out.close(); m->mothurRemove(outputFileName); return 0; }
in >> name; //read from first column
wroteSomething = true;
out << name << '\t' << group << endl;
+ selectedCount++;
}
m->gobble(in);
if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
outputNames.push_back(outputFileName); outputTypes["group"].push_back(outputFileName);
+ m->mothurOut("Selected " + toString(selectedCount) + " sequences from your group file."); m->mothurOutEndLine();
+
+
return 0;
}
string name, tax;
bool wroteSomething = false;
+ int selectedCount = 0;
while(!in.eof()){
- if (m->control_pressed) { in.close(); out.close(); remove(outputFileName.c_str()); return 0; }
+ if (m->control_pressed) { in.close(); out.close(); m->mothurRemove(outputFileName); return 0; }
in >> name; //read from first column
in >> tax; //read from second column
wroteSomething = true;
out << name << '\t' << tax << endl;
+ selectedCount++;
}
m->gobble(in);
if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
outputNames.push_back(outputFileName); outputTypes["taxonomy"].push_back(outputFileName);
+
+ m->mothurOut("Selected " + toString(selectedCount) + " sequences from your taxonomy file."); m->mothurOutEndLine();
return 0;
string name, junk;
bool wroteSomething = false;
+ int selectedCount = 0;
//read column headers
for (int i = 0; i < 16; i++) {
while(!in.eof()){
- if (m->control_pressed) { in.close(); out.close(); remove(outputFileName.c_str()); return 0; }
+ if (m->control_pressed) { in.close(); out.close(); m->mothurRemove(outputFileName); return 0; }
in >> name; //read from first column
//if this name is in the accnos file
if (names.count(name) != 0) {
wroteSomething = true;
+ selectedCount++;
out << name << '\t';
if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
outputNames.push_back(outputFileName); outputTypes["alignreport"].push_back(outputFileName);
+ m->mothurOut("Selected " + toString(selectedCount) + " sequences from your alignreport file."); m->mothurOutEndLine();
+
return 0;
}