+ mysubset.clear(); mysubset.push_back(lookup[0]); mysubset.push_back(lookup[2]); mysubset.push_back(lookup[3]);
+ vector<double> sharedACD = nseqsCalc->getValues(mysubset);
+
+ mysubset.clear(); mysubset.push_back(lookup[1]); mysubset.push_back(lookup[2]); mysubset.push_back(lookup[3]);
+ vector<double> sharedBCD = nseqsCalc->getValues(mysubset);
+
+ sharedVal = sharedData[0] + sharedData[1] + sharedData[2] + sharedData[3];
+ sharedABCVal = sharedABC[0] + sharedABC[1] + sharedABC[2];
+ sharedABDVal = sharedABD[0] + sharedABD[1] + sharedABD[2];
+ sharedACDVal = sharedACD[0] + sharedACD[1] + sharedACD[2];
+ sharedBCDVal = sharedBCD[0] + sharedBCD[1] + sharedBCD[2];
+ sharedABVal = sharedAB[0] + sharedAB[1];
+ sharedACVal = sharedAC[0] + sharedAC[1];
+ sharedADVal = sharedAD[0] + sharedAD[1];
+ sharedBCVal = sharedBC[0] + sharedBC[1];
+ sharedBDVal = sharedBD[0] + sharedBD[1];
+ sharedCDVal = sharedCD[0] + sharedCD[1];
+ numSeqsA = sabundA->getNumSeqs();
+ numSeqsB = sabundB->getNumSeqs();
+ numSeqsC = sabundC->getNumSeqs();
+ numSeqsD = sabundD->getNumSeqs();
+
+ delete nseqsCalc;
+ }
+
+
+ //image window
+ outsvg << "<svg xmlns:svg=\"http://www.w3.org/2000/svg\" xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\" viewBox=\"0 0 " + toString(width) + " " + toString(windowSize) + " \" >\n";
+ outsvg << "<g>\n";
+ outsvg << "<rect fill=\"white\" stroke=\"white\" x=\"0\" y=\"0\" width=\"" + toString(width) + "\" height=\"" + toString(windowSize) + "\"/>";
+ outsvg << "<text fill=\"black\" class=\"seri\" font-size=\"" + toString(fontSize) + "\" x=\"" + toString(int(0.40 * width)) + "\" y=\"" + toString(int(0.05 * height)) + "\" >Venn Diagram at distance " + lookup[0]->getLabel() + "</text>\n";
+
+ outsvg << "<text fill=\"black\" class=\"seri\" font-size=\"" + toString(fontSize) + "\" x=\"" + toString(int(0.25 * width)) + "\" y=\"" + toString(int(0.625 * height)) + "\">The number of species in group " + lookup[0]->getGroup() + " is " + toString(numA);
+ if (nseqs) { outsvg << ", and the number of squences is " + toString(numSeqsA); }
+ outsvg << "</text>\n";
+ outsvg << "<text fill=\"black\" class=\"seri\" font-size=\"" + toString(fontSize) + "\" x=\"" + toString(int(0.25 * width)) + "\" y=\"" + toString(int(0.65 * height)) + "\">The number of species in group " + lookup[1]->getGroup() + " is " + toString(numB);
+ if (nseqs) { outsvg << ", and the number of squences is " + toString(numSeqsB); }
+ outsvg << "</text>\n";
+ outsvg << "<text fill=\"black\" class=\"seri\" font-size=\"" + toString(fontSize) + "\" x=\"" + toString(int(0.25 * width)) + "\" y=\"" + toString(int(0.675 * height)) + "\">The number of species in group " + lookup[2]->getGroup() + " is " + toString(numC);
+ if (nseqs) { outsvg << ", and the number of squences is " + toString(numSeqsC); }
+ outsvg << "</text>\n";
+ outsvg << "<text fill=\"black\" class=\"seri\" font-size=\"" + toString(fontSize) + "\" x=\"" + toString(int(0.25 * width)) + "\" y=\"" + toString(int(0.7 * height)) + "\">The number of species in group " + lookup[3]->getGroup() + " is " + toString(numD);
+ if (nseqs) { outsvg << ", and the number of squences is " + toString(numSeqsD); }
+ outsvg << "</text>\n";
+
+ outsvg << "<text fill=\"black\" class=\"seri\" font-size=\"" + toString(fontSize) + "\" x=\"" + toString(int(0.25 * width)) + "\" y=\"" + toString(int(0.725 * height)) + "\">The number of species shared between groups " + lookup[0]->getGroup() + " and " + lookup[1]->getGroup() + " is " + toString(sharedAB);
+ if (nseqs) { outsvg << ", and the number of squences is " + toString(sharedABVal); }
+ outsvg << "</text>\n";
+ outsvg << "<text fill=\"black\" class=\"seri\" font-size=\"" + toString(fontSize) + "\" x=\"" + toString(int(0.25 * width)) + "\" y=\"" + toString(int(0.75 * height)) + "\">The number of species shared between groups " + lookup[0]->getGroup() + " and " + lookup[2]->getGroup() + " is " + toString(sharedAC);
+ if (nseqs) { outsvg << ", and the number of squences is " + toString(sharedACVal); }
+ outsvg << "</text>\n";
+ outsvg << "<text fill=\"black\" class=\"seri\" font-size=\"" + toString(fontSize) + "\" x=\"" + toString(int(0.25 * width)) + "\" y=\"" + toString(int(0.775 * height)) + "\">The number of species shared between groups " + lookup[0]->getGroup() + " and " + lookup[3]->getGroup() + " is " + toString(sharedAD);
+ if (nseqs) { outsvg << ", and the number of squences is " + toString(sharedADVal); }
+ outsvg << "</text>\n";
+ outsvg << "<text fill=\"black\" class=\"seri\" font-size=\"" + toString(fontSize) + "\" x=\"" + toString(int(0.25 * width)) + "\" y=\"" + toString(int(0.8 * height)) + "\">The number of species shared between groups " + lookup[1]->getGroup() + " and " + lookup[2]->getGroup() + " is " + toString(sharedBC);
+ if (nseqs) { outsvg << ", and the number of squences is " + toString(sharedBCVal); }
+ outsvg << "</text>\n";
+ outsvg << "<text fill=\"black\" class=\"seri\" font-size=\"" + toString(fontSize) + "\" x=\"" + toString(int(0.25 * width)) + "\" y=\"" + toString(int(0.825 * height)) + "\">The number of species shared between groups " + lookup[1]->getGroup() + " and " + lookup[3]->getGroup() + " is " + toString(sharedBD);
+ if (nseqs) { outsvg << ", and the number of squences is " + toString(sharedBDVal); }
+ outsvg << "</text>\n";
+ outsvg << "<text fill=\"black\" class=\"seri\" font-size=\"" + toString(fontSize) + "\" x=\"" + toString(int(0.25 * width)) + "\" y=\"" + toString(int(0.85 * height)) + "\">The number of species shared between groups " + lookup[2]->getGroup() + " and " + lookup[3]->getGroup() + " is " + toString(sharedCD);
+ if (nseqs) { outsvg << ", and the number of squences is " + toString(sharedCDVal); }
+ outsvg << "</text>\n";
+
+ outsvg << "<text fill=\"black\" class=\"seri\" font-size=\"" + toString(fontSize) + "\" x=\"" + toString(int(0.25 * width)) + "\" y=\"" + toString(int(0.875 * height)) + "\">The number of species shared between groups " + lookup[0]->getGroup() + ", " + lookup[1]->getGroup() + " and " + lookup[2]->getGroup() + " is " + toString(sharedABC);
+ if (nseqs) { outsvg << ", and the number of squences is " + toString(sharedABCVal); }
+ outsvg << "</text>\n";
+ outsvg << "<text fill=\"black\" class=\"seri\" font-size=\"" + toString(fontSize) + "\" x=\"" + toString(int(0.25 * width)) + "\" y=\"" + toString(int(0.9 * height)) + "\">The number of species shared between groups " + lookup[0]->getGroup() + ", " + lookup[1]->getGroup() + " and " + lookup[3]->getGroup() + " is " + toString(sharedABD);
+ if (nseqs) { outsvg << ", and the number of squences is " + toString(sharedABDVal); }
+ outsvg << "</text>\n";
+ outsvg << "<text fill=\"black\" class=\"seri\" font-size=\"" + toString(fontSize) + "\" x=\"" + toString(int(0.25 * width)) + "\" y=\"" + toString(int(0.925 * height)) + "\">The number of species shared between groups " + lookup[0]->getGroup() + ", " + lookup[2]->getGroup() + " and " + lookup[3]->getGroup() + " is " + toString(sharedACD);
+ if (nseqs) { outsvg << ", and the number of squences is " + toString(sharedACDVal); }
+ outsvg << "</text>\n";
+ outsvg << "<text fill=\"black\" class=\"seri\" font-size=\"" + toString(fontSize) + "\" x=\"" + toString(int(0.25 * width)) + "\" y=\"" + toString(int(0.95 * height)) + "\">The number of species shared between groups " + lookup[1]->getGroup() + ", " + lookup[2]->getGroup() + " and " + lookup[3]->getGroup() + " is " + toString(sharedBCD);
+ if (nseqs) { outsvg << ", and the number of squences is " + toString(sharedBCDVal); }
+ outsvg << "</text>\n";
+
+ //make adjustments
+ sharedABC = sharedABC - sharedABCD;
+ //cout << "num abc = " << sharedABC << endl;
+ sharedABD = sharedABD - sharedABCD;
+ //cout << "num abd = " << sharedABD << endl;
+ sharedACD = sharedACD - sharedABCD;
+ //cout << "num acd = " << sharedACD << endl;
+ sharedBCD = sharedBCD - sharedABCD;
+ //cout << "num bcd = " << sharedBCD << endl;