]> git.donarmstrong.com Git - mothur.git/blobdiff - filters.h
changes while testing
[mothur.git] / filters.h
index 94f8d33c0329793f3e1c39c0ea0c467f53493357..b00cb35afb66aff2fbe2a132ccf4491b17b8cd35 100644 (file)
--- a/filters.h
+++ b/filters.h
@@ -19,7 +19,7 @@
 class Filters {
 
 public:
-       Filters() {};
+       Filters() { m = MothurOut::getInstance(); };
        ~Filters(){};
                
        string getFilter()                      {       return filter;          }
@@ -46,6 +46,14 @@ public:
                        if(a[i] < threshold && t[i] < threshold && g[i] < threshold && c[i] < threshold){       filter[i] = 0;  }
                }
        }
+
+       void mergeFilter(string newFilter){
+               for(int i=0;i<alignmentLength;i++){
+                       if(newFilter[i] == '0'){
+                               filter[i] = 0;
+                       }
+               }
+       }
        
        void doVertical() {
 
@@ -69,11 +77,13 @@ public:
 
        void doHard(string hard) {
                ifstream fileHandle;
-               openInputFile(hard, fileHandle);
+               m->openInputFile(hard, fileHandle);
        
                fileHandle >> filter;
        
                fileHandle.close();
+        
+        if (filter.length() != alignmentLength) {  m->mothurOut("[ERROR]: Sequences are not all the same length as the filter, please correct.\n");  m->control_pressed = true; }
        }
 
        void getFreqs(Sequence seq) {
@@ -94,6 +104,7 @@ protected:
        int alignmentLength, numSeqs;
        float soft;
        char trump;
+       MothurOut* m;
 
 };