Sequence currSeq(in);
name = currSeq.getName();
+
+ if (!dups) {//adjust name if needed
+ map<string, string>::iterator it = uniqueMap.find(name);
+ if (it != uniqueMap.end()) { name = it->second; }
+ }
if (name != "") {
//if this name is in the accnos file
string name = "";
string scores = "";
- in >> name;
+ in >> name;
+
+ if (!dups) {//adjust name if needed
+ map<string, string>::iterator it = uniqueMap.find(name);
+ if (it != uniqueMap.end()) { name = it->second; }
+ }
if (name.length() != 0) {
saveName = name.substr(1);
while (!in.eof()) {
char c = in.get();
- if (c == 10 || c == 13){ break; }
+ if (c == 10 || c == 13 || c == -1){ break; }
else { name += c; }
}
m->gobble(in);
//check for groups that have been eliminated
CountTable ct;
if (ct.testGroups(outputFileName)) {
- ct.readTable(outputFileName);
+ ct.readTable(outputFileName, true);
ct.printTable(outputFileName);
}
wroteSomething = true;
out << validSecond[0] << '\t';
+ //we are changing the unique name in the fasta file
+ uniqueMap[firstCol] = validSecond[0];
//you know you have at least one valid second since first column is valid
for (int i = 0; i < validSecond.size()-1; i++) { out << validSecond[i] << ','; }
in >> name; //read from first column
in >> group; //read from second column
+
//if this name is in the accnos file
if (names.count(name) != 0) {
in >> name; //read from first column
in >> tax; //read from second column
+
+ if (!dups) {//adjust name if needed
+ map<string, string>::iterator it = uniqueMap.find(name);
+ if (it != uniqueMap.end()) { name = it->second; }
+ }
//if this name is in the accnos file
if (names.count(name) != 0) {
in >> name; //read from first column
+
+ if (!dups) {//adjust name if needed
+ map<string, string>::iterator it = uniqueMap.find(name);
+ if (it != uniqueMap.end()) { name = it->second; }
+ }
//if this name is in the accnos file
if (names.count(name) != 0) {