//if the user changes the output directory command factory will send this info to us in the output parameter
outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){
outputDir = "";
- outputDir += hasPath(globaldata->inputFileName); //if user entered a file with a path then preserve it
+ outputDir += m->hasPath(globaldata->inputFileName); //if user entered a file with a path then preserve it
}
//check for optional parameter and set defaults
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
- if(label != "all") { splitAtDash(label, labels); allLines = 0; }
+ if(label != "all") { m->splitAtDash(label, labels); allLines = 0; }
else { allLines = 1; }
}
else {
if (calc == "default") { calc = "sobs-chao-ace-jack-shannon-npshannon-simpson"; }
}
- splitAtDash(calc, Estimators);
+ m->splitAtDash(calc, Estimators);
string temp;
temp = validParameter.validFile(parameters, "abund", false); if (temp == "not found") { temp = "10"; }
convert(temp, size);
temp = validParameter.validFile(parameters, "groupmode", false); if (temp == "not found") { temp = "F"; }
- groupMode = isTrue(temp);
+ groupMode = m->isTrue(temp);
}
numLines = 0;
numCols = 0;
- string fileNameRoot = outputDir + getRootName(getSimpleName(inputFileNames[p])) + "summary";
+ string fileNameRoot = outputDir + m->getRootName(m->getSimpleName(inputFileNames[p])) + "summary";
globaldata->inputFileName = inputFileNames[p];
outputNames.push_back(fileNameRoot);
if (sumCalculators.size() == 0) { if (hadShared != "") { globaldata->setSharedFile(hadShared); globaldata->setFormat("sharedfile"); } return 0; }
ofstream outputFileHandle;
- openOutputFile(fileNameRoot, outputFileHandle);
+ m->openOutputFile(fileNameRoot, outputFileHandle);
outputFileHandle << "label";
read = new ReadOTUFile(globaldata->inputFileName);
numLines++;
}
- if ((anyLabelsToProcess(sabund->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
+ if ((m->anyLabelsToProcess(sabund->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
string saveLabel = sabund->getLabel();
delete sabund;
input = globaldata->ginput;
vector<SharedRAbundVector*> lookup = input->getSharedRAbundVectors();
- string sharedFileRoot = getRootName(filename);
+ string sharedFileRoot = m->getRootName(filename);
//clears file before we start to write to it below
for (int i=0; i<lookup.size(); i++) {
for (int i = 0; i < lookup.size(); i++) {
RAbundVector rav = lookup[i]->getRAbundVector();
- openOutputFileAppend(sharedFileRoot + lookup[i]->getGroup() + ".rabund", *(filehandles[lookup[i]->getGroup()]));
+ m->openOutputFileAppend(sharedFileRoot + lookup[i]->getGroup() + ".rabund", *(filehandles[lookup[i]->getGroup()]));
rav.print(*(filehandles[lookup[i]->getGroup()]));
(*(filehandles[lookup[i]->getGroup()])).close();
}
try {
ofstream out;
- string combineFileName = outputDir + getRootName(getSimpleName(globaldata->inputFileName)) + "groups.summary";
+ string combineFileName = outputDir + m->getRootName(m->getSimpleName(globaldata->inputFileName)) + "groups.summary";
//open combined file
- openOutputFile(combineFileName, out);
+ m->openOutputFile(combineFileName, out);
//open each groups summary file
string newLabel = "";
for (int i=0; i<outputNames.size(); i++) {
temp = new ifstream;
filehandles[outputNames[i]] = temp;
- openInputFile(outputNames[i], *(temp));
+ m->openInputFile(outputNames[i], *(temp));
//read through first line - labels
string tempLabel;
}
}else{ for (int j = 0; j < numCols+1; j++) { *(temp) >> tempLabel; } }
- gobble(*(temp));
+ m->gobble(*(temp));
}
//output label line to new file
}
out << endl;
- gobble(*(filehandles[outputNames[i]]));
+ m->gobble(*(filehandles[outputNames[i]]));
}
}