X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=venn.cpp;h=ad74376456f96e09176fa4c97c53e949e7d748b4;hb=31c6076fe649829d9b8f773f6f12b627d3ef5d9b;hp=9e75cdb2be63a7f967e08ebe013dd88e1442e8f9;hpb=3117b1c3109121dff476997d3c5db5b47a77729b;p=mothur.git diff --git a/venn.cpp b/venn.cpp index 9e75cdb..ad74376 100644 --- a/venn.cpp +++ b/venn.cpp @@ -115,7 +115,6 @@ void Venn::getPic(vector lookup, vector vCalcs delete singleCalc; } - /******************* 2 Groups **************************/ }else if (lookup.size() == 2) { @@ -183,11 +182,8 @@ void Venn::getPic(vector lookup, vector vCalcs //close file outsvg << "\n\n"; outsvg.close(); - delete sabundA; - delete sabundB; delete singleCalc; } - /******************* 3 Groups **************************/ }else if (lookup.size() == 3) { @@ -198,7 +194,7 @@ void Venn::getPic(vector lookup, vector vCalcs sA = lookup[0]->getSAbundVector(); sabundA = &sA; sB = lookup[1]->getSAbundVector(); sabundB = &sB; sC = lookup[2]->getSAbundVector(); sabundC = &sC; - + //make a file for each calculator for(int i=0;i lookup, vector vCalcs vector sharedCwithAB; //find possible sharedABC values - float sharedABC1, sharedABC2, sharedABC3, sharedABC; + float sharedABC1 = 0.0; float sharedABC2 = 0.0; float sharedABC3 = 0.0; float sharedABC = 0.0; - if (vCalcs[i]->getName() != "sharedchao") { + if (vCalcs[i]->getMultiple() == false) { //merge BC and estimate with shared with A SharedRAbundVector* merge = new SharedRAbundVector(); for (int j = 0; j < lookup[1]->size(); j++) { @@ -283,9 +279,9 @@ void Venn::getPic(vector lookup, vector vCalcs sharedABC3 = sharedAC[0] + sharedBC[0] - sharedCwithAB[0]; //if any of the possible m's are - throw them out - if (sharedABC1 < 0.0) { sharedABC1 = 0; } - if (sharedABC2 < 0.0) { sharedABC2 = 0; } - if (sharedABC3 < 0.0) { sharedABC3 = 0; } + if (sharedABC1 < 0.00001) { sharedABC1 = 0; } + if (sharedABC2 < 0.00001) { sharedABC2 = 0; } + if (sharedABC3 < 0.00001) { sharedABC3 = 0; } //sharedABC is the minimum of the 3 possibilities if ((sharedABC1 < sharedABC2) && (sharedABC1 < sharedABC3)) { sharedABC = sharedABC1; } @@ -298,7 +294,7 @@ void Venn::getPic(vector lookup, vector vCalcs sharedBwithAC.push_back(sharedAB[0] + sharedBC[0] - sharedABC); sharedCwithAB.push_back(sharedAC[0] + sharedBC[0] - sharedABC); } - + //image window outsvg << "\n"; outsvg << "\n"; @@ -351,6 +347,7 @@ void Venn::getPic(vector lookup, vector vCalcs outsvg << "\n\n"; outsvg.close(); delete singleCalc; + } /******************* 4 Groups **************************/ @@ -516,7 +513,6 @@ void Venn::getPic(vector lookup, vector vCalcs delete singleCalc; } } - } }