@@ -427,53 +427,73 @@ vector<string> ClassifyOtuCommand::findConsensusTaxonomy(vector<string> names, i
size = 0;
for (int i = 0; i < names.size(); i++) {
-
- //if namesfile include the names
- if (namefile != "") {
-
- //is this sequence in the name file - namemap maps seqName -> repSeqName
- it2 = nameMap.find(names[i]);
-
- if (it2 == nameMap.end()) { //this name is not in name file, skip it
- m->mothurOut(names[i] + " is not in your name file. I will not include it in the consensus."); m->mothurOutEndLine();
- }else{
-
- //is this sequence in the taxonomy file - look for repSeqName since we are assuming the taxonomy file is unique
- it = taxMap.find(it2->second);
-
- if (it == taxMap.end()) { //this name is not in taxonomy file, skip it
-
- if (names[i] != it2->second) { m->mothurOut(names[i] + " is represented by " + it2->second + " and is not in your taxonomy file. I will not include it in the consensus."); m->mothurOutEndLine(); }
- else { m->mothurOut(names[i] + " is not in your taxonomy file. I will not include it in the consensus."); m->mothurOutEndLine(); }
- }else{
-
- //add seq to tree
- phylo->addSeqToTree(names[i], it->second);
- size++;
- allNames.push_back(names[i]);
- }
- }
-
- }else{
- //is this sequence in the taxonomy file - look for repSeqName since we are assuming the taxonomy file is unique
- it = taxMap.find(names[i]);
-
- if (it == taxMap.end()) { //this name is not in taxonomy file, skip it
- m->mothurOut("[WARNING]: " + names[i] + " is not in your taxonomy file. I will not include it in the consensus."); m->mothurOutEndLine();
- }else{
+
+ if (group != "") { //no need to check for name file, names already added in previous step
+ //is this sequence in the taxonomy file - look for repSeqName since we are assuming the taxonomy file is unique
+ it = taxMap.find(names[i]);
+
+ if (it == taxMap.end()) { //this name is not in taxonomy file, skip it
+ m->mothurOut("[WARNING]: " + names[i] + " is not in your taxonomy file. I will not include it in the consensus."); m->mothurOutEndLine();
+ }else{
if (countfile != "") {
- int numDups = ct->getNumSeqs(names[i]);
+ int numDups = ct->getGroupCount(names[i], group);
+ //is this sequence in the name file - namemap maps seqName -> repSeqName
+ it2 = nameMap.find(names[i]);
+
+ if (it2 == nameMap.end()) { //this name is not in name file, skip it
+ m->mothurOut(names[i] + " is not in your name file. I will not include it in the consensus."); m->mothurOutEndLine();
+ }else{
+
+ //is this sequence in the taxonomy file - look for repSeqName since we are assuming the taxonomy file is unique
+ it = taxMap.find(it2->second);
+
+ if (it == taxMap.end()) { //this name is not in taxonomy file, skip it
+
+ if (names[i] != it2->second) { m->mothurOut(names[i] + " is represented by " + it2->second + " and is not in your taxonomy file. I will not include it in the consensus."); m->mothurOutEndLine(); }
+ else { m->mothurOut(names[i] + " is not in your taxonomy file. I will not include it in the consensus."); m->mothurOutEndLine(); }
+ }else{
+
+ //add seq to tree
+ phylo->addSeqToTree(names[i], it->second);
+ size++;
+ allNames.push_back(names[i]);
+ }
+ }
+
+ }else{
+ //is this sequence in the taxonomy file - look for repSeqName since we are assuming the taxonomy file is unique
+ it = taxMap.find(names[i]);
+
+ if (it == taxMap.end()) { //this name is not in taxonomy file, skip it
+ m->mothurOut("[WARNING]: " + names[i] + " is not in your taxonomy file. I will not include it in the consensus."); m->mothurOutEndLine();
0 comments on commit
50c9d93