]> git.donarmstrong.com Git - mothur.git/blobdiff - pcrseqscommand.h
added *.count.summary file to count.groups command. added deltaq and insert parameter...
[mothur.git] / pcrseqscommand.h
index 03092bca2a70da8428e77f5599e6ab200c2b8960..c6f7ff9c7f6670073a7080496f80eac1cdfb2a72 100644 (file)
@@ -15,6 +15,7 @@
 #include "trimoligos.h"
 #include "alignment.hpp"
 #include "needlemanoverlap.hpp"
+#include "counttable.h"
 
 class PcrSeqsCommand : public Command {
 public:
@@ -25,7 +26,9 @@ public:
        vector<string> setParameters();
        string getCommandName()                 { return "pcr.seqs";    }
        string getCommandCategory()             { return "Sequence Processing";         }
+       
        string getHelpString(); 
+    string getOutputPattern(string);   
        string getCitation() { return "http://www.mothur.org/wiki/Pcr.seqs"; }
        string getDescription()         { return "pcr.seqs"; }
     
@@ -44,8 +47,8 @@ private:
     vector<linePair> lines;
        bool getOligos(vector<vector<string> >&, vector<vector<string> >&, vector<vector<string> >&);
     bool abort, keepprimer, keepdots;
-       string fastafile, oligosfile, taxfile, groupfile, namefile, ecolifile, outputDir, nomatch;
-       int start, end, pdiffs, processors, length;
+       string fastafile, oligosfile, taxfile, groupfile, namefile, countfile, ecolifile, outputDir, nomatch;
+       int start, end, processors, length;
        
     vector<string> revPrimer, outputNames;
        vector<string> primers;
@@ -54,6 +57,7 @@ private:
     int readName(set<string>&);
     int readGroup(set<string>);
     int readTax(set<string>);
+    int readCount(set<string>);
     bool readOligos();
     bool readEcoli();
        int driverPcr(string, string, string, set<string>&, linePair);  
@@ -128,9 +132,9 @@ static DWORD WINAPI MyPcrThreadFunction(LPVOID lpParam){
                }
         
         set<int> lengths;
-               pDataArray->count = pDataArray->fend;
+               
                for(int i = 0; i < pDataArray->fend; i++){ //end is the number of sequences to process
-            
+            pDataArray->count++;
                        if (pDataArray->m->control_pressed) {  break; }
                        
                        Sequence currSeq(inFASTA); pDataArray->m->gobble(inFASTA);
@@ -315,11 +319,11 @@ static DWORD WINAPI MyPcrThreadFunction(LPVOID lpParam){
                         pDataArray->m->mothurOut("[ERROR]: seqs are not the same length as ecoli seq. When using ecoli option your sequences must be aligned and the same length as the ecoli sequence.\n"); pDataArray->m->control_pressed = true; break; 
                     }else {
                         if (pDataArray->keepdots)   { 
-                            currSeq.filterToPos(start); 
-                            currSeq.filterFromPos(end);
+                            currSeq.filterToPos(pDataArray->start); 
+                            currSeq.filterFromPos(pDataArray->end);
                         }else {
-                            string seqString = currSeq.getAligned().substr(0, end);
-                            seqString = seqString.substr(start);
+                            string seqString = currSeq.getAligned().substr(0, pDataArray->end);
+                            seqString = seqString.substr(pDataArray->start);
                             currSeq.setAligned(seqString); 
                         }
                     }
@@ -331,17 +335,17 @@ static DWORD WINAPI MyPcrThreadFunction(LPVOID lpParam){
                         if (pDataArray->end != -1) {
                             if (pDataArray->end > currSeq.getAligned().length()) {  pDataArray->m->mothurOut("[ERROR]: end is longer than your sequence length, aborting.\n"); pDataArray->m->control_pressed = true; break; }
                             else {
-                                if (pDataArray->keepdots)   { currSeq.filterFromPos(end); }
+                                if (pDataArray->keepdots)   { currSeq.filterFromPos(pDataArray->end); }
                                 else {
-                                    string seqString = currSeq.getAligned().substr(0, end);
+                                    string seqString = currSeq.getAligned().substr(0, pDataArray->end);
                                     currSeq.setAligned(seqString); 
                                 }
                             }
                         }
                         if (pDataArray->start != -1) { 
-                            if (pDataArray->keepdots)   {  currSeq.filterToPos(start);  }
+                            if (pDataArray->keepdots)   {  currSeq.filterToPos(pDataArray->start);  }
                             else {
-                                string seqString = currSeq.getAligned().substr(start);
+                                string seqString = currSeq.getAligned().substr(pDataArray->start);
                                 currSeq.setAligned(seqString); 
                             }
                         }