]> git.donarmstrong.com Git - mothur.git/blobdiff - normalizesharedcommand.cpp
fixed get.lienage and remove.lineage bug with confidence scores that are floats....
[mothur.git] / normalizesharedcommand.cpp
index c0e7c1f7f037cf1f0d87ab169408825a547c5982..37cfb5daa98b4eeb850b44d60e5e9d80fa268de5 100644 (file)
@@ -381,6 +381,13 @@ int NormalizeSharedCommand::execute(){
                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) {
@@ -404,7 +411,7 @@ int NormalizeSharedCommand::normalize(vector<SharedRAbundVector*>& thisLookUp, o
                                                        
                                                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
@@ -478,7 +485,7 @@ int NormalizeSharedCommand::normalize(vector<SharedRAbundFloatVector*>& thisLook
                                        
                                        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());