//**********************************************************************************************************************
NormalizeSharedCommand::NormalizeSharedCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["shared"] = tempOutNames;
}
NormalizeSharedCommand::NormalizeSharedCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int NormalizeSharedCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
string outputFileName = outputDir + m->getRootName(m->getSimpleName(globaldata->inputFileName)) + "norm.shared";
ofstream out;
m->mothurOut(outputFileName); m->mothurOutEndLine(); outputNames.push_back(outputFileName); outputTypes["shared"].push_back(outputFileName);
m->mothurOutEndLine();
+ //set shared file as new current sharedfile
+ string current = "";
+ itTypes = outputTypes.find("shared");
+ if (itTypes != outputTypes.end()) {
+ if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setSharedFile(current); }
+ }
+
return 0;
}
catch(exception& e) {
int abund = thisLookUp[i]->getAbundance(j);
- float relabund = relabund = abund / (float) thisLookUp[i]->getNumSeqs();
+ float relabund = abund / (float) thisLookUp[i]->getNumSeqs();
float newNorm = relabund * norm;
//round to nearest int
float abund = thisLookUp[i]->getAbundance(j);
- float relabund = relabund = abund / (float) thisLookUp[i]->getNumSeqs();
+ float relabund = abund / (float) thisLookUp[i]->getNumSeqs();
float newNorm = relabund * norm;
thisLookUp[i]->set(j, newNorm, thisLookUp[i]->getGroup());