- if (sequence != "not found") {
- //if you don't have groups
- if (groupfile == "") {
- name = name + "\t" + toString(i+1);
- out << ">" << name << endl;
- out << sequence << endl;
- }else {//if you do have groups
- string group = groupMap->getGroup(name);
- if (group == "not found") {
- m->mothurOut(name + " is missing from your group file. Please correct. "); m->mothurOutEndLine();
- return 1;
- }else{
- name = name + "\t" + group + "\t" + toString(i+1);
+
+ if (countfile != "") {
+ if (sequence != "not found") {
+ if (ct.hasGroupInfo()) {
+ vector<string> groups = ct.getGroups(name);
+ string groupInfo = "";
+ for (int k = 0; k < groups.size()-1; k++) {
+ groupInfo += groups[k] + "-";
+ }
+ if (groups.size() != 0) { groupInfo += groups[groups.size()-1]; }
+ else { groupInfo = "not found"; }
+ name = name + "\t" + groupInfo + "\t" + toString(i+1)+ "\tNumRep=" + toString(ct.getNumSeqs(name));
+ out << ">" << name << endl;
+ out << sequence << endl;
+ }else {
+ name = name + "\t" + toString(i+1) + "\tNumRep=" + toString(ct.getNumSeqs(name));
+ out << ">" << name << endl;
+ out << sequence << endl;
+ }
+
+ }else { m->mothurOut(name + " is missing from your fasta. Does your list file contain all sequence names or just the uniques?"); m->mothurOutEndLine(); return 1; }
+ }else {
+ if (sequence != "not found") {
+ //if you don't have groups
+ if (groupfile == "") {
+ name = name + "\t" + toString(i+1);