//then you did not find it so report it
if (count == globaldata->Treenames.size()) {
mothurOut(treeMap->namesOfSeqs[i] + " is in your namefile and not in your tree. It will be disregarded."); mothurOutEndLine();
+ treeMap->removeSeq(treeMap->namesOfSeqs[i]);
}
}
}
fileHandle.close();
}
/************************************************************/
+void TreeMap::removeSeq(string seqName) {
+
+ //erase name from namesOfSeqs
+ for (int i = 0; i < namesOfSeqs.size(); i++) {
+ if (namesOfSeqs[i] == seqName) {
+ namesOfSeqs.erase (namesOfSeqs.begin()+i);
+ break;
+ }
+ }
+
+ //decrement sequences in this group
+ string group = treemap[seqName].groupname;
+ seqsPerGroup[group]--;
+
+ //remove seq from treemap
+ it = treemap.find(seqName);
+ treemap.erase(it);
+
+
+}
+/************************************************************/
int TreeMap::getNumGroups() {
void setIndex(string, int); //sequencename, index
int getIndex(string); //returns vector index of sequence
bool isValidGroup(string); //return true if string is a valid group
+ void removeSeq(string); //removes a sequence, this is to accomadate trees that do not contain all the seqs in your groupfile
string getGroup(string);
vector<string> namesOfGroups;
vector<string> namesOfSeqs;