//allow user to run help
if(option == "help") { help(); abort = true; calledHelp = true; }
+ else if(option == "citation") { citation(); abort = true; calledHelp = true;}
else {
vector<string> myArray = setParameters();
treefile = m->getTreeFile();
if (treefile != "") { m->mothurOut("Using " + treefile + " as input file for the tree parameter."); m->mothurOutEndLine(); }
else { m->mothurOut("You have no current tree file and the tree parameter is required."); m->mothurOutEndLine(); abort = true; }
- }
+ }else { m->setTreeFile(treefile); }
sharedfile = validParameter.validFile(parameters, "shared", true);
if (sharedfile == "not open") { abort = true; }
else if (sharedfile == "not found") { sharedfile = ""; }
- else { inputFileName = sharedfile; }
+ else { inputFileName = sharedfile; m->setSharedFile(sharedfile); }
relabundfile = validParameter.validFile(parameters, "relabund", true);
if (relabundfile == "not open") { abort = true; }
else if (relabundfile == "not found") { relabundfile = ""; }
- else { inputFileName = relabundfile; }
+ else { inputFileName = relabundfile; m->setRelAbundFile(relabundfile); }
designfile = validParameter.validFile(parameters, "design", true);
if (designfile == "not open") { abort = true; }
else if (designfile == "not found") { designfile = ""; }
+ else { m->setDesignFile(designfile); }
groups = validParameter.validFile(parameters, "groups", false);
if (groups == "not found") { groups = ""; Groups.push_back("all"); }
vector<float> terms;
float AijDenominator = 0.0;
vector<float> Bij;
+
//get overall abundance of each grouping
for (int j = 0; j < groupings.size(); j++) {
if (groupings[j][k]->getAbundance(i) != 0) { numNotZero++; }
}
+ //mean abundance
float Aij = (totalAbund / (float) groupings[j].size());
terms.push_back(Aij);
float maxIndVal = 0.0;
for (int j = 0; j < terms.size(); j++) {
- float thisAij = (terms[j] / AijDenominator);
+ float thisAij = (terms[j] / AijDenominator); //relative abundance
float thisValue = thisAij * Bij[j] * 100.0;
//save largest
if (groupings[j][k]->getAbundance(i) != 0.0) { numNotZero++; }
}
-
+
+ //mean abundance
float Aij = (totalAbund / (float) groupings[j].size());
terms.push_back(Aij);
float maxIndVal = 0.0;
for (int j = 0; j < terms.size(); j++) {
- float thisAij = (terms[j] / AijDenominator);
+ float thisAij = (terms[j] / AijDenominator); //relative abundance
float thisValue = thisAij * Bij[j] * 100.0;
//save largest