2 * matrixoutputcommand.cpp
5 * Created by Sarah Westcott on 5/20/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "matrixoutputcommand.h"
12 //**********************************************************************************************************************
13 vector<string> MatrixOutputCommand::setParameters(){
15 CommandParameter pshared("shared", "InputTypes", "", "", "none", "none", "none",false,true); parameters.push_back(pshared);
16 CommandParameter plabel("label", "String", "", "", "", "", "",false,false); parameters.push_back(plabel);
17 CommandParameter pgroups("groups", "String", "", "", "", "", "",false,false); parameters.push_back(pgroups);
18 CommandParameter pcalc("calc", "Multiple", "sharedsobs-sharedchao-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan-kstest-sharednseqs-ochiai-anderberg-kulczynski-kulczynskicody-lennon-morisitahorn-braycurtis-whittaker-odum-canberra-structeuclidean-structchord-hellinger-manhattan-structpearson-soergel-spearman-structkulczynski-speciesprofile-hamming-structchi2-gower-memchi2-memchord-memeuclidean-mempearson", "jclass-thetayc", "", "", "",true,false); parameters.push_back(pcalc);
19 CommandParameter poutput("output", "Multiple", "lt-square", "lt", "", "", "",false,false); parameters.push_back(poutput);
20 CommandParameter pprocessors("processors", "Number", "", "1", "", "", "",false,false); parameters.push_back(pprocessors);
21 CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir);
22 CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir);
24 vector<string> myArray;
25 for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); }
29 m->errorOut(e, "MatrixOutputCommand", "setParameters");
33 //**********************************************************************************************************************
34 string MatrixOutputCommand::getHelpString(){
36 string helpString = "";
37 ValidCalculators validCalculator;
38 helpString += "The dist.shared command parameters are shared, groups, calc, output, processors and label. shared is a required, unless you have a valid current file.\n";
39 helpString += "The groups parameter allows you to specify which of the groups in your groupfile you would like included used.\n";
40 helpString += "The group names are separated by dashes. The label parameter allows you to select what distance levels you would like distance matrices created for, and is also separated by dashes.\n";
41 helpString += "The dist.shared command should be in the following format: dist.shared(groups=yourGroups, calc=yourCalcs, label=yourLabels).\n";
42 helpString += "The output parameter allows you to specify format of your distance matrix. Options are lt, and square. The default is lt.\n";
43 helpString += "Example dist.shared(groups=A-B-C, calc=jabund-sorabund).\n";
44 helpString += "The default value for groups is all the groups in your groupfile.\n";
45 helpString += "The default value for calc is jclass and thetayc.\n";
46 helpString += validCalculator.printCalc("matrix");
47 helpString += "The dist.shared command outputs a .dist file for each calculator you specify at each distance you choose.\n";
48 helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n";
52 m->errorOut(e, "MatrixOutputCommand", "getHelpString");
56 //**********************************************************************************************************************
57 MatrixOutputCommand::MatrixOutputCommand(){
59 abort = true; calledHelp = true;
61 vector<string> tempOutNames;
62 outputTypes["phylip"] = tempOutNames;
65 m->errorOut(e, "MatrixOutputCommand", "MatrixOutputCommand");
69 //**********************************************************************************************************************
71 MatrixOutputCommand::MatrixOutputCommand(string option) {
73 abort = false; calledHelp = false;
76 //allow user to run help
77 if(option == "help") { help(); abort = true; calledHelp = true; }
78 else if(option == "citation") { citation(); abort = true; calledHelp = true;}
81 vector<string> myArray = setParameters();
83 OptionParser parser(option);
84 map<string,string> parameters = parser.getParameters();
85 map<string,string>::iterator it;
87 ValidParameters validParameter;
89 //check to make sure all parameters are valid for command
90 for (it = parameters.begin(); it != parameters.end(); it++) {
91 if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; }
94 //initialize outputTypes
95 vector<string> tempOutNames;
96 outputTypes["phylip"] = tempOutNames;
98 //if the user changes the input directory command factory will send this info to us in the output parameter
99 string inputDir = validParameter.validFile(parameters, "inputdir", false);
100 if (inputDir == "not found"){ inputDir = ""; }
103 it = parameters.find("shared");
104 //user has given a template file
105 if(it != parameters.end()){
106 path = m->hasPath(it->second);
107 //if the user has not given a path then, add inputdir. else leave path alone.
108 if (path == "") { parameters["shared"] = inputDir + it->second; }
112 sharedfile = validParameter.validFile(parameters, "shared", true);
113 if (sharedfile == "not found") {
114 //if there is a current shared file, use it
115 sharedfile = m->getSharedFile();
116 if (sharedfile != "") { m->mothurOut("Using " + sharedfile + " as input file for the shared parameter."); m->mothurOutEndLine(); }
117 else { m->mothurOut("You have no current sharedfile and the shared parameter is required."); m->mothurOutEndLine(); abort = true; }
118 }else if (sharedfile == "not open") { sharedfile = ""; abort = true; }
119 else { m->setSharedFile(sharedfile); }
121 //if the user changes the output directory command factory will send this info to us in the output parameter
122 outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){
124 outputDir += m->hasPath(sharedfile); //if user entered a file with a path then preserve it
127 //check for optional parameter and set defaults
128 // ...at some point should added some additional type checking...
129 label = validParameter.validFile(parameters, "label", false);
130 if (label == "not found") { label = ""; }
132 if(label != "all") { m->splitAtDash(label, labels); allLines = 0; }
133 else { allLines = 1; }
136 output = validParameter.validFile(parameters, "output", false); if(output == "not found"){ output = "lt"; }
137 if ((output != "lt") && (output != "square")) { m->mothurOut(output + " is not a valid output form. Options are lt and square. I will use lt."); m->mothurOutEndLine(); output = "lt"; }
139 groups = validParameter.validFile(parameters, "groups", false);
140 if (groups == "not found") { groups = ""; }
142 m->splitAtDash(groups, Groups);
143 m->setGroups(Groups);
146 string temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); }
147 m->setProcessors(temp);
148 m->mothurConvert(temp, processors);
150 calc = validParameter.validFile(parameters, "calc", false);
151 if (calc == "not found") { calc = "jclass-thetayc"; }
153 if (calc == "default") { calc = "jclass-thetayc"; }
155 m->splitAtDash(calc, Estimators);
156 if (m->inUsersGroups("citation", Estimators)) {
157 ValidCalculators validCalc; validCalc.printCitations(Estimators);
158 //remove citation from list of calcs
159 for (int i = 0; i < Estimators.size(); i++) { if (Estimators[i] == "citation") { Estimators.erase(Estimators.begin()+i); break; } }
162 if (abort == false) {
164 ValidCalculators validCalculator;
167 for (i=0; i<Estimators.size(); i++) {
168 if (validCalculator.isValidCalculator("matrix", Estimators[i]) == true) {
169 if (Estimators[i] == "sharedsobs") {
170 matrixCalculators.push_back(new SharedSobsCS());
171 }else if (Estimators[i] == "sharedchao") {
172 matrixCalculators.push_back(new SharedChao1());
173 }else if (Estimators[i] == "sharedace") {
174 matrixCalculators.push_back(new SharedAce());
175 }else if (Estimators[i] == "jabund") {
176 matrixCalculators.push_back(new JAbund());
177 }else if (Estimators[i] == "sorabund") {
178 matrixCalculators.push_back(new SorAbund());
179 }else if (Estimators[i] == "jclass") {
180 matrixCalculators.push_back(new Jclass());
181 }else if (Estimators[i] == "sorclass") {
182 matrixCalculators.push_back(new SorClass());
183 }else if (Estimators[i] == "jest") {
184 matrixCalculators.push_back(new Jest());
185 }else if (Estimators[i] == "sorest") {
186 matrixCalculators.push_back(new SorEst());
187 }else if (Estimators[i] == "thetayc") {
188 matrixCalculators.push_back(new ThetaYC());
189 }else if (Estimators[i] == "thetan") {
190 matrixCalculators.push_back(new ThetaN());
191 }else if (Estimators[i] == "kstest") {
192 matrixCalculators.push_back(new KSTest());
193 }else if (Estimators[i] == "sharednseqs") {
194 matrixCalculators.push_back(new SharedNSeqs());
195 }else if (Estimators[i] == "ochiai") {
196 matrixCalculators.push_back(new Ochiai());
197 }else if (Estimators[i] == "anderberg") {
198 matrixCalculators.push_back(new Anderberg());
199 }else if (Estimators[i] == "kulczynski") {
200 matrixCalculators.push_back(new Kulczynski());
201 }else if (Estimators[i] == "kulczynskicody") {
202 matrixCalculators.push_back(new KulczynskiCody());
203 }else if (Estimators[i] == "lennon") {
204 matrixCalculators.push_back(new Lennon());
205 }else if (Estimators[i] == "morisitahorn") {
206 matrixCalculators.push_back(new MorHorn());
207 }else if (Estimators[i] == "braycurtis") {
208 matrixCalculators.push_back(new BrayCurtis());
209 }else if (Estimators[i] == "whittaker") {
210 matrixCalculators.push_back(new Whittaker());
211 }else if (Estimators[i] == "odum") {
212 matrixCalculators.push_back(new Odum());
213 }else if (Estimators[i] == "canberra") {
214 matrixCalculators.push_back(new Canberra());
215 }else if (Estimators[i] == "structeuclidean") {
216 matrixCalculators.push_back(new StructEuclidean());
217 }else if (Estimators[i] == "structchord") {
218 matrixCalculators.push_back(new StructChord());
219 }else if (Estimators[i] == "hellinger") {
220 matrixCalculators.push_back(new Hellinger());
221 }else if (Estimators[i] == "manhattan") {
222 matrixCalculators.push_back(new Manhattan());
223 }else if (Estimators[i] == "structpearson") {
224 matrixCalculators.push_back(new StructPearson());
225 }else if (Estimators[i] == "soergel") {
226 matrixCalculators.push_back(new Soergel());
227 }else if (Estimators[i] == "spearman") {
228 matrixCalculators.push_back(new Spearman());
229 }else if (Estimators[i] == "structkulczynski") {
230 matrixCalculators.push_back(new StructKulczynski());
231 }else if (Estimators[i] == "speciesprofile") {
232 matrixCalculators.push_back(new SpeciesProfile());
233 }else if (Estimators[i] == "hamming") {
234 matrixCalculators.push_back(new Hamming());
235 }else if (Estimators[i] == "structchi2") {
236 matrixCalculators.push_back(new StructChi2());
237 }else if (Estimators[i] == "gower") {
238 matrixCalculators.push_back(new Gower());
239 }else if (Estimators[i] == "memchi2") {
240 matrixCalculators.push_back(new MemChi2());
241 }else if (Estimators[i] == "memchord") {
242 matrixCalculators.push_back(new MemChord());
243 }else if (Estimators[i] == "memeuclidean") {
244 matrixCalculators.push_back(new MemEuclidean());
245 }else if (Estimators[i] == "mempearson") {
246 matrixCalculators.push_back(new MemPearson());
255 catch(exception& e) {
256 m->errorOut(e, "MatrixOutputCommand", "MatrixOutputCommand");
261 //**********************************************************************************************************************
263 MatrixOutputCommand::~MatrixOutputCommand(){}
265 //**********************************************************************************************************************
267 int MatrixOutputCommand::execute(){
270 if (abort == true) { if (calledHelp) { return 0; } return 2; }
272 //if the users entered no valid calculators don't execute command
273 if (matrixCalculators.size() == 0) { m->mothurOut("No valid calculators."); m->mothurOutEndLine(); return 0; }
275 input = new InputData(sharedfile, "sharedfile");
276 lookup = input->getSharedRAbundVectors();
277 string lastLabel = lookup[0]->getLabel();
279 //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
280 set<string> processedLabels;
281 set<string> userLabels = labels;
283 if (lookup.size() < 2) { m->mothurOut("You have not provided enough valid groups. I cannot run the command."); m->mothurOutEndLine(); delete input; for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } return 0;}
285 numGroups = lookup.size();
286 lines.resize(processors);
287 for (int i = 0; i < processors; i++) {
288 lines[i].start = int (sqrt(float(i)/float(processors)) * numGroups);
289 lines[i].end = int (sqrt(float(i+1)/float(processors)) * numGroups);
292 if (m->control_pressed) { delete input; for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } m->clearGroups(); return 0; }
294 //as long as you are not at the end of the file or done wih the lines you want
295 while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
297 if (m->control_pressed) { outputTypes.clear(); delete input; for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } m->clearGroups(); return 0; }
299 if(allLines == 1 || labels.count(lookup[0]->getLabel()) == 1){
300 m->mothurOut(lookup[0]->getLabel()); m->mothurOutEndLine();
303 processedLabels.insert(lookup[0]->getLabel());
304 userLabels.erase(lookup[0]->getLabel());
307 if ((m->anyLabelsToProcess(lookup[0]->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
308 string saveLabel = lookup[0]->getLabel();
310 for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; }
311 lookup = input->getSharedRAbundVectors(lastLabel);
313 m->mothurOut(lookup[0]->getLabel()); m->mothurOutEndLine();
316 processedLabels.insert(lookup[0]->getLabel());
317 userLabels.erase(lookup[0]->getLabel());
319 //restore real lastlabel to save below
320 lookup[0]->setLabel(saveLabel);
323 lastLabel = lookup[0]->getLabel();
325 //get next line to process
326 for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; }
327 lookup = input->getSharedRAbundVectors();
330 if (m->control_pressed) { outputTypes.clear(); delete input; for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } m->clearGroups(); return 0; }
332 //output error messages about any remaining user labels
333 set<string>::iterator it;
334 bool needToRun = false;
335 for (it = userLabels.begin(); it != userLabels.end(); it++) {
336 m->mothurOut("Your file does not include the label " + *it);
337 if (processedLabels.count(lastLabel) != 1) {
338 m->mothurOut(". I will use " + lastLabel + "."); m->mothurOutEndLine();
341 m->mothurOut(". Please refer to " + lastLabel + "."); m->mothurOutEndLine();
345 if (m->control_pressed) { outputTypes.clear(); delete input; for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } m->clearGroups(); return 0; }
347 //run last label if you need to
348 if (needToRun == true) {
349 for (int i = 0; i < lookup.size(); i++) { if (lookup[i] != NULL) { delete lookup[i]; } }
350 lookup = input->getSharedRAbundVectors(lastLabel);
352 m->mothurOut(lookup[0]->getLabel()); m->mothurOutEndLine();
354 for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; }
357 if (m->control_pressed) { outputTypes.clear(); delete input; for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } m->clearGroups(); return 0; }
359 //reset groups parameter
362 //set phylip file as new current phylipfile
364 itTypes = outputTypes.find("phylip");
365 if (itTypes != outputTypes.end()) {
366 if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setPhylipFile(current); }
369 m->mothurOutEndLine();
370 m->mothurOut("Output File Names: "); m->mothurOutEndLine();
371 for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); }
372 m->mothurOutEndLine();
377 catch(exception& e) {
378 m->errorOut(e, "MatrixOutputCommand", "execute");
382 /***********************************************************/
383 void MatrixOutputCommand::printSims(ostream& out, vector< vector<float> >& simMatrix) {
386 out.setf(ios::fixed, ios::floatfield); out.setf(ios::showpoint);
389 out << simMatrix.size() << endl;
391 if (output == "lt") {
392 for (int m = 0; m < simMatrix.size(); m++) {
393 out << lookup[m]->getGroup() << '\t';
394 for (int n = 0; n < m; n++) {
395 out << simMatrix[m][n] << '\t';
400 for (int m = 0; m < simMatrix.size(); m++) {
401 out << lookup[m]->getGroup() << '\t';
402 for (int n = 0; n < simMatrix[m].size(); n++) {
403 out << simMatrix[m][n] << '\t';
409 catch(exception& e) {
410 m->errorOut(e, "MatrixOutputCommand", "printSims");
414 /***********************************************************/
415 int MatrixOutputCommand::process(vector<SharedRAbundVector*> thisLookup){
418 vector<SharedRAbundVector*> subset;
419 vector< vector<seqDist> > calcDists; calcDists.resize(matrixCalculators.size()); //one for each calc, this will be used to make .dist files
423 driver(thisLookup, 0, numGroups, calcDists);
426 vector<int> processIDS;
428 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
429 //loop through and create all the processes you want
430 while (process != processors) {
434 processIDS.push_back(pid);
437 driver(thisLookup, lines[process].start, lines[process].end, calcDists);
439 string tempdistFileName = m->getRootName(m->getSimpleName(sharedfile)) + toString(getpid()) + ".dist";
441 m->openOutputFile(tempdistFileName, outtemp);
443 for (int i = 0; i < calcDists.size(); i++) {
444 outtemp << calcDists[i].size() << endl;
446 for (int j = 0; j < calcDists[i].size(); j++) {
447 outtemp << calcDists[i][j].seq1 << '\t' << calcDists[i][j].seq2 << '\t' << calcDists[i][j].dist << endl;
454 m->mothurOut("[ERROR]: unable to spawn the necessary processes."); m->mothurOutEndLine();
455 for (int i = 0; i < processIDS.size(); i++) { kill (processIDS[i], SIGINT); }
460 //parent do your part
461 driver(thisLookup, lines[0].start, lines[0].end, calcDists);
463 //force parent to wait until all the processes are done
464 for (int i = 0; i < processIDS.size(); i++) {
465 int temp = processIDS[i];
469 for (int i = 0; i < processIDS.size(); i++) {
470 string tempdistFileName = m->getRootName(m->getSimpleName(sharedfile)) + toString(processIDS[i]) + ".dist";
472 m->openInputFile(tempdistFileName, intemp);
474 for (int k = 0; k < calcDists.size(); k++) {
476 intemp >> size; m->gobble(intemp);
478 for (int j = 0; j < size; j++) {
483 intemp >> seq1 >> seq2 >> dist; m->gobble(intemp);
485 seqDist tempDist(seq1, seq2, dist);
486 calcDists[k].push_back(tempDist);
490 m->mothurRemove(tempdistFileName);
493 //////////////////////////////////////////////////////////////////////////////////////////////////////
494 //Windows version shared memory, so be careful when passing variables through the distSharedData struct.
495 //Above fork() will clone, so memory is separate, but that's not the case with windows,
496 //Taking advantage of shared memory to pass results vectors.
497 //////////////////////////////////////////////////////////////////////////////////////////////////////
499 vector<distSharedData*> pDataArray;
500 DWORD dwThreadIdArray[processors-1];
501 HANDLE hThreadArray[processors-1];
503 //Create processor worker threads.
504 for( int i=1; i<processors; i++ ){
506 //make copy of lookup so we don't get access violations
507 vector<SharedRAbundVector*> newLookup;
508 for (int k = 0; k < thisLookup.size(); k++) {
509 SharedRAbundVector* temp = new SharedRAbundVector();
510 temp->setLabel(thisLookup[k]->getLabel());
511 temp->setGroup(thisLookup[k]->getGroup());
512 newLookup.push_back(temp);
516 for (int k = 0; k < thisLookup[0]->getNumBins(); k++) {
517 if (m->control_pressed) { for (int j = 0; j < newLookup.size(); j++) { delete newLookup[j]; } return 0; }
518 for (int j = 0; j < thisLookup.size(); j++) { newLookup[j]->push_back(thisLookup[j]->getAbundance(k), thisLookup[j]->getGroup()); }
521 // Allocate memory for thread data.
522 distSharedData* tempSum = new distSharedData(m, lines[i].start, lines[i].end, Estimators, newLookup);
523 pDataArray.push_back(tempSum);
524 processIDS.push_back(i);
526 hThreadArray[i-1] = CreateThread(NULL, 0, MyDistSharedThreadFunction, pDataArray[i-1], 0, &dwThreadIdArray[i-1]);
529 //parent do your part
530 driver(thisLookup, lines[0].start, lines[0].end, calcDists);
532 //Wait until all threads have terminated.
533 WaitForMultipleObjects(processors-1, hThreadArray, TRUE, INFINITE);
535 //Close all thread handles and free memory allocations.
536 for(int i=0; i < pDataArray.size(); i++){
537 for (int j = 0; j < pDataArray[i]->thisLookup.size(); j++) { delete pDataArray[i]->thisLookup[j]; }
539 for (int k = 0; k < calcDists.size(); k++) {
540 int size = pDataArray[i]->calcDists[k].size();
541 for (int j = 0; j < size; j++) { calcDists[k].push_back(pDataArray[i]->calcDists[k][j]); }
544 CloseHandle(hThreadArray[i]);
545 delete pDataArray[i];
553 for (int i = 0; i < calcDists.size(); i++) {
554 if (m->control_pressed) { break; }
557 vector< vector<float> > matrix; //square matrix to represent the distance
558 matrix.resize(thisLookup.size());
559 for (int k = 0; k < thisLookup.size(); k++) { matrix[k].resize(thisLookup.size(), 0.0); }
561 for (int j = 0; j < calcDists[i].size(); j++) {
562 int row = calcDists[i][j].seq1;
563 int column = calcDists[i][j].seq2;
564 float dist = calcDists[i][j].dist;
566 matrix[row][column] = dist;
567 matrix[column][row] = dist;
570 string distFileName = outputDir + m->getRootName(m->getSimpleName(sharedfile)) + matrixCalculators[i]->getName() + "." + thisLookup[0]->getLabel() + "." + output + ".dist";
571 outputNames.push_back(distFileName); outputTypes["phylip"].push_back(distFileName);
573 m->openOutputFile(distFileName, outDist);
574 outDist.setf(ios::fixed, ios::floatfield); outDist.setf(ios::showpoint);
576 printSims(outDist, matrix);
583 catch(exception& e) {
584 m->errorOut(e, "MatrixOutputCommand", "process");
588 /**************************************************************************************************/
589 int MatrixOutputCommand::driver(vector<SharedRAbundVector*> thisLookup, int start, int end, vector< vector<seqDist> >& calcDists) {
592 vector<SharedRAbundVector*> subset;
593 for (int k = start; k < end; k++) { // pass cdd each set of groups to compare
595 for (int l = 0; l < k; l++) {
597 if (k != l) { //we dont need to similiarity of a groups to itself
598 subset.clear(); //clear out old pair of sharedrabunds
599 //add new pair of sharedrabunds
600 subset.push_back(thisLookup[k]); subset.push_back(thisLookup[l]);
602 for(int i=0;i<matrixCalculators.size();i++) {
604 //if this calc needs all groups to calculate the pair load all groups
605 if (matrixCalculators[i]->getNeedsAll()) {
606 //load subset with rest of lookup for those calcs that need everyone to calc for a pair
607 for (int w = 0; w < thisLookup.size(); w++) {
608 if ((w != k) && (w != l)) { subset.push_back(thisLookup[w]); }
612 vector<double> tempdata = matrixCalculators[i]->getValues(subset); //saves the calculator outputs
614 if (m->control_pressed) { return 1; }
616 seqDist temp(l, k, tempdata[0]);
617 calcDists[i].push_back(temp);
625 catch(exception& e) {
626 m->errorOut(e, "MatrixOutputCommand", "driver");
630 /***********************************************************/