]> git.donarmstrong.com Git - mothur.git/blobdiff - trimflowscommand.cpp
1.21.0
[mothur.git] / trimflowscommand.cpp
index bcf996b53a1f2cd385fa7bb00a2c2c7c50cf4343..d17e000e9ce3a2d36f6a432f8647e99b7f58549f 100644 (file)
@@ -157,7 +157,7 @@ TrimFlowsCommand::TrimFlowsCommand(string option)  {
                        temp = validParameter.validFile(parameters, "oligos", true);
                        if (temp == "not found")        {       oligoFileName = "";             }
                        else if(temp == "not open")     {       abort = true;                   } 
-                       else                                            {       oligoFileName = temp;   }
+                       else                                            {       oligoFileName = temp;   m->setOligosFile(oligoFileName); }
                        
                        temp = validParameter.validFile(parameters, "fasta", false);            if (temp == "not found"){       fasta = 0;              }
                        else if(m->isTrue(temp))        {       fasta = 1;      }
@@ -270,7 +270,7 @@ int TrimFlowsCommand::execute(){
                                        }
 
                                        if(size < 10){
-                                               remove(barcodePrimerComboFileNames[i][j].c_str());
+                                               m->mothurRemove(barcodePrimerComboFileNames[i][j]);
                                        }
                                        else{
                                                output << barcodePrimerComboFileNames[i][j] << endl;
@@ -612,7 +612,7 @@ int TrimFlowsCommand::stripBarcode(Sequence& seq, int& group){
                        if (barcodes.size() > 0) {
                                map<string,int>::iterator it=barcodes.begin();
                                
-                               for(it;it!=barcodes.end();it++){
+                               for(map<string,int>::iterator it=barcodes.begin();it!=barcodes.end();it++){
                                        if(it->first.length() > maxLength){
                                                maxLength = it->first.length();
                                        }
@@ -1058,23 +1058,23 @@ int TrimFlowsCommand::createProcessesCreateTrim(string flowFileName, string trim
                        m->mothurOut("Appending files from process " + toString(processIDS[i])); m->mothurOutEndLine();
                        
                        m->appendFiles((trimFlowFileName + toString(processIDS[i]) + ".temp"), trimFlowFileName);
-                       remove((trimFlowFileName + toString(processIDS[i]) + ".temp").c_str());
+                       m->mothurRemove((trimFlowFileName + toString(processIDS[i]) + ".temp"));
 //                     m->mothurOut("\tDone with trim.flow file"); m->mothurOutEndLine();
 
                        m->appendFiles((scrapFlowFileName + toString(processIDS[i]) + ".temp"), scrapFlowFileName);
-                       remove((scrapFlowFileName + toString(processIDS[i]) + ".temp").c_str());
+                       m->mothurRemove((scrapFlowFileName + toString(processIDS[i]) + ".temp"));
 //                     m->mothurOut("\tDone with scrap.flow file"); m->mothurOutEndLine();
 
                        if(fasta){
                                m->appendFiles((fastaFileName + toString(processIDS[i]) + ".temp"), fastaFileName);
-                               remove((fastaFileName + toString(processIDS[i]) + ".temp").c_str());
+                               m->mothurRemove((fastaFileName + toString(processIDS[i]) + ".temp"));
 //                             m->mothurOut("\tDone with flow.fasta file"); m->mothurOutEndLine();
                        }
                        if(allFiles){                                           
                                for (int j = 0; j < barcodePrimerComboFileNames.size(); j++) {
                                        for (int k = 0; k < barcodePrimerComboFileNames[0].size(); k++) {
                                                m->appendFiles((barcodePrimerComboFileNames[j][k] + toString(processIDS[i]) + ".temp"), barcodePrimerComboFileNames[j][k]);
-                                               remove((barcodePrimerComboFileNames[j][k] + toString(processIDS[i]) + ".temp").c_str());
+                                               m->mothurRemove((barcodePrimerComboFileNames[j][k] + toString(processIDS[i]) + ".temp"));
                                        }
                                }
                        }