- int lNumSeqs = seqMap.size();
- int pNumSeqs = 0;
-
- ifstream phylipFile;
- m->openInputFile(distFile, phylipFile);
- phylipFile >> pNumSeqs;
- if(pNumSeqs != lNumSeqs){ cout << "numSeq mismatch!" << endl; }
-
- string seqName;
- double distance;
- vector<int> otuIndices(lNumSeqs, -1);
+
+ //output error messages about any remaining user labels
+ set<string>::iterator it;
+ bool needToRun = false;
+ for (it = userLabels.begin(); it != userLabels.end(); it++) {
+ m->mothurOut("Your file does not include the label " + *it);
+ if (processedLabels.count(lastLabel) != 1) {
+ m->mothurOut(". I will use " + lastLabel + "."); m->mothurOutEndLine();
+ needToRun = true;
+ }else {
+ m->mothurOut(". Please refer to " + lastLabel + "."); m->mothurOutEndLine();
+ }
+ }
+
+ //run last label if you need to
+ if (needToRun == true) {
+ if (list != NULL) { delete list; }
+ list = input.getListVector(lastLabel);
+
+ //process
+ fillSeqMap(seqMap, list);
+ process(seqMap, list->getLabel(), getCutoff, origCutoff);
+
+ delete list;
+ }
+
+ return 0;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SensSpecCommand", "processPhylip");
+ exit(1);
+ }
+}
+//***************************************************************************************************************
+int SensSpecCommand::fillSeqMap(map<string, int>& seqMap, ListVector*& list){
+ try {
+ //for each otu
+ for(int i=0;i<list->getNumBins();i++){
+
+ if (m->control_pressed) { return 0; }
+
+ string seqList = list->get(i);
+ int seqListLength = seqList.length();
+ string seqName = "";
+
+ //parse bin by name, mapping each name to its otu number
+ for(int j=0;j<seqListLength;j++){