X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=filters.h;fp=filters.h;h=21bc8bb5eec729d7b3f59d06d2a6cc6aff09080a;hb=0caf3fbabaa3ece404f8ce77f4c883dc5b1bf1dc;hp=0000000000000000000000000000000000000000;hpb=1b73ff67c83892a025e597dabd9df6fe7b58206a;p=mothur.git diff --git a/filters.h b/filters.h new file mode 100644 index 0000000..21bc8bb --- /dev/null +++ b/filters.h @@ -0,0 +1,112 @@ +#ifndef FILTERS_H +#define FILTERS_H + +/* + * filters.h + * Mothur + * + * Created by Sarah Westcott on 6/29/09. + * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved. + * + */ + +#include "mothur.h" +#include "sequence.hpp" + + +/***********************************************************************/ + +class Filters { + +public: + Filters() { m = MothurOut::getInstance(); }; + ~Filters(){}; + + string getFilter() { return filter; } + void setFilter(string s) { filter = s; } + void setLength(int l) { alignmentLength = l; } + 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); + t.assign(alignmentLength, 0); + g.assign(alignmentLength, 0); + c.assign(alignmentLength, 0); + gap.assign(alignmentLength, 0); + } + + void doSoft() { + int threshold = int (soft * numSeqs); + + for(int i=0;iopenInputFile(hard, fileHandle); + + fileHandle >> filter; + + fileHandle.close(); + } + + void getFreqs(Sequence seq) { + + string curAligned = seq.getAligned(); + + for(int j=0;j