void setGroup(string, string);
vector<string> namesOfGroups;
map<string, int> groupIndex; //groupname, vectorIndex in namesOfGroups. - used by collectdisplays.
-
+ int getNumSeqs() { return groupmap.size(); }
+
private:
ifstream fileHandle;
string groupFileName;
return 1;
}
else {
+ //check for blank file
+ gobble(fileHandle);
+ if (fileHandle.eof()) { mothurOut(fileName + " is blank. Please correct."); mothurOutEndLine(); return 1; }
+
return 0;
}
mothurOut("Done."); mothurOutEndLine();
}else { createProcessesPairs(); }
-/*string o = "foronlinepintailpairs-eachgap";
+string o = "closestmatch.eachgap.fasta";
ofstream out7;
openOutputFile(o, out7);
for (int i = 0; i < bestfit.size(); i++) {
- out7 << querySeqs[i]->getName() << endl;
- out7 << querySeqs[i]->getUnaligned() << endl << endl;
-
- out7 << bestfit[i]->getName() << endl;
- out7 << bestfit[i]->getUnaligned() << endl << endl << endl;
+ out7 << ">" << querySeqs[i]->getName() << "-"<< bestfit[i]->getName() << endl;
+ out7 << bestfit[i]->getAligned() << endl;
}
-out7.close();/*/
+out7.close();
//find P
mothurOut("Getting conservation... "); cout.flush();
if (consfile == "") {
//read in listfile
read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
+ delete read;
input = globaldata->ginput;
SharedList = globaldata->gSharedList;
string lastLabel = SharedList->getLabel();
vector<SharedRAbundVector*> lookup;
-
+
+ if (SharedList->getNumSeqs() != groupMap->getNumSeqs()) {
+ mothurOut("Your group file contains " + toString(groupMap->getNumSeqs()) + " sequences and list file contains " + toString(SharedList->getNumSeqs()) + " sequences. Please correct."); mothurOutEndLine();
+
+ //delete memory
+ for (it3 = filehandles.begin(); it3 != filehandles.end(); it3++) {
+ delete it3->second;
+ }
+ delete SharedList;
+ globaldata->gSharedList = NULL;
+
+ return(0);
+ }
+
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = globaldata->labels;
}
globaldata->gSharedList = NULL;
- delete read;
out.close();