5 * Created by Sarah Westcott on 7/9/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
11 #include "ignoregaps.h"
12 #include "eachgapdist.h"
14 //********************************************************************************************************************
15 //sorts lowest to highest
16 inline bool compareQuanMembers(quanMember left, quanMember right){
17 return (left.score < right.score);
19 //***************************************************************************************************************
21 Pintail::Pintail(string filename, string temp) { fastafile = filename; templateFile = temp; }
22 //***************************************************************************************************************
26 for (int i = 0; i < querySeqs.size(); i++) { delete querySeqs[i]; }
27 for (int i = 0; i < templateSeqs.size(); i++) { delete templateSeqs[i]; }
28 for (int i = 0; i < bestfit.size(); i++) { delete bestfit[i]; }
31 errorOut(e, "Pintail", "~Pintail");
35 //***************************************************************************************************************
36 void Pintail::print(ostream& out) {
41 for (int i = 0; i < querySeqs.size(); i++) {
43 int index = ceil(deviation[i]);
45 //is your DE value higher than the 95%
47 if (quantiles[index][4] == 0.0) {
48 chimera = "Your template does not include sequences that provide quantile values at distance " + toString(index);
50 if (DE[i] > quantiles[index][4]) { chimera = "Yes"; }
51 else { chimera = "No"; }
54 out << querySeqs[i]->getName() << '\t' << "div: " << deviation[i] << "\tstDev: " << DE[i] << "\tchimera flag: " << chimera << endl;
55 if (chimera == "Yes") {
56 mothurOut(querySeqs[i]->getName() + "\tdiv: " + toString(deviation[i]) + "\tstDev: " + toString(DE[i]) + "\tchimera flag: " + chimera); mothurOutEndLine();
60 for (int j = 0; j < obsDistance[i].size(); j++) { out << obsDistance[i][j] << '\t'; }
65 for (int m = 0; m < expectedDistance[i].size(); m++) { out << expectedDistance[i][m] << '\t'; }
71 errorOut(e, "Pintail", "print");
76 //***************************************************************************************************************
77 void Pintail::getChimeras() {
80 //read in query sequences and subject sequences
81 mothurOut("Reading sequences and template file... "); cout.flush();
82 querySeqs = readSeqs(fastafile);
83 templateSeqs = readSeqs(templateFile);
84 mothurOut("Done."); mothurOutEndLine();
86 int numSeqs = querySeqs.size();
88 obsDistance.resize(numSeqs);
89 expectedDistance.resize(numSeqs);
90 seqCoef.resize(numSeqs);
93 bestfit.resize(numSeqs);
94 deviation.resize(numSeqs);
95 trimmed.resize(numSeqs);
96 windowSizes.resize(numSeqs, window);
97 windowSizesTemplate.resize(templateSeqs.size(), window);
98 windowsForeachQuery.resize(numSeqs);
100 quantiles.resize(100); //one for every percent mismatch
101 quantilesMembers.resize(100); //one for every percent mismatch
103 //break up file if needed
104 int linesPerProcess = numSeqs / processors ;
106 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
107 //find breakup of sequences for all times we will Parallelize
108 if (processors == 1) { lines.push_back(new linePair(0, numSeqs)); }
111 for (int i = 0; i < (processors-1); i++) {
112 lines.push_back(new linePair((i*linesPerProcess), ((i*linesPerProcess) + linesPerProcess)));
114 //this is necessary to get remainder of processors / numSeqs so you don't miss any lines at the end
115 int i = processors - 1;
116 lines.push_back(new linePair((i*linesPerProcess), numSeqs));
119 //find breakup of templatefile for quantiles
120 if (processors == 1) { templateLines.push_back(new linePair(0, templateSeqs.size())); }
122 for (int i = 0; i < processors; i++) {
123 templateLines.push_back(new linePair());
124 templateLines[i]->start = int (sqrt(float(i)/float(processors)) * templateSeqs.size());
125 templateLines[i]->end = int (sqrt(float(i+1)/float(processors)) * templateSeqs.size());
129 lines.push_back(new linePair(0, numSeqs));
130 templateLines.push_back(new linePair(0, templateSeqs.size()));
133 distcalculator = new eachGapDist();
134 decalc = new DeCalculator();
136 //if the user does enter a mask then you want to keep all the spots in the alignment
137 if (seqMask.length() == 0) { decalc->setAlignmentLength(querySeqs[0]->getAligned().length()); }
138 else { decalc->setAlignmentLength(seqMask.length()); }
140 decalc->setMask(seqMask);
143 if (processors == 1) {
144 mothurOut("Finding closest sequence in template to each sequence... "); cout.flush();
145 bestfit = findPairs(lines[0]->start, lines[0]->end);
146 mothurOut("Done."); mothurOutEndLine();
147 }else { createProcessesPairs(); }
149 //string o = "closestmatch.eachgap.fasta";
151 //openOutputFile(o, out7);
153 //for (int i = 0; i < bestfit.size(); i++) {
154 //out7 << ">" << querySeqs[i]->getName() << "-"<< bestfit[i]->getName() << endl;
155 //out7 << bestfit[i]->getAligned() << endl;
159 mothurOut("Getting conservation... "); cout.flush();
160 if (consfile == "") {
161 mothurOut("Calculating probability of conservation for your template sequences. This can take a while... I will output the frequency of the highest base in each position to a .freq file so that you can input them using the conservation parameter next time you run this command. Providing the .freq file will improve speed. "); cout.flush();
162 probabilityProfile = decalc->calcFreq(templateSeqs, templateFile);
163 mothurOut("Done."); mothurOutEndLine();
164 }else { probabilityProfile = readFreq(); }
167 for (int i = 0; i < probabilityProfile.size(); i++) { probabilityProfile[i] = 1 - probabilityProfile[i]; } //cout << i << '\t' << probabilityProfile[i] << endl;
168 mothurOut("Done."); mothurOutEndLine();
170 //mask sequences if the user wants to
173 for (int i = 0; i < querySeqs.size(); i++) {
174 decalc->runMask(querySeqs[i]);
178 for (int i = 0; i < templateSeqs.size(); i++) {
179 decalc->runMask(templateSeqs[i]);
182 for (int i = 0; i < bestfit.size(); i++) {
183 decalc->runMask(bestfit[i]);
189 vector<Sequence*> temp = templateSeqs;
190 for (int i = 0; i < querySeqs.size(); i++) { temp.push_back(querySeqs[i]); }
194 runFilter(querySeqs);
195 runFilter(templateSeqs);
200 if (processors == 1) {
202 for (int j = 0; j < bestfit.size(); j++) {
203 decalc->trimSeqs(querySeqs[j], bestfit[j], trimmed[j]);
206 mothurOut("Finding window breaks... "); cout.flush();
207 for (int i = lines[0]->start; i < lines[0]->end; i++) {
208 it = trimmed[i].begin();
209 vector<int> win = decalc->findWindows(querySeqs[i], it->first, it->second, windowSizes[i], increment);
210 windowsForeachQuery[i] = win;
212 mothurOut("Done."); mothurOutEndLine();
214 }else { createProcessesSpots(); }
216 if (processors == 1) {
218 mothurOut("Calculating observed distance... "); cout.flush();
219 for (int i = lines[0]->start; i < lines[0]->end; i++) {
220 vector<float> obsi = decalc->calcObserved(querySeqs[i], bestfit[i], windowsForeachQuery[i], windowSizes[i]);
222 obsDistance[i] = obsi;
224 mothurOut("Done."); mothurOutEndLine();
227 mothurOut("Finding variability... "); cout.flush();
228 for (int i = lines[0]->start; i < lines[0]->end; i++) {
229 vector<float> q = decalc->findQav(windowsForeachQuery[i], windowSizes[i], probabilityProfile);
233 mothurOut("Done."); mothurOutEndLine();
236 mothurOut("Calculating alpha... "); cout.flush();
237 for (int i = lines[0]->start; i < lines[0]->end; i++) {
238 float alpha = decalc->getCoef(obsDistance[i], Qav[i]);
241 mothurOut("Done."); mothurOutEndLine();
244 mothurOut("Calculating expected distance... "); cout.flush();
245 for (int i = lines[0]->start; i < lines[0]->end; i++) {
246 vector<float> exp = decalc->calcExpected(Qav[i], seqCoef[i]);
247 expectedDistance[i] = exp;
249 mothurOut("Done."); mothurOutEndLine();
252 mothurOut("Finding deviation... "); cout.flush();
253 for (int i = lines[0]->start; i < lines[0]->end; i++) {
254 float de = decalc->calcDE(obsDistance[i], expectedDistance[i]);
257 it = trimmed[i].begin();
258 float dist = decalc->calcDist(querySeqs[i], bestfit[i], it->first, it->second);
261 mothurOut("Done."); mothurOutEndLine();
264 else { createProcesses(); }
266 //quantiles are used to determine whether the de values found indicate a chimera
267 //if you have to calculate them, its time intensive because you are finding the de and deviation values for each
268 //combination of sequences in the template
269 if (quanfile != "") { quantiles = readQuantiles(); }
272 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();
273 if (processors == 1) {
274 quantilesMembers = decalc->getQuantiles(templateSeqs, windowSizesTemplate, window, probabilityProfile, increment, 0, templateSeqs.size());
275 }else { createProcessesQuan(); }
279 string noOutliers, outliers;
281 if ((!filter) && (seqMask == "")) {
282 noOutliers = getRootName(templateFile) + "pintail.quan";
283 }else if ((filter) && (seqMask == "")) {
284 noOutliers = getRootName(templateFile) + "pintail.filtered.quan";
285 }else if ((!filter) && (seqMask != "")) {
286 noOutliers = getRootName(templateFile) + "pintail.masked.quan";
287 }else if ((filter) && (seqMask != "")) {
288 noOutliers = getRootName(templateFile) + "pintail.filtered.masked.quan";
291 //outliers = getRootName(templateFile) + "pintail.quanYESOUTLIERS";
293 /*openOutputFile(outliers, out4);
296 for (int i = 0; i < quantilesMembers.size(); i++) {
299 if (quantilesMembers[i].size() == 0) {
300 //in case this is not a distance found in your template files
301 for (int g = 0; g < 6; g++) {
306 sort(quantilesMembers[i].begin(), quantilesMembers[i].end(), compareQuanMembers);
309 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.10)].score);
311 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.25)].score);
313 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.5)].score);
315 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.75)].score);
317 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.95)].score);
319 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.99)].score);
325 for (int u = 0; u < temp.size(); u++) { out4 << temp[u] << '\t'; }
334 decalc->removeObviousOutliers(quantilesMembers, templateSeqs.size());
336 openOutputFile(noOutliers, out5);
339 for (int i = 0; i < quantilesMembers.size(); i++) {
342 if (quantilesMembers[i].size() == 0) {
343 //in case this is not a distance found in your template files
344 for (int g = 0; g < 6; g++) {
349 sort(quantilesMembers[i].begin(), quantilesMembers[i].end(), compareQuanMembers);
352 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.10)].score);
354 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.25)].score);
356 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.5)].score);
358 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.75)].score);
360 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.95)].score);
362 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.99)].score);
368 for (int u = 0; u < temp.size(); u++) { out5 << temp[u] << '\t'; }
375 mothurOut("Done."); mothurOutEndLine();
380 for (int i = 0; i < lines.size(); i++) { delete lines[i]; }
381 for (int i = 0; i < templateLines.size(); i++) { delete templateLines[i]; }
383 delete distcalculator;
386 catch(exception& e) {
387 errorOut(e, "Pintail", "getChimeras");
392 //***************************************************************************************************************
394 vector<float> Pintail::readFreq() {
398 openInputFile(consfile, in);
401 set<int> h = decalc->getPos(); //positions of bases in masking sequence
403 //read in probabilities and store in vector
410 if (h.count(pos) > 0) {
412 Pi = (num - 0.25) / 0.75;
414 //cannot have probability less than 0.
415 if (Pi < 0) { Pi = 0.0; }
417 //do you want this spot
428 catch(exception& e) {
429 errorOut(e, "Pintail", "readFreq");
434 //***************************************************************************************************************
435 //calculate the distances from each query sequence to all sequences in the template to find the closest sequence
436 vector<Sequence*> Pintail::findPairs(int start, int end) {
439 vector<Sequence*> seqsMatches;
441 for(int i = start; i < end; i++){
443 vector<Sequence*> copy = decalc->findClosest(querySeqs[i], templateSeqs, 1);
444 seqsMatches.push_back(copy[0]);
450 catch(exception& e) {
451 errorOut(e, "Pintail", "findPairs");
456 /**************************************************************************************************/
458 void Pintail::createProcessesSpots() {
460 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
462 vector<int> processIDS;
464 //loop through and create all the processes you want
465 while (process != processors) {
469 processIDS.push_back(pid);
473 for (int j = lines[process]->start; j < lines[process]->end; j++) {
475 //chops off beginning and end of sequences so they both start and end with a base
478 decalc->trimSeqs(querySeqs[j], bestfit[j], trim);
483 mothurOut("Finding window breaks for sequences " + toString(lines[process]->start) + " to " + toString(lines[process]->end)); mothurOutEndLine();
484 for (int i = lines[process]->start; i < lines[process]->end; i++) {
485 it = trimmed[i].begin();
486 windowsForeachQuery[i] = decalc->findWindows(querySeqs[i], it->first, it->second, windowSizes[i], increment);
488 mothurOut("Done finding window breaks for sequences " + toString(lines[process]->start) + " to " + toString(lines[process]->end)); mothurOutEndLine();
490 //write out data to file so parent can read it
492 string s = toString(getpid()) + ".temp";
493 openOutputFile(s, out);
495 //output windowsForeachQuery
496 for (int i = lines[process]->start; i < lines[process]->end; i++) {
497 out << windowsForeachQuery[i].size() << '\t';
498 for (int j = 0; j < windowsForeachQuery[i].size(); j++) {
499 out << windowsForeachQuery[i][j] << '\t';
505 for (int i = lines[process]->start; i < lines[process]->end; i++) {
506 out << windowSizes[i] << '\t';
510 //output trimmed values
511 for (int i = lines[process]->start; i < lines[process]->end; i++) {
512 it = trimmed[i].begin();
513 out << it->first << '\t' << it->second << endl;
518 }else { mothurOut("unable to spawn the necessary processes."); mothurOutEndLine(); exit(0); }
521 //force parent to wait until all the processes are done
522 for (int i=0;i<processors;i++) {
523 int temp = processIDS[i];
527 //get data created by processes
528 for (int i=0;i<processors;i++) {
530 string s = toString(processIDS[i]) + ".temp";
531 openInputFile(s, in);
533 int size = lines[i]->end - lines[i]->start;
535 int count = lines[i]->start;
536 for (int m = 0; m < size; m++) {
540 vector<int> win; int w;
541 for (int j = 0; j < num; j++) {
546 windowsForeachQuery[count] = win;
552 count = lines[i]->start;
553 for (int m = 0; m < size; m++) {
557 windowSizes[count] = num;
563 count = lines[i]->start;
564 for (int m = 0; m < size; m++) {
585 for (int j = 0; j < bestfit.size(); j++) {
586 //chops off beginning and end of sequences so they both start and end with a base
587 decalc->trimSeqs(querySeqs[j], bestfit[j], trimmed[j]);
590 for (int i = lines[0]->start; i < lines[0]->end; i++) {
591 it = trimmed[i].begin();
592 vector<int> win = decalc->findWindows(querySeqs[i], it->first, it->second, windowSizes[i], increment);
593 windowsForeachQuery[i] = win;
598 catch(exception& e) {
599 errorOut(e, "Pintail", "createProcessesSpots");
603 /**************************************************************************************************/
605 void Pintail::createProcessesPairs() {
607 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
609 vector<int> processIDS;
611 //loop through and create all the processes you want
612 while (process != processors) {
616 processIDS.push_back(pid);
620 mothurOut("Finding pairs for sequences " + toString(lines[process]->start) + " to " + toString(lines[process]->end)); mothurOutEndLine();
621 bestfit = findPairs(lines[process]->start, lines[process]->end);
622 mothurOut("Done finding pairs for sequences " + toString(lines[process]->start) + " to " + toString(lines[process]->end)); mothurOutEndLine();
624 //write out data to file so parent can read it
626 string s = toString(getpid()) + ".temp";
627 openOutputFile(s, out);
629 //output range and size
630 out << bestfit.size() << endl;
633 for (int i = 0; i < bestfit.size(); i++) {
634 out << ">" << bestfit[i]->getName() << endl << bestfit[i]->getAligned() << endl;
639 }else { mothurOut("unable to spawn the necessary processes."); mothurOutEndLine(); exit(0); }
642 //force parent to wait until all the processes are done
643 for (int i=0;i<processors;i++) {
644 int temp = processIDS[i];
648 //get data created by processes
649 for (int i=0;i<processors;i++) {
651 string s = toString(processIDS[i]) + ".temp";
652 openInputFile(s, in);
655 in >> size; gobble(in);
658 int count = lines[i]->start;
659 for (int m = 0; m < size; m++) {
660 Sequence* temp = new Sequence(in);
661 bestfit[count] = temp;
673 bestfit = findPairs(lines[0]->start, lines[0]->end);
676 catch(exception& e) {
677 errorOut(e, "Pintail", "createProcessesPairs");
681 /**************************************************************************************************/
683 void Pintail::createProcesses() {
685 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
687 vector<int> processIDS;
689 //loop through and create all the processes you want
690 while (process != processors) {
694 processIDS.push_back(pid);
698 mothurOut("Calculating observed, expected and de values for sequences " + toString(lines[process]->start) + " to " + toString(lines[process]->end)); mothurOutEndLine();
699 for (int i = lines[process]->start; i < lines[process]->end; i++) {
701 vector<float> obsi = decalc->calcObserved(querySeqs[i], bestfit[i], windowsForeachQuery[i], windowSizes[i]);
702 obsDistance[i] = obsi;
705 vector<float> q = decalc->findQav(windowsForeachQuery[i], windowSizes[i], probabilityProfile);
708 float alpha = decalc->getCoef(obsDistance[i], q);
711 vector<float> exp = decalc->calcExpected(q, alpha);
712 expectedDistance[i] = exp;
714 //get de and deviation
715 float dei = decalc->calcDE(obsi, exp);
718 it = trimmed[i].begin();
719 float dist = decalc->calcDist(querySeqs[i], bestfit[i], it->first, it->second);
722 mothurOut("Done calculating observed, expected and de values for sequences " + toString(lines[process]->start) + " to " + toString(lines[process]->end)); mothurOutEndLine();
724 //write out data to file so parent can read it
726 string s = toString(getpid()) + ".temp";
727 openOutputFile(s, out);
729 int size = lines[process]->end - lines[process]->start;
732 //output observed distances
733 for (int i = lines[process]->start; i < lines[process]->end; i++) {
734 out << obsDistance[i].size() << '\t';
735 for (int j = 0; j < obsDistance[i].size(); j++) {
736 out << obsDistance[i][j] << '\t';
742 //output expected distances
743 for (int i = lines[process]->start; i < lines[process]->end; i++) {
744 out << expectedDistance[i].size() << '\t';
745 for (int j = 0; j < expectedDistance[i].size(); j++) {
746 out << expectedDistance[i][j] << '\t';
753 for (int i = lines[process]->start; i < lines[process]->end; i++) {
754 out << DE[i] << '\t';
759 for (int i = lines[process]->start; i < lines[process]->end; i++) {
760 out << deviation[i] << '\t';
767 }else { mothurOut("unable to spawn the necessary processes."); mothurOutEndLine(); exit(0); }
770 //force parent to wait until all the processes are done
771 for (int i=0;i<processors;i++) {
772 int temp = processIDS[i];
776 //get data created by processes
777 for (int i=0;i<processors;i++) {
779 string s = toString(processIDS[i]) + ".temp";
780 openInputFile(s, in);
783 in >> size; gobble(in);
785 //get observed distances
786 int count = lines[i]->start;
787 for (int m = 0; m < size; m++) {
791 vector<float> obs; float w;
792 for (int j = 0; j < num; j++) {
797 obsDistance[count] = obs;
804 //get expected distances
805 count = lines[i]->start;
806 for (int m = 0; m < size; m++) {
810 vector<float> exp; float w;
811 for (int j = 0; j < num; j++) {
816 expectedDistance[count] = exp;
823 count = lines[i]->start;
824 for (int m = 0; m < size; m++) {
834 count = lines[i]->start;
835 for (int m = 0; m < size; m++) {
839 deviation[count] = num;
849 mothurOut("Calculating observed distance... "); cout.flush();
850 for (int i = lines[0]->start; i < lines[0]->end; i++) {
851 vector<float> obsi = decalc->calcObserved(querySeqs[i], bestfit[i], windowsForeachQuery[i], windowSizes[i]);
852 obsDistance[i] = obsi;
854 mothurOut("Done."); mothurOutEndLine();
858 mothurOut("Finding variability... "); cout.flush();
859 for (int i = lines[0]->start; i < lines[0]->end; i++) {
860 vector<float> q = decalc->findQav(windowsForeachQuery[i], windowSizes[i], probabilityProfile);
863 mothurOut("Done."); mothurOutEndLine();
867 mothurOut("Calculating alpha... "); cout.flush();
868 for (int i = lines[0]->start; i < lines[0]->end; i++) {
869 float alpha = decalc->getCoef(obsDistance[i], Qav[i]);
870 seqCoef.push_back(alpha);
872 mothurOut("Done."); mothurOutEndLine();
876 mothurOut("Calculating expected distance... "); cout.flush();
877 for (int i = lines[0]->start; i < lines[0]->end; i++) {
878 vector<float> exp = decalc->calcExpected(Qav[i], seqCoef[i]);
879 expectedDistance[i] = exp;
881 mothurOut("Done."); mothurOutEndLine();
885 mothurOut("Finding deviation... "); cout.flush();
886 for (int i = lines[0]->start; i < lines[0]->end; i++) {
887 float de = decalc->calcDE(obsDistance[i], expectedDistance[i]);
890 it = trimmed[i].begin();
891 float dist = decalc->calcDist(querySeqs[i], bestfit[i], it->first, it->second);
894 mothurOut("Done."); mothurOutEndLine();
898 catch(exception& e) {
899 errorOut(e, "Pintail", "createProcesses");
905 /**************************************************************************************************/
907 void Pintail::createProcessesQuan() {
909 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
911 vector<int> processIDS;
913 //loop through and create all the processes you want
914 while (process != processors) {
918 processIDS.push_back(pid);
922 quantilesMembers = decalc->getQuantiles(templateSeqs, windowSizesTemplate, window, probabilityProfile, increment, templateLines[process]->start, templateLines[process]->end);
924 //write out data to file so parent can read it
926 string s = toString(getpid()) + ".temp";
927 openOutputFile(s, out);
930 //output observed distances
931 for (int i = 0; i < quantilesMembers.size(); i++) {
932 out << quantilesMembers[i].size() << '\t';
933 for (int j = 0; j < quantilesMembers[i].size(); j++) {
934 out << quantilesMembers[i][j].score << '\t' << quantilesMembers[i][j].member1 << '\t' << quantilesMembers[i][j].member2 << '\t';
942 }else { mothurOut("unable to spawn the necessary processes."); mothurOutEndLine(); exit(0); }
945 //force parent to wait until all the processes are done
946 for (int i=0;i<processors;i++) {
947 int temp = processIDS[i];
951 //get data created by processes
952 for (int i=0;i<processors;i++) {
954 string s = toString(processIDS[i]) + ".temp";
955 openInputFile(s, in);
957 vector< vector<quanMember> > quan;
961 for (int m = 0; m < quan.size(); m++) {
967 vector<quanMember> q; float w; int b, n;
968 for (int j = 0; j < num; j++) {
970 //cout << w << '\t' << b << '\t' n << endl;
971 quanMember newMember(w, b, n);
972 q.push_back(newMember);
974 //cout << "here" << endl;
976 //cout << "now here" << endl;
981 //save quan in quantiles
982 for (int j = 0; j < quan.size(); j++) {
983 //put all values of q[i] into quan[i]
984 for (int l = 0; l < quan[j].size(); l++) { quantilesMembers[j].push_back(quan[j][l]); }
985 //quantilesMembers[j].insert(quantilesMembers[j].begin(), quan[j].begin(), quan[j].end());
993 quantilesMembers = decalc->getQuantiles(templateSeqs, windowSizesTemplate, window, probabilityProfile, increment, 0, templateSeqs.size());
996 catch(exception& e) {
997 errorOut(e, "Pintail", "createProcessesQuan");
1003 //***************************************************************************************************************