]> git.donarmstrong.com Git - mothur.git/blobdiff - normalizesharedcommand.cpp
fixed memory leak in maligner minCoverageFilter function used by chimera slayer
[mothur.git] / normalizesharedcommand.cpp
index dc5ed196b4df8eff111954dbab106b1439f7a20c..16b9732ebdb25e936bbda1537825467f400cf079 100644 (file)
@@ -12,7 +12,7 @@
 //**********************************************************************************************************************
 vector<string> NormalizeSharedCommand::getValidParameters(){   
        try {
-               string Array[] =  {"groups","label","scale","outputdir","inputdir","norm"};
+               string Array[] =  {"groups","label","method","outputdir","inputdir","norm"};
                vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
                return myArray;
        }
@@ -24,6 +24,7 @@ vector<string> NormalizeSharedCommand::getValidParameters(){
 //**********************************************************************************************************************
 NormalizeSharedCommand::NormalizeSharedCommand(){      
        try {
+               abort = true;
                //initialize outputTypes
                vector<string> tempOutNames;
                outputTypes["shared"] = tempOutNames;
@@ -70,7 +71,7 @@ NormalizeSharedCommand::NormalizeSharedCommand(string option) {
                
                else {
                        //valid paramters for this command
-                       string AlignArray[] =  {"groups","label","scale","outputdir","inputdir","norm"};
+                       string AlignArray[] =  {"groups","label","method","outputdir","inputdir","norm"};
                        vector<string> myArray (AlignArray, AlignArray+(sizeof(AlignArray)/sizeof(string)));
                        
                        OptionParser parser(option);
@@ -151,7 +152,7 @@ void NormalizeSharedCommand::help(){
                m->mothurOut("The method parameter allows you to select what method you would like to use to normalize. The only choice is totalgroup. We hope to add more ways to normalize in the future, suggestions are welcome!\n");
                m->mothurOut("The norm parameter allows you to number you would like to normalize to. By default this is set to the number of sequences in your smallest group.\n");
                m->mothurOut("The normalize.shared command should be in the following format: normalize.shared(groups=yourGroups, label=yourLabels).\n");
-               m->mothurOut("Example normalize.shared(groups=A-B-C, scale=averagegroup).\n");
+               m->mothurOut("Example normalize.shared(groups=A-B-C, scale=totalgroup).\n");
                m->mothurOut("The default value for groups is all the groups in your groupfile, and all labels in your inputfile will be used.\n");
                m->mothurOut("The normalize.shared command outputs a .norm.shared file.\n");
                m->mothurOut("Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n");
@@ -309,7 +310,8 @@ int NormalizeSharedCommand::normalize(vector<SharedRAbundVector*>& thisLookUp, o
                                        float newNorm = relabund * norm;
                                        //round to nearest int
                                        finalNorm = (int) floor((newNorm + 0.5));
-                                       
+                                       //cout << thisLookUp[i]->getGroup() << '\t' << abund << '\t' << relabund << '\t' << norm << '\t' << newNorm << '\t' << finalNorm << endl;
+                               
                                }else{ m->mothurOut(method + " is not a valid scaling option."); m->mothurOutEndLine(); m->control_pressed = true; return 0; }
                                
                                //cout << finalNorm << '\t';
@@ -321,7 +323,7 @@ int NormalizeSharedCommand::normalize(vector<SharedRAbundVector*>& thisLookUp, o
                 eliminateZeroOTUS(thisLookUp);
                 
                  for (int i = 0; i < thisLookUp.size(); i++) {
-                       out << thisLookUp[i]->getLabel() << '\t' << thisLookUp[i]->getGroup() << '\t' << thisLookUp[i]->getNumBins() << '\t';
+                       out << thisLookUp[i]->getLabel() << '\t' << thisLookUp[i]->getGroup() << '\t';
                        thisLookUp[i]->print(out);
                 }