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(){
75 //initialize outputTypes
76 vector<string> tempOutNames;
77 outputTypes["sobs"] = tempOutNames;
78 outputTypes["chao"] = tempOutNames;
79 outputTypes["nseqs"] = tempOutNames;
80 outputTypes["coverage"] = tempOutNames;
81 outputTypes["ace"] = tempOutNames;
82 outputTypes["jack"] = tempOutNames;
83 outputTypes["shannon"] = tempOutNames;
84 outputTypes["shannoneven"] = tempOutNames;
85 outputTypes["np_shannon"] = tempOutNames;
86 outputTypes["heip"] = tempOutNames;
87 outputTypes["smithwilson"] = tempOutNames;
88 outputTypes["simpson"] = tempOutNames;
89 outputTypes["simpsoneven"] = tempOutNames;
90 outputTypes["invsimpson"] = tempOutNames;
91 outputTypes["bootstrap"] = tempOutNames;
92 outputTypes["geometric"] = tempOutNames;
93 outputTypes["qstat"] = tempOutNames;
94 outputTypes["logseries"] = tempOutNames;
95 outputTypes["bergerparker"] = tempOutNames;
96 outputTypes["bstick"] = tempOutNames;
97 outputTypes["goodscoverage"] = tempOutNames;
98 outputTypes["efron"] = tempOutNames;
99 outputTypes["boneh"] = tempOutNames;
100 outputTypes["solow"] = tempOutNames;
101 outputTypes["shen"] = tempOutNames;
103 catch(exception& e) {
104 m->errorOut(e, "CollectCommand", "CollectCommand");
108 //**********************************************************************************************************************
109 CollectCommand::CollectCommand(string option) {
111 globaldata = GlobalData::getInstance();
117 //allow user to run help
118 if(option == "help") { validCalculator = new ValidCalculators(); help(); delete validCalculator; abort = true; }
121 //valid paramters for this command
122 string Array[] = {"freq","label","calc","abund","size","outputdir","inputdir"};
123 vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
125 OptionParser parser(option);
126 map<string,string> parameters = parser.getParameters();
128 ValidParameters validParameter;
130 //check to make sure all parameters are valid for command
131 for (map<string,string>::iterator it = parameters.begin(); it != parameters.end(); it++) {
132 if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; }
135 //initialize outputTypes
136 vector<string> tempOutNames;
137 outputTypes["sobs"] = tempOutNames;
138 outputTypes["chao"] = tempOutNames;
139 outputTypes["nseqs"] = tempOutNames;
140 outputTypes["coverage"] = tempOutNames;
141 outputTypes["ace"] = tempOutNames;
142 outputTypes["jack"] = tempOutNames;
143 outputTypes["shannon"] = tempOutNames;
144 outputTypes["shannoneven"] = tempOutNames;
145 outputTypes["np_shannon"] = tempOutNames;
146 outputTypes["heip"] = tempOutNames;
147 outputTypes["smithwilson"] = tempOutNames;
148 outputTypes["simpson"] = tempOutNames;
149 outputTypes["simpsoneven"] = tempOutNames;
150 outputTypes["invsimpson"] = tempOutNames;
151 outputTypes["bootstrap"] = tempOutNames;
152 outputTypes["geometric"] = tempOutNames;
153 outputTypes["qstat"] = tempOutNames;
154 outputTypes["logseries"] = tempOutNames;
155 outputTypes["bergerparker"] = tempOutNames;
156 outputTypes["bstick"] = tempOutNames;
157 outputTypes["goodscoverage"] = tempOutNames;
158 outputTypes["efron"] = tempOutNames;
159 outputTypes["boneh"] = tempOutNames;
160 outputTypes["solow"] = tempOutNames;
161 outputTypes["shen"] = tempOutNames;
163 //if the user changes the output directory command factory will send this info to us in the output parameter
164 outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = ""; }
166 //make sure the user has already run the read.otu command
167 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; }
169 //check for optional parameter and set defaults
170 // ...at some point should added some additional type checking...
171 label = validParameter.validFile(parameters, "label", false);
172 if (label == "not found") { label = ""; }
174 if(label != "all") { m->splitAtDash(label, labels); allLines = 0; }
175 else { allLines = 1; }
178 //if the user has not specified any labels use the ones from read.otu
180 allLines = globaldata->allLines;
181 labels = globaldata->labels;
184 calc = validParameter.validFile(parameters, "calc", false);
185 if (calc == "not found") { calc = "sobs-chao-ace-jack-shannon-npshannon-simpson"; }
187 if (calc == "default") { calc = "sobs-chao-ace-jack-shannon-npshannon-simpson"; }
189 m->splitAtDash(calc, Estimators);
192 temp = validParameter.validFile(parameters, "freq", false); if (temp == "not found") { temp = "100"; }
195 temp = validParameter.validFile(parameters, "abund", false); if (temp == "not found") { temp = "10"; }
196 convert(temp, abund);
198 temp = validParameter.validFile(parameters, "size", false); if (temp == "not found") { temp = "0"; }
203 catch(exception& e) {
204 m->errorOut(e, "CollectCommand", "CollectCommand");
208 //**********************************************************************************************************************
210 void CollectCommand::help(){
212 m->mothurOut("The collect.single command can only be executed after a successful read.otu command. WITH ONE EXECEPTION. \n");
213 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");
214 m->mothurOut("The collect.single command parameters are label, freq, calc and abund. No parameters are required. \n");
215 m->mothurOut("The collect.single command should be in the following format: \n");
216 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");
217 m->mothurOut("collect.single(label=yourLabel, iters=yourIters, freq=yourFreq, calc=yourEstimators).\n");
218 m->mothurOut("Example collect(label=unique-.01-.03, iters=10000, freq=10, calc=sobs-chao-ace-jack).\n");
219 m->mothurOut("The default values for freq is 100, and calc are sobs-chao-ace-jack-shannon-npshannon-simpson.\n");
220 validCalculator->printCalc("single", cout);
221 m->mothurOut("The label parameter is used to analyze specific labels in your input.\n");
222 m->mothurOut("Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n\n");
224 catch(exception& e) {
225 m->errorOut(e, "CollectCommand", "help");
230 //**********************************************************************************************************************
232 CollectCommand::~CollectCommand(){}
234 //**********************************************************************************************************************
236 int CollectCommand::execute(){
239 if (abort == true) { return 0; }
241 string hadShared = "";
242 if ((globaldata->getFormat() != "sharedfile")) { inputFileNames.push_back(globaldata->inputFileName); }
243 else { hadShared = globaldata->getSharedFile(); inputFileNames = parseSharedFile(globaldata->getSharedFile()); globaldata->setFormat("rabund"); }
245 for (int p = 0; p < inputFileNames.size(); p++) {
247 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; }
249 if (outputDir == "") { outputDir += m->hasPath(inputFileNames[p]); }
250 string fileNameRoot = outputDir + m->getRootName(m->getSimpleName(inputFileNames[p]));
251 globaldata->inputFileName = inputFileNames[p];
253 if (inputFileNames.size() > 1) {
254 m->mothurOutEndLine(); m->mothurOut("Processing group " + groups[p]); m->mothurOutEndLine(); m->mothurOutEndLine();
257 validCalculator = new ValidCalculators();
259 for (int i=0; i<Estimators.size(); i++) {
260 if (validCalculator->isValidCalculator("single", Estimators[i]) == true) {
261 if (Estimators[i] == "sobs") {
262 cDisplays.push_back(new CollectDisplay(new Sobs(), new OneColumnFile(fileNameRoot+"sobs")));
263 outputNames.push_back(fileNameRoot+"sobs"); outputTypes["sobs"].push_back(fileNameRoot+"sobs");
264 }else if (Estimators[i] == "chao") {
265 cDisplays.push_back(new CollectDisplay(new Chao1(), new ThreeColumnFile(fileNameRoot+"chao")));
266 outputNames.push_back(fileNameRoot+"chao"); outputTypes["chao"].push_back(fileNameRoot+"chao");
267 }else if (Estimators[i] == "nseqs") {
268 cDisplays.push_back(new CollectDisplay(new NSeqs(), new OneColumnFile(fileNameRoot+"nseqs")));
269 outputNames.push_back(fileNameRoot+"nseqs"); outputTypes["nseqs"].push_back(fileNameRoot+"nseqs");
270 }else if (Estimators[i] == "coverage") {
271 cDisplays.push_back(new CollectDisplay(new Coverage(), new OneColumnFile(fileNameRoot+"coverage")));
272 outputNames.push_back(fileNameRoot+"coverage"); outputTypes["coverage"].push_back(fileNameRoot+"coverage");
273 }else if (Estimators[i] == "ace") {
274 cDisplays.push_back(new CollectDisplay(new Ace(abund), new ThreeColumnFile(fileNameRoot+"ace")));
275 outputNames.push_back(fileNameRoot+"ace"); outputTypes["ace"].push_back(fileNameRoot+"ace");
276 }else if (Estimators[i] == "jack") {
277 cDisplays.push_back(new CollectDisplay(new Jackknife(), new ThreeColumnFile(fileNameRoot+"jack")));
278 outputNames.push_back(fileNameRoot+"jack"); outputTypes["jack"].push_back(fileNameRoot+"jack");
279 }else if (Estimators[i] == "shannon") {
280 cDisplays.push_back(new CollectDisplay(new Shannon(), new ThreeColumnFile(fileNameRoot+"shannon")));
281 outputNames.push_back(fileNameRoot+"shannon"); outputTypes["shannon"].push_back(fileNameRoot+"shannon");
282 }else if (Estimators[i] == "shannoneven") {
283 cDisplays.push_back(new CollectDisplay(new ShannonEven(), new OneColumnFile(fileNameRoot+"shannoneven")));
284 outputNames.push_back(fileNameRoot+"shannoneven"); outputTypes["shannoneven"].push_back(fileNameRoot+"shannoneven");
285 }else if (Estimators[i] == "npshannon") {
286 cDisplays.push_back(new CollectDisplay(new NPShannon(), new OneColumnFile(fileNameRoot+"np_shannon")));
287 outputNames.push_back(fileNameRoot+"np_shannon"); outputTypes["np_shannon"].push_back(fileNameRoot+"np_shannon");
288 }else if (Estimators[i] == "heip") {
289 cDisplays.push_back(new CollectDisplay(new Heip(), new OneColumnFile(fileNameRoot+"heip")));
290 outputNames.push_back(fileNameRoot+"heip"); outputTypes["heip"].push_back(fileNameRoot+"heip");
291 }else if (Estimators[i] == "smithwilson") {
292 cDisplays.push_back(new CollectDisplay(new SmithWilson(), new OneColumnFile(fileNameRoot+"smithwilson")));
293 outputNames.push_back(fileNameRoot+"smithwilson"); outputTypes["smithwilson"].push_back(fileNameRoot+"smithwilson");
294 }else if (Estimators[i] == "simpson") {
295 cDisplays.push_back(new CollectDisplay(new Simpson(), new ThreeColumnFile(fileNameRoot+"simpson")));
296 outputNames.push_back(fileNameRoot+"simpson"); outputTypes["simpson"].push_back(fileNameRoot+"simpson");
297 }else if (Estimators[i] == "simpsoneven") {
298 cDisplays.push_back(new CollectDisplay(new SimpsonEven(), new OneColumnFile(fileNameRoot+"simpsoneven")));
299 outputNames.push_back(fileNameRoot+"simpsoneven"); outputTypes["simpsoneven"].push_back(fileNameRoot+"simpsoneven");
300 }else if (Estimators[i] == "invsimpson") {
301 cDisplays.push_back(new CollectDisplay(new InvSimpson(), new ThreeColumnFile(fileNameRoot+"invsimpson")));
302 outputNames.push_back(fileNameRoot+"invsimpson"); outputTypes["invsimpson"].push_back(fileNameRoot+"invsimpson");
303 }else if (Estimators[i] == "bootstrap") {
304 cDisplays.push_back(new CollectDisplay(new Bootstrap(), new OneColumnFile(fileNameRoot+"bootstrap")));
305 outputNames.push_back(fileNameRoot+"bootstrap"); outputTypes["bootstrap"].push_back(fileNameRoot+"bootstrap");
306 }else if (Estimators[i] == "geometric") {
307 cDisplays.push_back(new CollectDisplay(new Geom(), new OneColumnFile(fileNameRoot+"geometric")));
308 outputNames.push_back(fileNameRoot+"geometric"); outputTypes["geometric"].push_back(fileNameRoot+"geometric");
309 }else if (Estimators[i] == "qstat") {
310 cDisplays.push_back(new CollectDisplay(new QStat(), new OneColumnFile(fileNameRoot+"qstat")));
311 outputNames.push_back(fileNameRoot+"qstat"); outputTypes["qstat"].push_back(fileNameRoot+"qstat");
312 }else if (Estimators[i] == "logseries") {
313 cDisplays.push_back(new CollectDisplay(new LogSD(), new OneColumnFile(fileNameRoot+"logseries")));
314 outputNames.push_back(fileNameRoot+"logseries"); outputTypes["logseries"].push_back(fileNameRoot+"logseries");
315 }else if (Estimators[i] == "bergerparker") {
316 cDisplays.push_back(new CollectDisplay(new BergerParker(), new OneColumnFile(fileNameRoot+"bergerparker")));
317 outputNames.push_back(fileNameRoot+"bergerparker"); outputTypes["bergerparker"].push_back(fileNameRoot+"bergerparker");
318 }else if (Estimators[i] == "bstick") {
319 cDisplays.push_back(new CollectDisplay(new BStick(), new ThreeColumnFile(fileNameRoot+"bstick")));
320 outputNames.push_back(fileNameRoot+"bstick"); outputTypes["bstick"].push_back(fileNameRoot+"bstick");
321 }else if (Estimators[i] == "goodscoverage") {
322 cDisplays.push_back(new CollectDisplay(new GoodsCoverage(), new OneColumnFile(fileNameRoot+"goodscoverage")));
323 outputNames.push_back(fileNameRoot+"goodscoverage"); outputTypes["goodscoverage"].push_back(fileNameRoot+"goodscoverage");
324 }else if (Estimators[i] == "efron") {
325 cDisplays.push_back(new CollectDisplay(new Efron(size), new OneColumnFile(fileNameRoot+"efron")));
326 outputNames.push_back(fileNameRoot+"efron"); outputTypes["efron"].push_back(fileNameRoot+"efron");
327 }else if (Estimators[i] == "boneh") {
328 cDisplays.push_back(new CollectDisplay(new Boneh(size), new OneColumnFile(fileNameRoot+"boneh")));
329 outputNames.push_back(fileNameRoot+"boneh"); outputTypes["boneh"].push_back(fileNameRoot+"boneh");
330 }else if (Estimators[i] == "solow") {
331 cDisplays.push_back(new CollectDisplay(new Solow(size), new OneColumnFile(fileNameRoot+"solow")));
332 outputNames.push_back(fileNameRoot+"solow"); outputTypes["solow"].push_back(fileNameRoot+"solow");
333 }else if (Estimators[i] == "shen") {
334 cDisplays.push_back(new CollectDisplay(new Shen(size, abund), new OneColumnFile(fileNameRoot+"shen")));
335 outputNames.push_back(fileNameRoot+"shen"); outputTypes["shen"].push_back(fileNameRoot+"shen");
340 //if the users entered no valid calculators don't execute command
341 if (cDisplays.size() == 0) { if (hadShared != "") { globaldata->setSharedFile(hadShared); globaldata->setFormat("sharedfile"); } return 0; }
343 read = new ReadOTUFile(inputFileNames[p]);
344 read->read(&*globaldata);
346 order = globaldata->gorder;
347 string lastLabel = order->getLabel();
348 input = globaldata->ginput;
350 //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
351 set<string> processedLabels;
352 set<string> userLabels = labels;
354 if (m->control_pressed) {
355 for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
356 for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear();
357 delete input; globaldata->ginput = NULL;
359 delete order; globaldata->gorder = NULL;
360 delete validCalculator;
361 globaldata->Groups.clear();
362 if (hadShared != "") { globaldata->setSharedFile(hadShared); globaldata->setFormat("sharedfile"); }
367 while((order != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
369 if (m->control_pressed) {
370 for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
371 for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear();
372 delete input; globaldata->ginput = NULL;
374 delete order; globaldata->gorder = NULL;
375 delete validCalculator;
376 globaldata->Groups.clear();
377 if (hadShared != "") { globaldata->setSharedFile(hadShared); globaldata->setFormat("sharedfile"); }
382 if(allLines == 1 || labels.count(order->getLabel()) == 1){
384 m->mothurOut(order->getLabel()); m->mothurOutEndLine();
385 cCurve = new Collect(order, cDisplays);
386 cCurve->getCurve(freq);
389 processedLabels.insert(order->getLabel());
390 userLabels.erase(order->getLabel());
394 //you have a label the user want that is smaller than this label and the last label has not already been processed
395 if ((m->anyLabelsToProcess(order->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
396 string saveLabel = order->getLabel();
399 order = (input->getOrderVector(lastLabel));
401 m->mothurOut(order->getLabel()); m->mothurOutEndLine();
402 cCurve = new Collect(order, cDisplays);
403 cCurve->getCurve(freq);
407 processedLabels.insert(order->getLabel());
408 userLabels.erase(order->getLabel());
410 //restore real lastlabel to save below
411 order->setLabel(saveLabel);
414 lastLabel = order->getLabel();
417 order = (input->getOrderVector());
421 if (m->control_pressed) {
422 for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
423 for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear();
424 delete input; globaldata->ginput = NULL;
426 delete validCalculator;
427 globaldata->Groups.clear();
428 if (hadShared != "") { globaldata->setSharedFile(hadShared); globaldata->setFormat("sharedfile"); }
432 //output error messages about any remaining user labels
433 set<string>::iterator it;
434 bool needToRun = false;
435 for (it = userLabels.begin(); it != userLabels.end(); it++) {
436 m->mothurOut("Your file does not include the label " + *it);
437 if (processedLabels.count(lastLabel) != 1) {
438 m->mothurOut(". I will use " + lastLabel + "."); m->mothurOutEndLine();
441 m->mothurOut(". Please refer to " + lastLabel + "."); m->mothurOutEndLine();
445 //run last label if you need to
446 if (needToRun == true) {
447 if (order != NULL) { delete order; }
448 order = (input->getOrderVector(lastLabel));
450 m->mothurOut(order->getLabel()); m->mothurOutEndLine();
452 cCurve = new Collect(order, cDisplays);
453 cCurve->getCurve(freq);
456 if (m->control_pressed) {
457 for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
458 for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear();
459 delete input; globaldata->ginput = NULL;
461 delete order; globaldata->gorder = NULL;
462 delete validCalculator;
463 globaldata->Groups.clear();
464 if (hadShared != "") { globaldata->setSharedFile(hadShared); globaldata->setFormat("sharedfile"); }
470 for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
472 delete input; globaldata->ginput = NULL;
474 globaldata->gorder = NULL;
475 delete validCalculator;
478 //return to shared mode if you changed above
479 if (hadShared != "") { globaldata->setSharedFile(hadShared); globaldata->setFormat("sharedfile"); }
481 if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
483 m->mothurOutEndLine();
484 m->mothurOut("Output File Names: "); m->mothurOutEndLine();
485 for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); }
486 m->mothurOutEndLine();
491 catch(exception& e) {
492 m->errorOut(e, "CollectCommand", "execute");
497 //**********************************************************************************************************************
498 vector<string> CollectCommand::parseSharedFile(string filename) {
500 vector<string> filenames;
502 map<string, ofstream*> filehandles;
503 map<string, ofstream*>::iterator it3;
507 read = new ReadOTUFile(filename);
508 read->read(&*globaldata);
510 input = globaldata->ginput;
511 vector<SharedRAbundVector*> lookup = input->getSharedRAbundVectors();
513 string sharedFileRoot = m->getRootName(filename);
515 //clears file before we start to write to it below
516 for (int i=0; i<lookup.size(); i++) {
517 remove((sharedFileRoot + lookup[i]->getGroup() + ".rabund").c_str());
518 filenames.push_back((sharedFileRoot + lookup[i]->getGroup() + ".rabund"));
522 for (int i=0; i<lookup.size(); i++) {
524 filehandles[lookup[i]->getGroup()] = temp;
525 groups.push_back(lookup[i]->getGroup());
528 while(lookup[0] != NULL) {
530 for (int i = 0; i < lookup.size(); i++) {
531 RAbundVector rav = lookup[i]->getRAbundVector();
532 m->openOutputFileAppend(sharedFileRoot + lookup[i]->getGroup() + ".rabund", *(filehandles[lookup[i]->getGroup()]));
533 rav.print(*(filehandles[lookup[i]->getGroup()]));
534 (*(filehandles[lookup[i]->getGroup()])).close();
537 for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; }
538 lookup = input->getSharedRAbundVectors();
542 for (it3 = filehandles.begin(); it3 != filehandles.end(); it3++) {
547 globaldata->ginput = NULL;
551 catch(exception& e) {
552 m->errorOut(e, "CollectCommand", "parseSharedFile");
556 //**********************************************************************************************************************