- for(int j=0;j<i;j++){
- phylipFile >> distance;
-
- if(distance <= cutoff){
- if(otuIndices[i] == otuIndices[j]) { truePositives++; }
- else { falseNegatives++; }
- }
- else{
- if(otuIndices[i] == otuIndices[j]) { falsePositives++; }
- else { trueNegatives++; }
- }
+ if(distance <= cutoff){
+ if(otuIndices[i] == otuIndices[j]) { truePositives++; }
+ else { falseNegatives++; }
+ }
+ else{
+ if(otuIndices[i] == otuIndices[j]) { falsePositives++; }
+ else { trueNegatives++; }
+ }
+ }
+ }
+ phylipFile.close();
+
+ outputStatistics(label, origCutoff);
+
+ return 0;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SensSpecCommand", "process");
+ exit(1);
+ }
+}
+//***************************************************************************************************************
+int SensSpecCommand::process(set<string>& seqPairSet, string label, bool& getCutoff, string& origCutoff, int numSeqs){
+ try {
+ int numDists = (numSeqs * (numSeqs-1) / 2);
+
+ ifstream columnFile;
+ m->openInputFile(distFile, columnFile);
+ string seqNameA, seqNameB, seqPairString;
+ double distance;
+
+ truePositives = 0;
+ falsePositives = 0;
+ trueNegatives = numDists;
+ falseNegatives = 0;
+
+ if(getCutoff == 1){
+ if(label != "unique"){
+ origCutoff = label;
+ convert(label, cutoff);
+ if(hard == 0){ cutoff += (0.49 / double(precision)); }
+ }
+ else{
+ origCutoff = "unique";
+ cutoff = 0.0000;
+ }
+ }
+
+ m->mothurOut(label); m->mothurOutEndLine();
+
+ while(columnFile){
+ columnFile >> seqNameA >> seqNameB >> distance;
+ if(seqNameA < seqNameB) { seqPairString = seqNameA + '\t' + seqNameB; }
+ else { seqPairString = seqNameB + '\t' + seqNameA; }
+
+ set<string>::iterator it = seqPairSet.find(seqPairString);
+
+ if(distance <= cutoff){
+ if(it != seqPairSet.end()){
+ truePositives++;
+ seqPairSet.erase(it);
+ }
+ else{
+ falseNegatives++;