5 * Created by Sarah Westcott on 1/2/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "collectcommand.h"
15 #include "bootstrap.h"
17 #include "simpsoneven.h"
18 #include "invsimpson.h"
19 #include "npshannon.h"
21 #include "smithwilson.h"
23 #include "shannoneven.h"
24 #include "jackknife.h"
28 #include "bergerparker.h"
30 #include "goodscoverage.h"
37 //**********************************************************************************************************************
38 vector<string> CollectCommand::getValidParameters(){
40 string AlignArray[] = {"freq","label","calc","abund","size","outputdir","inputdir"};
41 vector<string> myArray (AlignArray, AlignArray+(sizeof(AlignArray)/sizeof(string)));
45 m->errorOut(e, "CollectCommand", "getValidParameters");
49 //**********************************************************************************************************************
50 vector<string> CollectCommand::getRequiredParameters(){
52 vector<string> myArray;
56 m->errorOut(e, "CollectCommand", "getRequiredParameters");
60 //**********************************************************************************************************************
61 vector<string> CollectCommand::getRequiredFiles(){
63 string AlignArray[] = {"shared","list","rabund","sabund","or"};
64 vector<string> myArray (AlignArray, AlignArray+(sizeof(AlignArray)/sizeof(string)));
68 m->errorOut(e, "CollectCommand", "getRequiredFiles");
72 //**********************************************************************************************************************
73 CollectCommand::CollectCommand(){
76 //initialize outputTypes
77 vector<string> tempOutNames;
78 outputTypes["sobs"] = tempOutNames;
79 outputTypes["chao"] = tempOutNames;
80 outputTypes["nseqs"] = tempOutNames;
81 outputTypes["coverage"] = tempOutNames;
82 outputTypes["ace"] = tempOutNames;
83 outputTypes["jack"] = tempOutNames;
84 outputTypes["shannon"] = tempOutNames;
85 outputTypes["shannoneven"] = tempOutNames;
86 outputTypes["np_shannon"] = tempOutNames;
87 outputTypes["heip"] = tempOutNames;
88 outputTypes["smithwilson"] = tempOutNames;
89 outputTypes["simpson"] = tempOutNames;
90 outputTypes["simpsoneven"] = tempOutNames;
91 outputTypes["invsimpson"] = tempOutNames;
92 outputTypes["bootstrap"] = tempOutNames;
93 outputTypes["geometric"] = tempOutNames;
94 outputTypes["qstat"] = tempOutNames;
95 outputTypes["logseries"] = tempOutNames;
96 outputTypes["bergerparker"] = tempOutNames;
97 outputTypes["bstick"] = tempOutNames;
98 outputTypes["goodscoverage"] = tempOutNames;
99 outputTypes["efron"] = tempOutNames;
100 outputTypes["boneh"] = tempOutNames;
101 outputTypes["solow"] = tempOutNames;
102 outputTypes["shen"] = tempOutNames;
104 catch(exception& e) {
105 m->errorOut(e, "CollectCommand", "CollectCommand");
109 //**********************************************************************************************************************
110 CollectCommand::CollectCommand(string option) {
112 globaldata = GlobalData::getInstance();
118 //allow user to run help
119 if(option == "help") { validCalculator = new ValidCalculators(); help(); delete validCalculator; abort = true; }
122 //valid paramters for this command
123 string Array[] = {"freq","label","calc","abund","size","outputdir","inputdir"};
124 vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
126 OptionParser parser(option);
127 map<string,string> parameters = parser.getParameters();
129 ValidParameters validParameter;
131 //check to make sure all parameters are valid for command
132 for (map<string,string>::iterator it = parameters.begin(); it != parameters.end(); it++) {
133 if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; }
136 //initialize outputTypes
137 vector<string> tempOutNames;
138 outputTypes["sobs"] = tempOutNames;
139 outputTypes["chao"] = tempOutNames;
140 outputTypes["nseqs"] = tempOutNames;
141 outputTypes["coverage"] = tempOutNames;
142 outputTypes["ace"] = tempOutNames;
143 outputTypes["jack"] = tempOutNames;
144 outputTypes["shannon"] = tempOutNames;
145 outputTypes["shannoneven"] = tempOutNames;
146 outputTypes["np_shannon"] = tempOutNames;
147 outputTypes["heip"] = tempOutNames;
148 outputTypes["smithwilson"] = tempOutNames;
149 outputTypes["simpson"] = tempOutNames;
150 outputTypes["simpsoneven"] = tempOutNames;
151 outputTypes["invsimpson"] = tempOutNames;
152 outputTypes["bootstrap"] = tempOutNames;
153 outputTypes["geometric"] = tempOutNames;
154 outputTypes["qstat"] = tempOutNames;
155 outputTypes["logseries"] = tempOutNames;
156 outputTypes["bergerparker"] = tempOutNames;
157 outputTypes["bstick"] = tempOutNames;
158 outputTypes["goodscoverage"] = tempOutNames;
159 outputTypes["efron"] = tempOutNames;
160 outputTypes["boneh"] = tempOutNames;
161 outputTypes["solow"] = tempOutNames;
162 outputTypes["shen"] = tempOutNames;
164 //if the user changes the output directory command factory will send this info to us in the output parameter
165 outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = ""; }
167 //make sure the user has already run the read.otu command
168 if ((globaldata->getSharedFile() == "") && (globaldata->getListFile() == "") && (globaldata->getRabundFile() == "") && (globaldata->getSabundFile() == "")) { m->mothurOut("You must read a list, sabund, rabund or shared file before you can use the collect.single command."); m->mothurOutEndLine(); abort = true; }
170 //check for optional parameter and set defaults
171 // ...at some point should added some additional type checking...
172 label = validParameter.validFile(parameters, "label", false);
173 if (label == "not found") { label = ""; }
175 if(label != "all") { m->splitAtDash(label, labels); allLines = 0; }
176 else { allLines = 1; }
179 //if the user has not specified any labels use the ones from read.otu
181 allLines = globaldata->allLines;
182 labels = globaldata->labels;
185 calc = validParameter.validFile(parameters, "calc", false);
186 if (calc == "not found") { calc = "sobs-chao-ace-jack-shannon-npshannon-simpson"; }
188 if (calc == "default") { calc = "sobs-chao-ace-jack-shannon-npshannon-simpson"; }
190 m->splitAtDash(calc, Estimators);
193 temp = validParameter.validFile(parameters, "freq", false); if (temp == "not found") { temp = "100"; }
196 temp = validParameter.validFile(parameters, "abund", false); if (temp == "not found") { temp = "10"; }
197 convert(temp, abund);
199 temp = validParameter.validFile(parameters, "size", false); if (temp == "not found") { temp = "0"; }
204 catch(exception& e) {
205 m->errorOut(e, "CollectCommand", "CollectCommand");
209 //**********************************************************************************************************************
211 void CollectCommand::help(){
213 m->mothurOut("The collect.single command can only be executed after a successful read.otu command. WITH ONE EXECEPTION. \n");
214 m->mothurOut("The collect.single command can be executed after a successful cluster command. It will use the .list file from the output of the cluster.\n");
215 m->mothurOut("The collect.single command parameters are label, freq, calc and abund. No parameters are required. \n");
216 m->mothurOut("The collect.single command should be in the following format: \n");
217 m->mothurOut("The freq parameter is used indicate when to output your data, by default it is set to 100. But you can set it to a percentage of the number of sequence. For example freq=0.10, means 10%. \n");
218 m->mothurOut("collect.single(label=yourLabel, iters=yourIters, freq=yourFreq, calc=yourEstimators).\n");
219 m->mothurOut("Example collect(label=unique-.01-.03, iters=10000, freq=10, calc=sobs-chao-ace-jack).\n");
220 m->mothurOut("The default values for freq is 100, and calc are sobs-chao-ace-jack-shannon-npshannon-simpson.\n");
221 validCalculator->printCalc("single", cout);
222 m->mothurOut("The label parameter is used to analyze specific labels in your input.\n");
223 m->mothurOut("Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n\n");
225 catch(exception& e) {
226 m->errorOut(e, "CollectCommand", "help");
231 //**********************************************************************************************************************
233 CollectCommand::~CollectCommand(){}
235 //**********************************************************************************************************************
237 int CollectCommand::execute(){
240 if (abort == true) { return 0; }
242 string hadShared = "";
243 if ((globaldata->getFormat() != "sharedfile")) { inputFileNames.push_back(globaldata->inputFileName); }
244 else { hadShared = globaldata->getSharedFile(); inputFileNames = parseSharedFile(globaldata->getSharedFile()); globaldata->setFormat("rabund"); }
246 for (int p = 0; p < inputFileNames.size(); p++) {
248 if (m->control_pressed) { outputTypes.clear(); for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } globaldata->Groups.clear(); if (hadShared != "") { globaldata->setSharedFile(hadShared); globaldata->setFormat("sharedfile"); } return 0; }
250 if (outputDir == "") { outputDir += m->hasPath(inputFileNames[p]); }
251 string fileNameRoot = outputDir + m->getRootName(m->getSimpleName(inputFileNames[p]));
252 globaldata->inputFileName = inputFileNames[p];
254 if (inputFileNames.size() > 1) {
255 m->mothurOutEndLine(); m->mothurOut("Processing group " + groups[p]); m->mothurOutEndLine(); m->mothurOutEndLine();
258 validCalculator = new ValidCalculators();
260 for (int i=0; i<Estimators.size(); i++) {
261 if (validCalculator->isValidCalculator("single", Estimators[i]) == true) {
262 if (Estimators[i] == "sobs") {
263 cDisplays.push_back(new CollectDisplay(new Sobs(), new OneColumnFile(fileNameRoot+"sobs")));
264 outputNames.push_back(fileNameRoot+"sobs"); outputTypes["sobs"].push_back(fileNameRoot+"sobs");
265 }else if (Estimators[i] == "chao") {
266 cDisplays.push_back(new CollectDisplay(new Chao1(), new ThreeColumnFile(fileNameRoot+"chao")));
267 outputNames.push_back(fileNameRoot+"chao"); outputTypes["chao"].push_back(fileNameRoot+"chao");
268 }else if (Estimators[i] == "nseqs") {
269 cDisplays.push_back(new CollectDisplay(new NSeqs(), new OneColumnFile(fileNameRoot+"nseqs")));
270 outputNames.push_back(fileNameRoot+"nseqs"); outputTypes["nseqs"].push_back(fileNameRoot+"nseqs");
271 }else if (Estimators[i] == "coverage") {
272 cDisplays.push_back(new CollectDisplay(new Coverage(), new OneColumnFile(fileNameRoot+"coverage")));
273 outputNames.push_back(fileNameRoot+"coverage"); outputTypes["coverage"].push_back(fileNameRoot+"coverage");
274 }else if (Estimators[i] == "ace") {
275 cDisplays.push_back(new CollectDisplay(new Ace(abund), new ThreeColumnFile(fileNameRoot+"ace")));
276 outputNames.push_back(fileNameRoot+"ace"); outputTypes["ace"].push_back(fileNameRoot+"ace");
277 }else if (Estimators[i] == "jack") {
278 cDisplays.push_back(new CollectDisplay(new Jackknife(), new ThreeColumnFile(fileNameRoot+"jack")));
279 outputNames.push_back(fileNameRoot+"jack"); outputTypes["jack"].push_back(fileNameRoot+"jack");
280 }else if (Estimators[i] == "shannon") {
281 cDisplays.push_back(new CollectDisplay(new Shannon(), new ThreeColumnFile(fileNameRoot+"shannon")));
282 outputNames.push_back(fileNameRoot+"shannon"); outputTypes["shannon"].push_back(fileNameRoot+"shannon");
283 }else if (Estimators[i] == "shannoneven") {
284 cDisplays.push_back(new CollectDisplay(new ShannonEven(), new OneColumnFile(fileNameRoot+"shannoneven")));
285 outputNames.push_back(fileNameRoot+"shannoneven"); outputTypes["shannoneven"].push_back(fileNameRoot+"shannoneven");
286 }else if (Estimators[i] == "npshannon") {
287 cDisplays.push_back(new CollectDisplay(new NPShannon(), new OneColumnFile(fileNameRoot+"np_shannon")));
288 outputNames.push_back(fileNameRoot+"np_shannon"); outputTypes["np_shannon"].push_back(fileNameRoot+"np_shannon");
289 }else if (Estimators[i] == "heip") {
290 cDisplays.push_back(new CollectDisplay(new Heip(), new OneColumnFile(fileNameRoot+"heip")));
291 outputNames.push_back(fileNameRoot+"heip"); outputTypes["heip"].push_back(fileNameRoot+"heip");
292 }else if (Estimators[i] == "smithwilson") {
293 cDisplays.push_back(new CollectDisplay(new SmithWilson(), new OneColumnFile(fileNameRoot+"smithwilson")));
294 outputNames.push_back(fileNameRoot+"smithwilson"); outputTypes["smithwilson"].push_back(fileNameRoot+"smithwilson");
295 }else if (Estimators[i] == "simpson") {
296 cDisplays.push_back(new CollectDisplay(new Simpson(), new ThreeColumnFile(fileNameRoot+"simpson")));
297 outputNames.push_back(fileNameRoot+"simpson"); outputTypes["simpson"].push_back(fileNameRoot+"simpson");
298 }else if (Estimators[i] == "simpsoneven") {
299 cDisplays.push_back(new CollectDisplay(new SimpsonEven(), new OneColumnFile(fileNameRoot+"simpsoneven")));
300 outputNames.push_back(fileNameRoot+"simpsoneven"); outputTypes["simpsoneven"].push_back(fileNameRoot+"simpsoneven");
301 }else if (Estimators[i] == "invsimpson") {
302 cDisplays.push_back(new CollectDisplay(new InvSimpson(), new ThreeColumnFile(fileNameRoot+"invsimpson")));
303 outputNames.push_back(fileNameRoot+"invsimpson"); outputTypes["invsimpson"].push_back(fileNameRoot+"invsimpson");
304 }else if (Estimators[i] == "bootstrap") {
305 cDisplays.push_back(new CollectDisplay(new Bootstrap(), new OneColumnFile(fileNameRoot+"bootstrap")));
306 outputNames.push_back(fileNameRoot+"bootstrap"); outputTypes["bootstrap"].push_back(fileNameRoot+"bootstrap");
307 }else if (Estimators[i] == "geometric") {
308 cDisplays.push_back(new CollectDisplay(new Geom(), new OneColumnFile(fileNameRoot+"geometric")));
309 outputNames.push_back(fileNameRoot+"geometric"); outputTypes["geometric"].push_back(fileNameRoot+"geometric");
310 }else if (Estimators[i] == "qstat") {
311 cDisplays.push_back(new CollectDisplay(new QStat(), new OneColumnFile(fileNameRoot+"qstat")));
312 outputNames.push_back(fileNameRoot+"qstat"); outputTypes["qstat"].push_back(fileNameRoot+"qstat");
313 }else if (Estimators[i] == "logseries") {
314 cDisplays.push_back(new CollectDisplay(new LogSD(), new OneColumnFile(fileNameRoot+"logseries")));
315 outputNames.push_back(fileNameRoot+"logseries"); outputTypes["logseries"].push_back(fileNameRoot+"logseries");
316 }else if (Estimators[i] == "bergerparker") {
317 cDisplays.push_back(new CollectDisplay(new BergerParker(), new OneColumnFile(fileNameRoot+"bergerparker")));
318 outputNames.push_back(fileNameRoot+"bergerparker"); outputTypes["bergerparker"].push_back(fileNameRoot+"bergerparker");
319 }else if (Estimators[i] == "bstick") {
320 cDisplays.push_back(new CollectDisplay(new BStick(), new ThreeColumnFile(fileNameRoot+"bstick")));
321 outputNames.push_back(fileNameRoot+"bstick"); outputTypes["bstick"].push_back(fileNameRoot+"bstick");
322 }else if (Estimators[i] == "goodscoverage") {
323 cDisplays.push_back(new CollectDisplay(new GoodsCoverage(), new OneColumnFile(fileNameRoot+"goodscoverage")));
324 outputNames.push_back(fileNameRoot+"goodscoverage"); outputTypes["goodscoverage"].push_back(fileNameRoot+"goodscoverage");
325 }else if (Estimators[i] == "efron") {
326 cDisplays.push_back(new CollectDisplay(new Efron(size), new OneColumnFile(fileNameRoot+"efron")));
327 outputNames.push_back(fileNameRoot+"efron"); outputTypes["efron"].push_back(fileNameRoot+"efron");
328 }else if (Estimators[i] == "boneh") {
329 cDisplays.push_back(new CollectDisplay(new Boneh(size), new OneColumnFile(fileNameRoot+"boneh")));
330 outputNames.push_back(fileNameRoot+"boneh"); outputTypes["boneh"].push_back(fileNameRoot+"boneh");
331 }else if (Estimators[i] == "solow") {
332 cDisplays.push_back(new CollectDisplay(new Solow(size), new OneColumnFile(fileNameRoot+"solow")));
333 outputNames.push_back(fileNameRoot+"solow"); outputTypes["solow"].push_back(fileNameRoot+"solow");
334 }else if (Estimators[i] == "shen") {
335 cDisplays.push_back(new CollectDisplay(new Shen(size, abund), new OneColumnFile(fileNameRoot+"shen")));
336 outputNames.push_back(fileNameRoot+"shen"); outputTypes["shen"].push_back(fileNameRoot+"shen");
341 //if the users entered no valid calculators don't execute command
342 if (cDisplays.size() == 0) { if (hadShared != "") { globaldata->setSharedFile(hadShared); globaldata->setFormat("sharedfile"); } return 0; }
344 read = new ReadOTUFile(inputFileNames[p]);
345 read->read(&*globaldata);
347 order = globaldata->gorder;
348 string lastLabel = order->getLabel();
349 input = globaldata->ginput;
351 //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
352 set<string> processedLabels;
353 set<string> userLabels = labels;
355 if (m->control_pressed) {
356 for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
357 for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear();
358 delete input; globaldata->ginput = NULL;
360 delete order; globaldata->gorder = NULL;
361 delete validCalculator;
362 globaldata->Groups.clear();
363 if (hadShared != "") { globaldata->setSharedFile(hadShared); globaldata->setFormat("sharedfile"); }
368 while((order != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
370 if (m->control_pressed) {
371 for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
372 for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear();
373 delete input; globaldata->ginput = NULL;
375 delete order; globaldata->gorder = NULL;
376 delete validCalculator;
377 globaldata->Groups.clear();
378 if (hadShared != "") { globaldata->setSharedFile(hadShared); globaldata->setFormat("sharedfile"); }
383 if(allLines == 1 || labels.count(order->getLabel()) == 1){
385 m->mothurOut(order->getLabel()); m->mothurOutEndLine();
386 cCurve = new Collect(order, cDisplays);
387 cCurve->getCurve(freq);
390 processedLabels.insert(order->getLabel());
391 userLabels.erase(order->getLabel());
395 //you have a label the user want that is smaller than this label and the last label has not already been processed
396 if ((m->anyLabelsToProcess(order->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
397 string saveLabel = order->getLabel();
400 order = (input->getOrderVector(lastLabel));
402 m->mothurOut(order->getLabel()); m->mothurOutEndLine();
403 cCurve = new Collect(order, cDisplays);
404 cCurve->getCurve(freq);
408 processedLabels.insert(order->getLabel());
409 userLabels.erase(order->getLabel());
411 //restore real lastlabel to save below
412 order->setLabel(saveLabel);
415 lastLabel = order->getLabel();
418 order = (input->getOrderVector());
422 if (m->control_pressed) {
423 for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
424 for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear();
425 delete input; globaldata->ginput = NULL;
427 delete validCalculator;
428 globaldata->Groups.clear();
429 if (hadShared != "") { globaldata->setSharedFile(hadShared); globaldata->setFormat("sharedfile"); }
433 //output error messages about any remaining user labels
434 set<string>::iterator it;
435 bool needToRun = false;
436 for (it = userLabels.begin(); it != userLabels.end(); it++) {
437 m->mothurOut("Your file does not include the label " + *it);
438 if (processedLabels.count(lastLabel) != 1) {
439 m->mothurOut(". I will use " + lastLabel + "."); m->mothurOutEndLine();
442 m->mothurOut(". Please refer to " + lastLabel + "."); m->mothurOutEndLine();
446 //run last label if you need to
447 if (needToRun == true) {
448 if (order != NULL) { delete order; }
449 order = (input->getOrderVector(lastLabel));
451 m->mothurOut(order->getLabel()); m->mothurOutEndLine();
453 cCurve = new Collect(order, cDisplays);
454 cCurve->getCurve(freq);
457 if (m->control_pressed) {
458 for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
459 for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear();
460 delete input; globaldata->ginput = NULL;
462 delete order; globaldata->gorder = NULL;
463 delete validCalculator;
464 globaldata->Groups.clear();
465 if (hadShared != "") { globaldata->setSharedFile(hadShared); globaldata->setFormat("sharedfile"); }
471 for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
473 delete input; globaldata->ginput = NULL;
475 globaldata->gorder = NULL;
476 delete validCalculator;
479 //return to shared mode if you changed above
480 if (hadShared != "") { globaldata->setSharedFile(hadShared); globaldata->setFormat("sharedfile"); }
482 if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
484 m->mothurOutEndLine();
485 m->mothurOut("Output File Names: "); m->mothurOutEndLine();
486 for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); }
487 m->mothurOutEndLine();
492 catch(exception& e) {
493 m->errorOut(e, "CollectCommand", "execute");
498 //**********************************************************************************************************************
499 vector<string> CollectCommand::parseSharedFile(string filename) {
501 vector<string> filenames;
503 map<string, ofstream*> filehandles;
504 map<string, ofstream*>::iterator it3;
508 read = new ReadOTUFile(filename);
509 read->read(&*globaldata);
511 input = globaldata->ginput;
512 vector<SharedRAbundVector*> lookup = input->getSharedRAbundVectors();
514 string sharedFileRoot = m->getRootName(filename);
516 //clears file before we start to write to it below
517 for (int i=0; i<lookup.size(); i++) {
518 remove((sharedFileRoot + lookup[i]->getGroup() + ".rabund").c_str());
519 filenames.push_back((sharedFileRoot + lookup[i]->getGroup() + ".rabund"));
523 for (int i=0; i<lookup.size(); i++) {
525 filehandles[lookup[i]->getGroup()] = temp;
526 groups.push_back(lookup[i]->getGroup());
529 while(lookup[0] != NULL) {
531 for (int i = 0; i < lookup.size(); i++) {
532 RAbundVector rav = lookup[i]->getRAbundVector();
533 m->openOutputFileAppend(sharedFileRoot + lookup[i]->getGroup() + ".rabund", *(filehandles[lookup[i]->getGroup()]));
534 rav.print(*(filehandles[lookup[i]->getGroup()]));
535 (*(filehandles[lookup[i]->getGroup()])).close();
538 for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; }
539 lookup = input->getSharedRAbundVectors();
543 for (it3 = filehandles.begin(); it3 != filehandles.end(); it3++) {
548 globaldata->ginput = NULL;
552 catch(exception& e) {
553 m->errorOut(e, "CollectCommand", "parseSharedFile");
557 //**********************************************************************************************************************