X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=filters.h;h=b00cb35afb66aff2fbe2a132ccf4491b17b8cd35;hb=250e3b11b1c9c1e1ad458ab6c7e71ac2e67e11d9;hp=4c396070a911000018710a3b652f2f81439e1db7;hpb=7e354c9abb09ea3cf5b500a16cc7f6dd79ccb6f5;p=mothur.git diff --git a/filters.h b/filters.h index 4c39607..b00cb35 100644 --- a/filters.h +++ b/filters.h @@ -19,7 +19,7 @@ class Filters { public: - Filters() {}; + Filters() { m = MothurOut::getInstance(); }; ~Filters(){}; string getFilter() { return filter; } @@ -28,6 +28,8 @@ public: void setSoft(float s) { soft = s; } void setTrump(float t) { trump = t; } void setNumSeqs(int num) { numSeqs = num; } + vector a, t, g, c, gap; + void initialize() { a.assign(alignmentLength, 0); @@ -44,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;iopenInputFile(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) { @@ -89,10 +101,10 @@ public: protected: string filter; - vector a, t, g, c, gap; int alignmentLength, numSeqs; float soft; char trump; + MothurOut* m; };