+
+ //quantiles are used to determine whether the de values found indicate a chimera
+ //if you have to calculate them, its time intensive because you are finding the de and deviation values for each
+ //combination of sequences in the template
+ if (quanfile != "") { quantiles = readQuantiles(); }
+ else {
+
+ mothurOut("Calculating quantiles for your template. This can take a while... I will output the quantiles to a .quan file that you can input them using the quantiles parameter next time you run this command. Providing the .quan file will dramatically improve speed. "); cout.flush();
+ if (processors == 1) {
+ quantiles = decalc->getQuantiles(templateSeqs, windowSizesTemplate, window, probabilityProfile, increment, 0, templateSeqs.size());
+ }else { createProcessesQuan(); }
+
+
+ decalc->removeObviousOutliers(quantiles);
+
+ ofstream out4;
+ string o = getRootName(templateFile) + "quan";
+
+ openOutputFile(o, out4);
+
+ //adjust quantiles
+ for (int i = 0; i < quantiles.size(); i++) {
+ if (quantiles[i].size() == 0) {
+ //in case this is not a distance found in your template files
+ for (int g = 0; g < 6; g++) {
+ quantiles[i].push_back(0.0);
+ }
+ }else{
+
+ sort(quantiles[i].begin(), quantiles[i].end());
+
+ vector<float> temp;
+ //save 10%
+ temp.push_back(quantiles[i][int(quantiles[i].size() * 0.10)]);
+ //save 25%
+ temp.push_back(quantiles[i][int(quantiles[i].size() * 0.25)]);
+ //save 50%
+ temp.push_back(quantiles[i][int(quantiles[i].size() * 0.5)]);
+ //save 75%
+ temp.push_back(quantiles[i][int(quantiles[i].size() * 0.75)]);
+ //save 95%
+ temp.push_back(quantiles[i][int(quantiles[i].size() * 0.95)]);
+ //save 99%
+ temp.push_back(quantiles[i][int(quantiles[i].size() * 0.99)]);
+
+ quantiles[i] = temp;
+ }
+
+ //output quan value
+ out4 << i+1 << '\t';
+ for (int u = 0; u < quantiles[i].size(); u++) { out4 << quantiles[i][u] << '\t'; }
+ out4 << endl;
+
+ }
+
+ mothurOut("Done."); mothurOutEndLine();
+ }