]> git.donarmstrong.com Git - mothur.git/blobdiff - chimeraslayercommand.cpp
changed random forest output filename
[mothur.git] / chimeraslayercommand.cpp
index d8e0952a8b9f89cd237946a27ea624f11fa42898..f01bd3ee9d9bb3611b52b38819f98300da9cff39 100644 (file)
@@ -603,10 +603,7 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option)  {
                        m->mothurConvert(temp, numwanted);
             
                        temp = validParameter.validFile(parameters, "dereplicate", false);      
-                       if (temp == "not found") { 
-                               if (groupfile != "")    {  temp = "false";                                      }
-                               else                    {  temp = "true";       }
-                       }
+                       if (temp == "not found") { temp = "false";                      }
                        dups = m->isTrue(temp);
                        
                        blastlocation = validParameter.validFile(parameters, "blastlocation", false);   
@@ -762,7 +759,7 @@ int ChimeraSlayerCommand::execute(){
                                if (processors == 1) {
                     numSeqs = driverGroups(outputFileName, accnosFileName, trimFastaFileName, fileToPriority, fileGroup, newCountFile);
                     if (hasCount && dups) {
-                        CountTable c; c.readTable(nameFileNames[s]);
+                        CountTable c; c.readTable(nameFileNames[s], true);
                         if (!m->isBlank(newCountFile)) {
                             ifstream in2;
                             m->openInputFile(newCountFile, in2);
@@ -794,7 +791,7 @@ int ChimeraSlayerCommand::execute(){
                     }else {
                         if (hasCount) {
                             set<string> doNotRemove;
-                            CountTable c; c.readTable(newCountFile);
+                            CountTable c; c.readTable(newCountFile, true);
                             vector<string> namesInTable = c.getNamesOfSeqs();
                             for (int i = 0; i < namesInTable.size(); i++) {
                                 int temp = c.getNumSeqs(namesInTable[i]);
@@ -837,6 +834,11 @@ int ChimeraSlayerCommand::execute(){
                        }
                }
                
+        itTypes = outputTypes.find("count");
+               if (itTypes != outputTypes.end()) {
+                       if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setCountTableFile(current); }
+               }
+        
                m->mothurOutEndLine();
                m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                for (int i = 0; i < outputNames.size(); i++) {  m->mothurOut(outputNames[i]); m->mothurOutEndLine();    }       
@@ -1549,7 +1551,7 @@ int ChimeraSlayerCommand::createProcessesGroups(string outputFName, string accno
                if (fileToPriority.size() < processors) { processors = fileToPriority.size(); }
         
         CountTable newCount;
-        if (hasCount && dups) { newCount.readTable(countFile); }
+        if (hasCount && dups) { newCount.readTable(countFile, true); }
                
                int groupsPerProcessor = fileToPriority.size() / processors;
                int remainder = fileToPriority.size() % processors;
@@ -1626,7 +1628,7 @@ int ChimeraSlayerCommand::createProcessesGroups(string outputFName, string accno
                //Create processor worker threads.
                for(int i=1; i<processors; i++ ){
                        string extension = toString(i) + ".temp";
-                       slayerData* tempslayer = new slayerData(group2NameMap, hasCount, dups, (accnos + extension+".byCount"), (outputFName + extension), (fasta + extension), (accnos + extension), templatefile, search, blastlocation, trimera, trim, realign, m, breakUp[i], fileGroup, ksize, match, mismatch, window, minSimilarity, minCoverage, minBS, minSNP, parents, iters, increment, numwanted, divR, priority, i);
+                       slayerData* tempslayer = new slayerData(group2NameMap, hasCount, dups, (accnos + toString(i) +".byCount"), (outputFName + extension), (fasta + extension), (accnos + extension), templatefile, search, blastlocation, trimera, trim, realign, m, breakUp[i], fileGroup, ksize, match, mismatch, window, minSimilarity, minCoverage, minBS, minSNP, parents, iters, increment, numwanted, divR, priority, i);
                        pDataArray.push_back(tempslayer);
                        processIDS.push_back(i);
                        
@@ -1821,10 +1823,10 @@ int ChimeraSlayerCommand::driver(linePair filePos, string outputFName, string fi
                        
                        delete candidateSeq;
                        //report progress
-                       if((count) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine();         }
+                       if((count) % 100 == 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count) + "\n");             }
                }
                //report progress
-               if((count) % 100 != 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine();         }
+               if((count) % 100 != 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count)+ "\n");              }
                
                int numNoParents = chimera->getNumNoParents();
                if (numNoParents == count) { m->mothurOut("[WARNING]: megablast returned 0 potential parents for all your sequences. This could be due to formatdb.exe not being setup properly, please check formatdb.log for errors."); m->mothurOutEndLine(); } 
@@ -1971,10 +1973,10 @@ int ChimeraSlayerCommand::driverMPI(int start, int num, MPI_File& inMPI, MPI_Fil
                        delete candidateSeq;
                        
                        //report progress
-                       if((i+1) % 100 == 0){  cout << "Processing sequence: " << (i+1) << endl;        m->mothurOutJustToLog("Processing sequence: " + toString(i+1) + "\n");          }
+                       if((i+1) % 100 == 0){  cout << "Processing sequence: " << (i+1) << endl;                }
                }
                //report progress
-               if(num % 100 != 0){             cout << "Processing sequence: " << num << endl; m->mothurOutJustToLog("Processing sequence: " + toString(num) + "\n");  }
+               if(num % 100 != 0){             cout << "Processing sequence: " << num << endl;         }
                
                int numNoParents = chimera->getNumNoParents();
                if (numNoParents == num) { cout << "[WARNING]: megablast returned 0 potential parents for all your sequences. This could be due to formatdb.exe not being setup properly, please check formatdb.log for errors." << endl; }
@@ -2159,7 +2161,7 @@ map<string, int> ChimeraSlayerCommand::sortFastaFile(string fastaFile, string na
         int error;
         if (hasCount) { 
             CountTable ct;
-            ct.readTable(nameFile);
+            ct.readTable(nameFile, true);
             
             for(map<string, string>::iterator it = seqs.begin(); it != seqs.end(); it++) {
                 int num = ct.getNumSeqs(it->first);