]> git.donarmstrong.com Git - mothur.git/blobdiff - makecontigscommand.h
added checks to make sure windows processes completed their tasks.
[mothur.git] / makecontigscommand.h
index 2732d68a959934425430853ac67b5c8414aeffd5..b61ebda3fc505db3c6805706cafb2e337138474d 100644 (file)
@@ -60,7 +60,7 @@ public:
     
 private:
     bool abort, allFiles, createGroup;
-    string outputDir, ffastqfile, rfastqfile, align, oligosfile, rfastafile, ffastafile, rqualfile, fqualfile, file;
+    string outputDir, ffastqfile, rfastqfile, align, oligosfile, rfastafile, ffastafile, rqualfile, fqualfile, file, format;
        float match, misMatch, gapOpen, gapExtend;
        int processors, longestBase, threshold, tdiffs, bdiffs, pdiffs, ldiffs, sdiffs;
     vector<string> outputNames;
@@ -70,11 +70,13 @@ private:
     vector<string>  linker;
     vector<string>  spacer;
        vector<string> primerNameVector;        
-       vector<string> barcodeNameVector;       
+       vector<string> barcodeNameVector;
+       vector<char> convertTable;
     
        map<string, int> groupCounts; 
     map<string, string> groupMap;
     
+    vector<int> convertQual(string);
     fastqRead readFastq(ifstream&, bool&);
     vector< vector< vector<string> > > preProcessData(unsigned long int&);
     vector< vector<string> > readFileNames(string);
@@ -107,7 +109,7 @@ struct contigsData {
        MothurOut* m;
        float match, misMatch, gapOpen, gapExtend;
        int count, threshold, threadID, pdiffs, bdiffs, tdiffs;
-    bool allFiles, createGroup;
+    bool allFiles, createGroup, done;
     map<string, int> groupCounts; 
     map<string, string> groupMap;
     vector<string> primerNameVector;   
@@ -143,6 +145,7 @@ struct contigsData {
         allFiles = all;
         createGroup = cg;
                threadID = tid;
+        done=false;
        }
 };
 
@@ -159,7 +162,7 @@ static DWORD WINAPI MyContigsThreadFunction(LPVOID lpParam){
         if(pDataArray->align == "gotoh")                       {       alignment = new GotohOverlap(pDataArray->gapOpen, pDataArray->gapExtend, pDataArray->match, pDataArray->misMatch, longestBase);                 }
                else if(pDataArray->align == "needleman")       {       alignment = new NeedlemanOverlap(pDataArray->gapOpen, pDataArray->match, pDataArray->misMatch, longestBase);                            }
         
-        int num = 0;
+        pDataArray->count = 0;
         string thisffastafile = pDataArray->files[0];
         string thisfqualfile = pDataArray->files[1];
         string thisrfastafile = pDataArray->files[2];
@@ -394,14 +397,14 @@ static DWORD WINAPI MyContigsThreadFunction(LPVOID lpParam){
                     outScrapQual << endl;
                 }
             }
-            num++;
+            pDataArray->count++;
             
                        //report progress
-                       if((num) % 1000 == 0){  pDataArray->m->mothurOut(toString(num)); pDataArray->m->mothurOutEndLine();             }
+                       if((pDataArray->count) % 1000 == 0){    pDataArray->m->mothurOut(toString(pDataArray->count)); pDataArray->m->mothurOutEndLine();               }
                }
         
                //report progress
-               if((num) % 1000 != 0){  pDataArray->m->mothurOut(toString(num)); pDataArray->m->mothurOutEndLine();             }
+               if((pDataArray->count) % 1000 != 0){    pDataArray->m->mothurOut(toString(pDataArray->count)); pDataArray->m->mothurOutEndLine();               }
         
         inFFasta.close();
         inRFasta.close();
@@ -416,6 +419,7 @@ static DWORD WINAPI MyContigsThreadFunction(LPVOID lpParam){
         }
         delete alignment;
         
+        pDataArray->done = true;
         if (pDataArray->m->control_pressed) {  pDataArray->m->mothurRemove(pDataArray->outputFasta);  pDataArray->m->mothurRemove(pDataArray->outputMisMatches);  pDataArray->m->mothurRemove(pDataArray->outputScrapFasta);  if (thisfqualfile != "") { pDataArray->m->mothurRemove(pDataArray->outputQual); pDataArray->m->mothurRemove(pDataArray->outputScrapQual); } }
         
         return 0;