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 if (index == 0) { index=1; }
47 //is your DE value higher than the 95%
49 if (DE[i] > quantiles[index-1][4]) { chimera = "Yes"; }
50 else { chimera = "No"; }
52 out << querySeqs[i]->getName() << '\t' << "div: " << deviation[i] << "\tstDev: " << DE[i] << "\tchimera flag: " << chimera << endl;
53 if (chimera == "Yes") {
54 mothurOut(querySeqs[i]->getName() + "\tdiv: " + toString(deviation[i]) + "\tstDev: " + toString(DE[i]) + "\tchimera flag: " + chimera); mothurOutEndLine();
58 for (int j = 0; j < obsDistance[i].size(); j++) { out << obsDistance[i][j] << '\t'; }
63 for (int m = 0; m < expectedDistance[i].size(); m++) { out << expectedDistance[i][m] << '\t'; }
69 errorOut(e, "Pintail", "print");
74 //***************************************************************************************************************
75 void Pintail::getChimeras() {
78 //read in query sequences and subject sequences
79 mothurOut("Reading sequences and template file... "); cout.flush();
80 querySeqs = readSeqs(fastafile);
81 templateSeqs = readSeqs(templateFile);
82 mothurOut("Done."); mothurOutEndLine();
84 int numSeqs = querySeqs.size();
86 obsDistance.resize(numSeqs);
87 expectedDistance.resize(numSeqs);
88 seqCoef.resize(numSeqs);
91 bestfit.resize(numSeqs);
92 deviation.resize(numSeqs);
93 trimmed.resize(numSeqs);
94 windowSizes.resize(numSeqs, window);
95 windowSizesTemplate.resize(templateSeqs.size(), window);
96 windowsForeachQuery.resize(numSeqs);
98 quantiles.resize(100); //one for every percent mismatch
99 quantilesMembers.resize(100); //one for every percent mismatch
101 //break up file if needed
102 int linesPerProcess = numSeqs / processors ;
104 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
105 //find breakup of sequences for all times we will Parallelize
106 if (processors == 1) { lines.push_back(new linePair(0, numSeqs)); }
109 for (int i = 0; i < (processors-1); i++) {
110 lines.push_back(new linePair((i*linesPerProcess), ((i*linesPerProcess) + linesPerProcess)));
112 //this is necessary to get remainder of processors / numSeqs so you don't miss any lines at the end
113 int i = processors - 1;
114 lines.push_back(new linePair((i*linesPerProcess), numSeqs));
117 //find breakup of templatefile for quantiles
118 if (processors == 1) { templateLines.push_back(new linePair(0, templateSeqs.size())); }
120 for (int i = 0; i < processors; i++) {
121 templateLines.push_back(new linePair());
122 templateLines[i]->start = int (sqrt(float(i)/float(processors)) * templateSeqs.size());
123 templateLines[i]->end = int (sqrt(float(i+1)/float(processors)) * templateSeqs.size());
127 lines.push_back(new linePair(0, numSeqs));
128 templateLines.push_back(new linePair(0, templateSeqs.size()));
131 distcalculator = new eachGapDist();
132 decalc = new DeCalculator();
134 //if the user does enter a mask then you want to keep all the spots in the alignment
135 if (seqMask.length() == 0) { decalc->setAlignmentLength(querySeqs[0]->getAligned().length()); }
136 else { decalc->setAlignmentLength(seqMask.length()); }
138 decalc->setMask(seqMask);
141 if (processors == 1) {
142 mothurOut("Finding closest sequence in template to each sequence... "); cout.flush();
143 bestfit = findPairs(lines[0]->start, lines[0]->end);
144 mothurOut("Done."); mothurOutEndLine();
145 }else { createProcessesPairs(); }
147 /*string o = "foronlinepintailpairs-eachgap";
149 openOutputFile(o, out7);
151 for (int i = 0; i < bestfit.size(); i++) {
152 out7 << querySeqs[i]->getName() << endl;
153 out7 << querySeqs[i]->getUnaligned() << endl << endl;
155 out7 << bestfit[i]->getName() << endl;
156 out7 << bestfit[i]->getUnaligned() << endl << endl << endl;
160 mothurOut("Getting conservation... "); cout.flush();
161 if (consfile == "") {
162 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();
163 probabilityProfile = decalc->calcFreq(templateSeqs, templateFile);
164 mothurOut("Done."); mothurOutEndLine();
165 }else { probabilityProfile = readFreq(); }
168 for (int i = 0; i < probabilityProfile.size(); i++) { probabilityProfile[i] = 1 - probabilityProfile[i]; } //cout << i << '\t' << probabilityProfile[i] << endl;
169 mothurOut("Done."); mothurOutEndLine();
171 //mask sequences if the user wants to
174 for (int i = 0; i < querySeqs.size(); i++) {
175 decalc->runMask(querySeqs[i]);
179 for (int i = 0; i < templateSeqs.size(); i++) {
180 decalc->runMask(templateSeqs[i]);
183 for (int i = 0; i < bestfit.size(); i++) {
184 decalc->runMask(bestfit[i]);
190 vector<Sequence*> temp = templateSeqs;
191 for (int i = 0; i < querySeqs.size(); i++) { temp.push_back(querySeqs[i]); }
195 runFilter(querySeqs);
196 runFilter(templateSeqs);
201 if (processors == 1) {
203 for (int j = 0; j < bestfit.size(); j++) {
204 decalc->trimSeqs(querySeqs[j], bestfit[j], trimmed[j]);
207 mothurOut("Finding window breaks... "); cout.flush();
208 for (int i = lines[0]->start; i < lines[0]->end; i++) {
209 it = trimmed[i].begin();
210 vector<int> win = decalc->findWindows(querySeqs[i], it->first, it->second, windowSizes[i], increment);
211 windowsForeachQuery[i] = win;
213 mothurOut("Done."); mothurOutEndLine();
215 }else { createProcessesSpots(); }
217 if (processors == 1) {
219 mothurOut("Calculating observed distance... "); cout.flush();
220 for (int i = lines[0]->start; i < lines[0]->end; i++) {
221 vector<float> obsi = decalc->calcObserved(querySeqs[i], bestfit[i], windowsForeachQuery[i], windowSizes[i]);
223 obsDistance[i] = obsi;
225 mothurOut("Done."); mothurOutEndLine();
228 mothurOut("Finding variability... "); cout.flush();
229 for (int i = lines[0]->start; i < lines[0]->end; i++) {
230 vector<float> q = decalc->findQav(windowsForeachQuery[i], windowSizes[i], probabilityProfile);
234 mothurOut("Done."); mothurOutEndLine();
237 mothurOut("Calculating alpha... "); cout.flush();
238 for (int i = lines[0]->start; i < lines[0]->end; i++) {
239 float alpha = decalc->getCoef(obsDistance[i], Qav[i]);
242 mothurOut("Done."); mothurOutEndLine();
245 mothurOut("Calculating expected distance... "); cout.flush();
246 for (int i = lines[0]->start; i < lines[0]->end; i++) {
247 vector<float> exp = decalc->calcExpected(Qav[i], seqCoef[i]);
248 expectedDistance[i] = exp;
250 mothurOut("Done."); mothurOutEndLine();
253 mothurOut("Finding deviation... "); cout.flush();
254 for (int i = lines[0]->start; i < lines[0]->end; i++) {
255 float de = decalc->calcDE(obsDistance[i], expectedDistance[i]);
258 it = trimmed[i].begin();
259 float dist = decalc->calcDist(querySeqs[i], bestfit[i], it->first, it->second);
262 mothurOut("Done."); mothurOutEndLine();
265 else { createProcesses(); }
267 //quantiles are used to determine whether the de values found indicate a chimera
268 //if you have to calculate them, its time intensive because you are finding the de and deviation values for each
269 //combination of sequences in the template
270 if (quanfile != "") { quantiles = readQuantiles(); }
273 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();
274 if (processors == 1) {
275 quantilesMembers = decalc->getQuantiles(templateSeqs, windowSizesTemplate, window, probabilityProfile, increment, 0, templateSeqs.size());
276 }else { createProcessesQuan(); }
280 string noOutliers, outliers;
282 noOutliers = getRootName(templateFile) + "pintail.quanNOOUTLIERS";
283 outliers = getRootName(templateFile) + "pintail.quanYESOUTLIERS";
285 openOutputFile(outliers, out4);
288 for (int i = 0; i < quantilesMembers.size(); i++) {
291 if (quantilesMembers[i].size() == 0) {
292 //in case this is not a distance found in your template files
293 for (int g = 0; g < 6; g++) {
298 sort(quantilesMembers[i].begin(), quantilesMembers[i].end(), compareQuanMembers);
301 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.10)].score);
303 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.25)].score);
305 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.5)].score);
307 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.75)].score);
309 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.95)].score);
311 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.99)].score);
317 for (int u = 0; u < temp.size(); u++) { out4 << temp[u] << '\t'; }
326 decalc->removeObviousOutliers(quantilesMembers, templateSeqs.size());
328 openOutputFile(noOutliers, out5);
331 for (int i = 0; i < quantilesMembers.size(); i++) {
334 if (quantilesMembers[i].size() == 0) {
335 //in case this is not a distance found in your template files
336 for (int g = 0; g < 6; g++) {
341 sort(quantilesMembers[i].begin(), quantilesMembers[i].end(), compareQuanMembers);
344 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.10)].score);
346 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.25)].score);
348 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.5)].score);
350 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.75)].score);
352 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.95)].score);
354 temp.push_back(quantilesMembers[i][int(quantilesMembers[i].size() * 0.99)].score);
360 for (int u = 0; u < temp.size(); u++) { out5 << temp[u] << '\t'; }
367 mothurOut("Done."); mothurOutEndLine();
372 for (int i = 0; i < lines.size(); i++) { delete lines[i]; }
373 for (int i = 0; i < templateLines.size(); i++) { delete templateLines[i]; }
375 delete distcalculator;
378 catch(exception& e) {
379 errorOut(e, "Pintail", "getChimeras");
384 //***************************************************************************************************************
386 vector<float> Pintail::readFreq() {
390 openInputFile(consfile, in);
393 set<int> h = decalc->getPos(); //positions of bases in masking sequence
395 //read in probabilities and store in vector
402 if (h.count(pos) > 0) {
404 Pi = (num - 0.25) / 0.75;
406 //cannot have probability less than 0.
407 if (Pi < 0) { Pi = 0.0; }
409 //do you want this spot
420 catch(exception& e) {
421 errorOut(e, "Pintail", "readFreq");
426 //***************************************************************************************************************
427 //calculate the distances from each query sequence to all sequences in the template to find the closest sequence
428 vector<Sequence*> Pintail::findPairs(int start, int end) {
431 vector<Sequence*> seqsMatches;
433 for(int i = start; i < end; i++){
435 float smallest = 10000.0;
436 Sequence query = *(querySeqs[i]);
439 for(int j = 0; j < templateSeqs.size(); j++){
441 Sequence temp = *(templateSeqs[j]);
443 distcalculator->calcDist(query, temp);
444 float dist = distcalculator->getDist();
446 if (dist < smallest) {
447 match = templateSeqs[j];
452 //make copy so trimSeqs doesn't overtrim
453 Sequence* copy = new Sequence(match->getName(), match->getAligned());
455 seqsMatches.push_back(copy);
461 catch(exception& e) {
462 errorOut(e, "Pintail", "findPairs");
467 /**************************************************************************************************/
469 void Pintail::createProcessesSpots() {
471 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
473 vector<int> processIDS;
475 //loop through and create all the processes you want
476 while (process != processors) {
480 processIDS.push_back(pid);
484 for (int j = lines[process]->start; j < lines[process]->end; j++) {
486 //chops off beginning and end of sequences so they both start and end with a base
489 decalc->trimSeqs(querySeqs[j], bestfit[j], trim);
494 mothurOut("Finding window breaks for sequences " + toString(lines[process]->start) + " to " + toString(lines[process]->end)); mothurOutEndLine();
495 for (int i = lines[process]->start; i < lines[process]->end; i++) {
496 it = trimmed[i].begin();
497 windowsForeachQuery[i] = decalc->findWindows(querySeqs[i], it->first, it->second, windowSizes[i], increment);
499 mothurOut("Done finding window breaks for sequences " + toString(lines[process]->start) + " to " + toString(lines[process]->end)); mothurOutEndLine();
501 //write out data to file so parent can read it
503 string s = toString(getpid()) + ".temp";
504 openOutputFile(s, out);
506 //output windowsForeachQuery
507 for (int i = lines[process]->start; i < lines[process]->end; i++) {
508 out << windowsForeachQuery[i].size() << '\t';
509 for (int j = 0; j < windowsForeachQuery[i].size(); j++) {
510 out << windowsForeachQuery[i][j] << '\t';
516 for (int i = lines[process]->start; i < lines[process]->end; i++) {
517 out << windowSizes[i] << '\t';
521 //output trimmed values
522 for (int i = lines[process]->start; i < lines[process]->end; i++) {
523 it = trimmed[i].begin();
524 out << it->first << '\t' << it->second << endl;
529 }else { mothurOut("unable to spawn the necessary processes."); mothurOutEndLine(); exit(0); }
532 //force parent to wait until all the processes are done
533 for (int i=0;i<processors;i++) {
534 int temp = processIDS[i];
538 //get data created by processes
539 for (int i=0;i<processors;i++) {
541 string s = toString(processIDS[i]) + ".temp";
542 openInputFile(s, in);
544 int size = lines[i]->end - lines[i]->start;
546 int count = lines[i]->start;
547 for (int m = 0; m < size; m++) {
551 vector<int> win; int w;
552 for (int j = 0; j < num; j++) {
557 windowsForeachQuery[count] = win;
563 count = lines[i]->start;
564 for (int m = 0; m < size; m++) {
568 windowSizes[count] = num;
574 count = lines[i]->start;
575 for (int m = 0; m < size; m++) {
596 for (int j = 0; j < bestfit.size(); j++) {
597 //chops off beginning and end of sequences so they both start and end with a base
598 decalc->trimSeqs(querySeqs[j], bestfit[j], trimmed[j]);
601 for (int i = lines[0]->start; i < lines[0]->end; i++) {
602 it = trimmed[i].begin();
603 vector<int> win = decalc->findWindows(querySeqs[i], it->first, it->second, windowSizes[i], increment);
604 windowsForeachQuery[i] = win;
609 catch(exception& e) {
610 errorOut(e, "Pintail", "createProcessesSpots");
614 /**************************************************************************************************/
616 void Pintail::createProcessesPairs() {
618 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
620 vector<int> processIDS;
622 //loop through and create all the processes you want
623 while (process != processors) {
627 processIDS.push_back(pid);
631 mothurOut("Finding pairs for sequences " + toString(lines[process]->start) + " to " + toString(lines[process]->end)); mothurOutEndLine();
632 bestfit = findPairs(lines[process]->start, lines[process]->end);
633 mothurOut("Done finding pairs for sequences " + toString(lines[process]->start) + " to " + toString(lines[process]->end)); mothurOutEndLine();
635 //write out data to file so parent can read it
637 string s = toString(getpid()) + ".temp";
638 openOutputFile(s, out);
640 //output range and size
641 out << bestfit.size() << endl;
644 for (int i = 0; i < bestfit.size(); i++) {
645 out << ">" << bestfit[i]->getName() << endl << bestfit[i]->getAligned() << endl;
650 }else { mothurOut("unable to spawn the necessary processes."); mothurOutEndLine(); exit(0); }
653 //force parent to wait until all the processes are done
654 for (int i=0;i<processors;i++) {
655 int temp = processIDS[i];
659 //get data created by processes
660 for (int i=0;i<processors;i++) {
662 string s = toString(processIDS[i]) + ".temp";
663 openInputFile(s, in);
666 in >> size; gobble(in);
669 int count = lines[i]->start;
670 for (int m = 0; m < size; m++) {
671 Sequence* temp = new Sequence(in);
672 bestfit[count] = temp;
684 bestfit = findPairs(lines[0]->start, lines[0]->end);
687 catch(exception& e) {
688 errorOut(e, "Pintail", "createProcessesPairs");
692 /**************************************************************************************************/
694 void Pintail::createProcesses() {
696 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
698 vector<int> processIDS;
700 //loop through and create all the processes you want
701 while (process != processors) {
705 processIDS.push_back(pid);
709 mothurOut("Calculating observed, expected and de values for sequences " + toString(lines[process]->start) + " to " + toString(lines[process]->end)); mothurOutEndLine();
710 for (int i = lines[process]->start; i < lines[process]->end; i++) {
712 vector<float> obsi = decalc->calcObserved(querySeqs[i], bestfit[i], windowsForeachQuery[i], windowSizes[i]);
713 obsDistance[i] = obsi;
716 vector<float> q = decalc->findQav(windowsForeachQuery[i], windowSizes[i], probabilityProfile);
719 float alpha = decalc->getCoef(obsDistance[i], q);
722 vector<float> exp = decalc->calcExpected(q, alpha);
723 expectedDistance[i] = exp;
725 //get de and deviation
726 float dei = decalc->calcDE(obsi, exp);
729 it = trimmed[i].begin();
730 float dist = decalc->calcDist(querySeqs[i], bestfit[i], it->first, it->second);
733 mothurOut("Done calculating observed, expected and de values for sequences " + toString(lines[process]->start) + " to " + toString(lines[process]->end)); mothurOutEndLine();
735 //write out data to file so parent can read it
737 string s = toString(getpid()) + ".temp";
738 openOutputFile(s, out);
740 int size = lines[process]->end - lines[process]->start;
743 //output observed distances
744 for (int i = lines[process]->start; i < lines[process]->end; i++) {
745 out << obsDistance[i].size() << '\t';
746 for (int j = 0; j < obsDistance[i].size(); j++) {
747 out << obsDistance[i][j] << '\t';
753 //output expected distances
754 for (int i = lines[process]->start; i < lines[process]->end; i++) {
755 out << expectedDistance[i].size() << '\t';
756 for (int j = 0; j < expectedDistance[i].size(); j++) {
757 out << expectedDistance[i][j] << '\t';
764 for (int i = lines[process]->start; i < lines[process]->end; i++) {
765 out << DE[i] << '\t';
770 for (int i = lines[process]->start; i < lines[process]->end; i++) {
771 out << deviation[i] << '\t';
778 }else { mothurOut("unable to spawn the necessary processes."); mothurOutEndLine(); exit(0); }
781 //force parent to wait until all the processes are done
782 for (int i=0;i<processors;i++) {
783 int temp = processIDS[i];
787 //get data created by processes
788 for (int i=0;i<processors;i++) {
790 string s = toString(processIDS[i]) + ".temp";
791 openInputFile(s, in);
794 in >> size; gobble(in);
796 //get observed distances
797 int count = lines[i]->start;
798 for (int m = 0; m < size; m++) {
802 vector<float> obs; float w;
803 for (int j = 0; j < num; j++) {
808 obsDistance[count] = obs;
815 //get expected distances
816 count = lines[i]->start;
817 for (int m = 0; m < size; m++) {
821 vector<float> exp; float w;
822 for (int j = 0; j < num; j++) {
827 expectedDistance[count] = exp;
834 count = lines[i]->start;
835 for (int m = 0; m < size; m++) {
845 count = lines[i]->start;
846 for (int m = 0; m < size; m++) {
850 deviation[count] = num;
860 mothurOut("Calculating observed distance... "); cout.flush();
861 for (int i = lines[0]->start; i < lines[0]->end; i++) {
862 vector<float> obsi = decalc->calcObserved(querySeqs[i], bestfit[i], windowsForeachQuery[i], windowSizes[i]);
863 obsDistance[i] = obsi;
865 mothurOut("Done."); mothurOutEndLine();
869 mothurOut("Finding variability... "); cout.flush();
870 for (int i = lines[0]->start; i < lines[0]->end; i++) {
871 vector<float> q = decalc->findQav(windowsForeachQuery[i], windowSizes[i], probabilityProfile);
874 mothurOut("Done."); mothurOutEndLine();
878 mothurOut("Calculating alpha... "); cout.flush();
879 for (int i = lines[0]->start; i < lines[0]->end; i++) {
880 float alpha = decalc->getCoef(obsDistance[i], Qav[i]);
881 seqCoef.push_back(alpha);
883 mothurOut("Done."); mothurOutEndLine();
887 mothurOut("Calculating expected distance... "); cout.flush();
888 for (int i = lines[0]->start; i < lines[0]->end; i++) {
889 vector<float> exp = decalc->calcExpected(Qav[i], seqCoef[i]);
890 expectedDistance[i] = exp;
892 mothurOut("Done."); mothurOutEndLine();
896 mothurOut("Finding deviation... "); cout.flush();
897 for (int i = lines[0]->start; i < lines[0]->end; i++) {
898 float de = decalc->calcDE(obsDistance[i], expectedDistance[i]);
901 it = trimmed[i].begin();
902 float dist = decalc->calcDist(querySeqs[i], bestfit[i], it->first, it->second);
905 mothurOut("Done."); mothurOutEndLine();
909 catch(exception& e) {
910 errorOut(e, "Pintail", "createProcesses");
916 /**************************************************************************************************/
918 void Pintail::createProcessesQuan() {
920 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
922 vector<int> processIDS;
924 //loop through and create all the processes you want
925 while (process != processors) {
929 processIDS.push_back(pid);
933 quantilesMembers = decalc->getQuantiles(templateSeqs, windowSizesTemplate, window, probabilityProfile, increment, templateLines[process]->start, templateLines[process]->end);
935 //write out data to file so parent can read it
937 string s = toString(getpid()) + ".temp";
938 openOutputFile(s, out);
941 //output observed distances
942 for (int i = 0; i < quantilesMembers.size(); i++) {
943 out << quantilesMembers[i].size() << '\t';
944 for (int j = 0; j < quantilesMembers[i].size(); j++) {
945 out << quantilesMembers[i][j].score << '\t' << quantilesMembers[i][j].member1 << '\t' << quantilesMembers[i][j].member2 << '\t';
953 }else { mothurOut("unable to spawn the necessary processes."); mothurOutEndLine(); exit(0); }
956 //force parent to wait until all the processes are done
957 for (int i=0;i<processors;i++) {
958 int temp = processIDS[i];
962 //get data created by processes
963 for (int i=0;i<processors;i++) {
965 string s = toString(processIDS[i]) + ".temp";
966 openInputFile(s, in);
968 vector< vector<quanMember> > quan;
972 for (int m = 0; m < quan.size(); m++) {
978 vector<quanMember> q; float w; int b, n;
979 for (int j = 0; j < num; j++) {
981 //cout << w << '\t' << b << '\t' n << endl;
982 quanMember newMember(w, b, n);
983 q.push_back(newMember);
985 //cout << "here" << endl;
987 //cout << "now here" << endl;
992 //save quan in quantiles
993 for (int j = 0; j < quan.size(); j++) {
994 //put all values of q[i] into quan[i]
995 for (int l = 0; l < quan[j].size(); l++) { quantilesMembers[j].push_back(quan[j][l]); }
996 //quantilesMembers[j].insert(quantilesMembers[j].begin(), quan[j].begin(), quan[j].end());
1004 quantilesMembers = decalc->getQuantiles(templateSeqs, windowSizesTemplate, window, probabilityProfile, increment, 0, templateSeqs.size());
1007 catch(exception& e) {
1008 errorOut(e, "Pintail", "createProcessesQuan");
1014 //***************************************************************************************************************