+ int thisSize = names.size();
+ if (persample) {
+ if (size == 0) { //user has not set size, set size = smallest samples size
+ size = groupMap->getNumSeqs(Groups[0]);
+ for (int i = 1; i < Groups.size(); i++) {
+ int thisSize = groupMap->getNumSeqs(Groups[i]);
+
+ if (thisSize < size) { size = thisSize; }
+ }
+ }else { //make sure size is not too large
+ int smallestSize = groupMap->getNumSeqs(Groups[0]);
+ for (int i = 1; i < Groups.size(); i++) {
+ int thisSize = groupMap->getNumSeqs(Groups[i]);
+
+ if (thisSize < smallestSize) { smallestSize = thisSize; }
+ }
+ if (smallestSize < size) { size = smallestSize; m->mothurOut("You have selected a size that is larger than your smallest sample, using your samllest sample size, " + toString(smallestSize) + "."); m->mothurOutEndLine(); }
+ }
+
+ m->mothurOut("Sampling " + toString(size) + " from each group."); m->mothurOutEndLine();
+ }else {
+ if (pickedGroups) {
+ int total = 0;
+ for(int i = 0; i < Groups.size(); i++) {
+ total += groupMap->getNumSeqs(Groups[i]);
+ }
+
+ if (size == 0) { //user has not set size, set size = 10% samples size
+ size = int (total * 0.10);
+ }
+
+ if (total < size) {
+ if (size != 0) {
+ m->mothurOut("Your size is too large for the number of groups you selected. Adjusting to " + toString(int (total * 0.10)) + "."); m->mothurOutEndLine();
+ }
+ size = int (total * 0.10);
+ }
+
+ m->mothurOut("Sampling " + toString(size) + " from " + toString(total) + "."); m->mothurOutEndLine();