m->mothurOut("Example collect.shared(label=unique-.01-.03, freq=10, groups=B-C, calc=sharedchao-sharedace-jabund-sorensonabund-jclass-sorclass-jest-sorest-thetayc-thetan).\n");
m->mothurOut("The default values for freq is 100 and calc are sharedsobs-sharedchao-sharedace-jabund-sorensonabund-jclass-sorclass-jest-sorest-thetayc-thetan.\n");
m->mothurOut("The default value for groups is all the groups in your groupfile.\n");
+ 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");
validCalculator->printCalc("shared", cout);
m->mothurOut("The label parameter is used to analyze specific labels in your input.\n");
m->mothurOut("The all parameter is used to specify if you want the estimate of all your groups together. This estimate can only be made for sharedsobs and sharedchao calculators. The default is false.\n");
util->updateGroupIndex(globaldata->Groups, globaldata->gGroupmap->groupIndex);
while((order != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
-
- if(allLines == 1 || labels.count(order->getLabel()) == 1){
-
- //create collectors curve
- cCurve = new Collect(order, cDisplays);
- int error = cCurve->getSharedCurve(freq);
- delete cCurve;
-
- if (error == 1) {
+ if (m->control_pressed) {
for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); }
for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
- delete input; globaldata->ginput = NULL;
- delete read;
- delete order; globaldata->gorder = NULL;
- delete validCalculator;
+ delete order;
globaldata->Groups.clear();
return 0;
- }
+ }
+
+ if(allLines == 1 || labels.count(order->getLabel()) == 1){
m->mothurOut(order->getLabel()); m->mothurOutEndLine();
+ //create collectors curve
+ cCurve = new Collect(order, cDisplays);
+ cCurve->getSharedCurve(freq);
+ delete cCurve;
+
processedLabels.insert(order->getLabel());
userLabels.erase(order->getLabel());
}
delete order;
order = input->getSharedOrderVector(lastLabel);
+ m->mothurOut(order->getLabel()); m->mothurOutEndLine();
//create collectors curve
cCurve = new Collect(order, cDisplays);
- int error = cCurve->getSharedCurve(freq);
+ cCurve->getSharedCurve(freq);
delete cCurve;
- if (error == 1) {
- for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); }
- for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
- delete input; globaldata->ginput = NULL;
- delete read;
- delete order; globaldata->gorder = NULL;
- delete validCalculator;
- globaldata->Groups.clear();
- return 0;
- }
-
-
- m->mothurOut(order->getLabel()); m->mothurOutEndLine();
processedLabels.insert(order->getLabel());
userLabels.erase(order->getLabel());
order = input->getSharedOrderVector();
}
+ if (m->control_pressed) {
+ for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); }
+ for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
+ globaldata->Groups.clear();
+ return 0;
+ }
+
//output error messages about any remaining user labels
set<string>::iterator it;
bool needToRun = false;
if (needToRun == true) {
if (order != NULL) { delete order; }
order = input->getSharedOrderVector(lastLabel);
-
+
+ m->mothurOut(order->getLabel()); m->mothurOutEndLine();
cCurve = new Collect(order, cDisplays);
- int error = cCurve->getSharedCurve(freq);
+ cCurve->getSharedCurve(freq);
delete cCurve;
- if (error == 1) {
+ if (m->control_pressed) {
for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); }
for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
- delete input; globaldata->ginput = NULL;
- delete read;
- delete order; globaldata->gorder = NULL;
- delete validCalculator;
+ delete order;
globaldata->Groups.clear();
return 0;
}
-
- m->mothurOut(order->getLabel()); m->mothurOutEndLine();
delete order;
}