- distcalculator = new eachGapDist();
-
- if (processors == 1) {
- mothurOut("Finding closest sequence in template to each sequence... "); cout.flush();
- bestfit = findPairs(lines[0]->start, lines[0]->end);
-for (int m = 0; m < templateSeqs.size(); m++) {
- if (templateSeqs[m]->getName() == "198806") { bestfit[0] = *(templateSeqs[m]); }
- if (templateSeqs[m]->getName() == "198806") { bestfit[1] = *(templateSeqs[m]); }
- if (templateSeqs[m]->getName() == "108139") { bestfit[2] = *(templateSeqs[m]); }
-}
-
-for (int j = 0; j < bestfit.size(); j++) {//cout << querySeqs[j]->getName() << '\t' << "length = " << querySeqs[j]->getAligned().length() << '\t' << bestfit[j].getName() << " length = " << bestfit[j].getAligned().length() << endl;
- //chops off beginning and end of sequences so they both start and end with a base
- trimSeqs(querySeqs[j], bestfit[j], j);
-//cout << "NEW SEQ PAIR" << querySeqs[j]->getAligned() << endl << "IN THE MIDDLE" << endl << bestfit[j].getAligned() << endl;
-
-}
-
- mothurOut("Done."); mothurOutEndLine();
-
- windows = findWindows(lines[0]->start, lines[0]->end);
- } else { createProcessesSpots(); }
-
- //find P
- if (consfile == "") { probabilityProfile = calcFreq(templateSeqs); }
- else { probabilityProfile = readFreq(); }
+ m->mothurOut("Getting conservation... "); cout.flush();
+ if (consfile == "") {
+ m->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();
+ probabilityProfile = decalc->calcFreq(templateSeqs, templateFileName);
+ if (m->control_pressed) { return 0; }
+ m->mothurOut("Done."); m->mothurOutEndLine();
+ }else { probabilityProfile = readFreq(); m->mothurOut("Done."); }
+ m->mothurOutEndLine();