8 * Created by Sarah Westcott on 6/29/09.
9 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
14 #include "sequence.hpp"
17 /***********************************************************************/
25 string getFilter() { return filter; }
26 void setFilter(string s) { filter = s; }
27 void setLength(int l) { alignmentLength = l; }
28 void setSoft(float s) { soft = s; }
29 void setTrump(float t) { trump = t; }
30 void setNumSeqs(int num) { numSeqs = num; }
33 a.assign(alignmentLength, 0);
34 t.assign(alignmentLength, 0);
35 g.assign(alignmentLength, 0);
36 c.assign(alignmentLength, 0);
37 gap.assign(alignmentLength, 0);
41 int threshold = int (soft * numSeqs);
43 for(int i=0;i<alignmentLength;i++){
44 if(a[i] < threshold && t[i] < threshold && g[i] < threshold && c[i] < threshold){ filter[i] = 0; }
50 for(int i=0;i<alignmentLength;i++){
51 if(gap[i] == numSeqs) { filter[i] = '0'; }
56 void doTrump(Sequence seq) {
58 string curAligned = seq.getAligned();
60 for(int j = 0; j < alignmentLength; j++) {
61 if(curAligned[j] == trump){
68 void doHard(string hard) {
70 openInputFile(hard, fileHandle);
77 void getFreqs(Sequence seq) {
79 string curAligned = seq.getAligned();
81 for(int j=0;j<alignmentLength;j++){
82 if(toupper(curAligned[j]) == 'A') { a[j]++; }
83 else if(toupper(curAligned[j]) == 'T' || toupper(curAligned[j]) == 'U') { t[j]++; }
84 else if(toupper(curAligned[j]) == 'G') { g[j]++; }
85 else if(toupper(curAligned[j]) == 'C') { c[j]++; }
86 else if(curAligned[j] == '-' || curAligned[j] == '.') { gap[j]++; }
92 vector<int> a, t, g, c, gap;
93 int alignmentLength, numSeqs;
99 /***********************************************************************/