fileHandle >> seqGroup; //read from second column
setNamesOfGroups(seqGroup);
-
+
groupmap[seqName] = seqGroup; //store data in map
+ seqsPerGroup[seqGroup]++; //increment number of seqs in that group
gobble(fileHandle);
}
}
if (count == namesOfGroups.size()) {
namesOfGroups.push_back(seqGroup); //new group
+ seqsPerGroup[seqGroup] = 0;
groupIndex[seqGroup] = index;
index++;
}
exit(1);
}
}
+/************************************************************/
+int GroupMap::getNumSeqs(string group) {
+ try {
+
+ map<string, int>::iterator itNum;
+
+ itNum = seqsPerGroup.find(group);
+
+ if (itNum == seqsPerGroup.end()) { return 0; }
+
+ return seqsPerGroup[group];
+
+ }
+ catch(exception& e) {
+ errorOut(e, "GroupMap", "getNumSeqs");
+ exit(1);
+ }
+}
+
+/************************************************************/
+vector<string> GroupMap::getNamesSeqs(){
+ try {
+
+ vector<string> names;
+
+ for (it = groupmap.begin(); it != groupmap.end(); it++) {
+ names.push_back(it->first);
+ }
+
+ return names;
+ }
+ catch(exception& e) {
+ errorOut(e, "GroupMap", "getNamesSeqs");
+ exit(1);
+ }
+}
+/************************************************************/
+