]> git.donarmstrong.com Git - mothur.git/commitdiff
added check for positive values in pairwise.seqs gap extend, gap open and mismatch...
authorSarah Westcott <mothur.westcott@gmail.com>
Mon, 23 Apr 2012 13:40:43 +0000 (09:40 -0400)
committerSarah Westcott <mothur.westcott@gmail.com>
Mon, 23 Apr 2012 13:40:43 +0000 (09:40 -0400)
cooccurrencecommand.cpp
makebiomcommand.cpp
pairwiseseqscommand.cpp

index 6864f799f99a1533766f7350f0a6d8a409fe2876..e6c92594f49d8ab038abdb1587983ece722e5592 100644 (file)
@@ -279,7 +279,6 @@ int CooccurrenceCommand::getCooccurrence(vector<SharedRAbundVector*>& thisLookUp
         vector<int> columntotal; columntotal.resize(thisLookUp.size(), 0);
         vector<int> rowtotal; rowtotal.resize(numOTUS, 0);
         
-        int rowcount = 0;
         for (int i = 0; i < thisLookUp.size(); i++) {
                        for (int j = 0; j < thisLookUp[i]->getNumBins(); j++) {
                                if (m->control_pressed) { return 0; }                   
@@ -288,12 +287,10 @@ int CooccurrenceCommand::getCooccurrence(vector<SharedRAbundVector*>& thisLookUp
                                if(abund > 0) {
                                    initmatrix[i][j] = 1;
                     co_matrix[j][i] = 1;
-                    rowcount++;
-                    columntotal[j]++;
+                    rowtotal[j]++;
+                    columntotal[i]++;
                                }
                        }
-            rowtotal[i] = rowcount;
-            rowcount = 0;
         }
         
         //nrows is ncols of inital matrix. All the functions need this value. They assume the transposition has already taken place and nrows and ncols refer to that matrix.
index 41f2316b3a036840208635d3abbacd89e59f6413..70e3b1ad94698cc6369d64555dd70ed889a9c841 100644 (file)
@@ -168,7 +168,7 @@ MakeBiomCommand::MakeBiomCommand(string option) {
                        
                        //initialize outputTypes
                        vector<string> tempOutNames;
-                       outputTypes["relabund"] = tempOutNames;
+                       outputTypes["biom"] = tempOutNames;
                        
                        //if the user changes the input directory command factory will send this info to us in the output parameter 
                        string inputDir = validParameter.validFile(parameters, "inputdir", false);              
@@ -328,6 +328,14 @@ int MakeBiomCommand::execute(){
                
         if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) {       m->mothurRemove(outputNames[i]); }  return 0; }     
                
+        //set sabund file as new current sabundfile
+        string current = "";
+               itTypes = outputTypes.find("biom");
+               if (itTypes != outputTypes.end()) {
+                       if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setBiomFile(current); }
+               }
+
+        
                m->mothurOutEndLine();
                m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                for (int i = 0; i < outputNames.size(); i++) {  m->mothurOut(outputNames[i]); m->mothurOutEndLine();    }
index 98b0fde32dbb4cf9bf86aad283fa1d6ad3a7ea44..a4ccbf8f33b34b5dd8eccebf91242249cc465f28 100644 (file)
@@ -203,12 +203,15 @@ PairwiseSeqsCommand::PairwiseSeqsCommand(string option)  {
                        
                        temp = validParameter.validFile(parameters, "mismatch", false);         if (temp == "not found"){       temp = "-1.0";                  }
                        m->mothurConvert(temp, misMatch);  
+            if (misMatch > 0) { m->mothurOut("[ERROR]: mismatch must be negative.\n"); abort=true; }
                        
                        temp = validParameter.validFile(parameters, "gapopen", false);          if (temp == "not found"){       temp = "-2.0";                  }
                        m->mothurConvert(temp, gapOpen);  
+            if (gapOpen > 0) { m->mothurOut("[ERROR]: gapopen must be negative.\n"); abort=true; }
                        
                        temp = validParameter.validFile(parameters, "gapextend", false);        if (temp == "not found"){       temp = "-1.0";                  }
                        m->mothurConvert(temp, gapExtend); 
+            if (gapExtend > 0) { m->mothurOut("[ERROR]: gapextend must be negative.\n"); abort=true; }
                        
                        temp = validParameter.validFile(parameters, "processors", false);       if (temp == "not found"){       temp = m->getProcessors();      }
                        m->setProcessors(temp);