]> git.donarmstrong.com Git - mothur.git/commitdiff
Merge remote-tracking branch 'mothur/master'
authorPat Schloss <pschloss@umich.edu>
Tue, 1 May 2012 15:08:53 +0000 (11:08 -0400)
committerPat Schloss <pschloss@umich.edu>
Tue, 1 May 2012 15:08:53 +0000 (11:08 -0400)
1  2 
shhhercommand.cpp

diff --combined shhhercommand.cpp
index d8f538b56109e2faa290cb060c314186e8be318a,89d78288639e6cca3e8eebca34dd01174c3963da..2214c5ea8b4b5f124393067ff2d59dcc3acf931c
@@@ -128,8 -128,10 +128,10 @@@ ShhherCommand::ShhherCommand(string opt
                                        if (path == "") {       parameters["file"] = inputDir + it->second;             }
                                }
                        }
-                       
-                       
+             
+             //if the user changes the output directory command factory will send this info to us in the output parameter 
+                       outputDir = validParameter.validFile(parameters, "outputdir", false);           if (outputDir == "not found"){  outputDir = ""; }
+             
                        //check for required parameters
                        flowFileName = validParameter.validFile(parameters, "flow", true);
                        flowFilesFileName = validParameter.validFile(parameters, "file", true);
                        }
                        else{
                                ofstream temp;
+                 
+                 string thisoutputDir = m->hasPath(flowFilesFileName); //if user entered a file with a path then preserve it
+                 
                                //flow.files = 9 character offset
 -                              compositeFASTAFileName = thisoutputDir + flowFilesFileName.substr(0, flowFilesFileName.length()-10) + "shhh.fasta";
 +                              compositeFASTAFileName = outputDir + flowFilesFileName.substr(0, flowFilesFileName.length()-10) + "shhh.fasta";
                                m->openOutputFile(compositeFASTAFileName, temp);
                                temp.close();
                                
 -                              compositeNamesFileName = thisoutputDir + flowFilesFileName.substr(0, flowFilesFileName.length()-10) + "shhh.names";
 +                              compositeNamesFileName = outputDir + flowFilesFileName.substr(0, flowFilesFileName.length()-10) + "shhh.names";
                                m->openOutputFile(compositeNamesFileName, temp);
                                temp.close();
                        }
                  if (flowFileVector.size() == 0) {  m->mothurOut("[ERROR]: no valid files."); m->mothurOutEndLine(); abort = true; }
              }
              else{
+                 outputDir += m->hasPath(flowFileName);
                  flowFileVector.push_back(flowFileName);
              }
-                       
-                       //if the user changes the output directory command factory will send this info to us in the output parameter 
-                       outputDir = validParameter.validFile(parameters, "outputdir", false);           if (outputDir == "not found"){  
-                               outputDir = ""; 
-                               outputDir += m->hasPath(flowFileName); //if user entered a file with a path then preserve it    
-                       }
-                       
-                       
+               
                        //check for optional parameter and set defaults
                        // ...at some point should added some additional type checking...
                        string temp;
@@@ -434,8 -431,6 +431,8 @@@ int ShhherCommand::execute()
                                
                                if (m->control_pressed) { break; }
                                
 +                
 +                
                                getOTUData(listFileName);
  
                                m->mothurRemove(distFileName);
  
                                if (m->control_pressed) { break; }
                                
 +            
                                for(int i=1;i<ncpus;i++){
                                        MPI_Send(&numOTUs, 1, MPI_INT, i, tag, MPI_COMM_WORLD);
                                        MPI_Send(&singleLookUp[0], singleLookUp.size(), MPI_DOUBLE, i, tag, MPI_COMM_WORLD);
@@@ -1772,7 -1766,7 +1769,7 @@@ void ShhherCommand::writeNames(vector<i
          
          
          if(compositeNamesFileName != ""){
 -            m->appendFiles(nameFileName, compositeNamesFileName);
 +            m->appendFiles(nameFileName, uchimecompositeNamesFileName);
          }             
      }
      catch(exception& e) {
@@@ -2403,8 -2397,7 +2400,8 @@@ int ShhherCommand::getUniques(int numSe
                }
                uniqueFlowDataIntI.resize(numFlowCells * numUniques);
                uniqueLengths.resize(numUniques);       
 -              
 +              uniqueFlowgrams.resize(numFlowCells * numUniques);
 +        
                flowDataPrI.resize(numSeqs * numFlowCells, 0);
                for(int i=0;i<flowDataPrI.size();i++)   {       if (m->control_pressed) { break; } flowDataPrI[i] = getProbIntensity(flowDataIntI[i]);          }
          
@@@ -2455,7 -2448,7 +2452,7 @@@ int ShhherCommand::cluster(string filen
                NameAssignment* clusterNameMap = new NameAssignment(namesFileName);
                clusterNameMap->readMap();
                read->read(clusterNameMap);
 -              
 +        
                ListVector* list = read->getListVector();
                SparseMatrix* matrix = read->getMatrix();