]> git.donarmstrong.com Git - mothur.git/blobdiff - indicatorcommand.cpp
removed UWSig and WSig from output if user does not set random=T
[mothur.git] / indicatorcommand.cpp
index e8863f75fbdf330b338a28bc5a19aa9f45ce5dc2..797f62c8908f0c0bd125c9bc1135a45b83e6d028 100644 (file)
@@ -38,10 +38,11 @@ vector<string> IndicatorCommand::setParameters(){
 string IndicatorCommand::getHelpString(){      
        try {
                string helpString = "";
-               helpString += "The indicator command reads a shared or relabund file and a tree or design file, and outputs a .indicator.tre and .indicator.summary file. \n";
+               helpString += "The indicator command can be run in 3 ways: with a shared or relabund file and a design file, or with a shared or relabund file and a tree file, or with a shared or relabund file, tree file and design file. \n";
+               helpString += "The indicator command outputs a .indicator.summary file and a .indicator.tre if a tree is given. \n";
                helpString += "The new tree contains labels at each internal node.  The label is the node number so you can relate the tree to the summary file.\n";
                helpString += "The summary file lists the indicator value for each OTU for each node.\n";
-               helpString += "The indicator command parameters are tree, groups, shared, relabund, design and label. The tree parameter is required as well as either shared or relabund.\n";
+               helpString += "The indicator command parameters are tree, groups, shared, relabund, design and label. \n";
                helpString += "The design parameter allows you to relate the tree to the shared or relabund file, if your tree contains the grouping names, or if no tree is provided to group your groups into groupings.\n";                  
                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";
@@ -229,7 +230,7 @@ int IndicatorCommand::execute(){
                
                int start = time(NULL);
        
-               //read designfile if given and set up globaldatas groups for read of sharedfiles
+               //read designfile if given and set up groups for read of sharedfiles
                if (designfile != "") {
                        designMap = new GroupMap(designfile);
                        designMap->readDesignMap();
@@ -256,7 +257,7 @@ int IndicatorCommand::execute(){
                        if (lookupFloat[0] == NULL) { m->mothurOut("[ERROR] reading relabund file."); m->mothurOutEndLine(); return 0; }
                }
                
-               //reset Globaldatas groups if needed
+               //reset groups if needed
                if (designfile != "") { m->Groups = Groups; }
                        
                /***************************************************/
@@ -353,7 +354,7 @@ int IndicatorCommand::execute(){
                if (sharedfile != "") {  for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } }
                else { for (int i = 0; i < lookupFloat.size(); i++) {  delete lookupFloat[i];  } }
                
-               if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) {        remove(outputNames[i].c_str()); } return 0; }
+               if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) {        m->mothurRemove(outputNames[i]);        } return 0; }
                
                //set tree file as new current treefile
                if (treefile != "") {
@@ -1183,7 +1184,7 @@ vector<float> IndicatorCommand::getPValues(vector< vector<SharedRAbundFloatVecto
                                        in >> numTemp; m->gobble(in);
                                        pvalues[j] += numTemp;
                                }
-                               in.close(); remove(tempFile.c_str());
+                               in.close(); m->mothurRemove(tempFile);
                        }
                        for (int i = 0; i < pvalues.size(); i++) { pvalues[i] /= (double)iters; } 
                }
@@ -1296,7 +1297,7 @@ vector<float> IndicatorCommand::getPValues(vector< vector<SharedRAbundVector*> >
                                        in >> numTemp; m->gobble(in);
                                        pvalues[j] += numTemp;
                                }
-                               in.close(); remove(tempFile.c_str());
+                               in.close(); m->mothurRemove(tempFile);
                        }
                        for (int i = 0; i < pvalues.size(); i++) { pvalues[i] /= (double)iters; } 
                }