helpString += "The groups parameter allows you to specify which of the groups in your shared or relabund you would like analyzed, or if you provide a design file the groups in your design file. The groups may be entered separated by dashes.\n";
helpString += "The label parameter indicates at what distance your tree relates to the shared or relabund.\n";
helpString += "The indicator command should be used in the following format: indicator(tree=test.tre, shared=test.shared, label=0.03)\n";
- helpString += "Note: No spaces between parameter labels (i.e. tree), '=' and parameters (i.e.yourTreefile).\n\n";
+ helpString += "Note: No spaces between parameter labels (i.e. tree), '=' and parameters (i.e.yourTreefile).\n";
return helpString;
}
catch(exception& e) {
//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();
}
m->runParse = true;
+ m->Groups.clear();
+ m->namesOfGroups.clear();
+ m->Treenames.clear();
+ m->names.clear();
vector<string> tempOutNames;
outputTypes["tree"] = tempOutNames;
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"); }
// reading tree info //
/***************************************************/
string groupfile = "";
+ m->setTreeFile(treefile);
Tree* tree = new Tree(treefile); delete tree; //extracts names from tree to make faked out groupmap
treeMap = new TreeMap();
bool mismatch = false;
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