1 #include <iostream>
2 #include <fstream>
3 #include <string>
4 #include <vector>
5 #include "stHashIterator.hpp"
6 using namespace std;
7
main(int argc,const char * argv[])8 int main(int argc, const char *argv[])
9 {
10 size_t countOnes=0;
11
12 std::vector<std::string> seedString;
13 seedString.push_back("110001100111000001110100110110100010011101");
14 seedString.push_back("000001111100101110111000001011010100011110");
15 seedString.push_back("011110001010110100000111011101001111100000");
16 seedString.push_back("101110010001011011001011100000111001100011");
17
18
19 /* test sequence */
20 //std::string seq = "GAGTGTCAAACATTCAGACAACAGCAGGGGTGCTCTGGAATCCTATGTGAGGAACAAACATTCAGGCCACAGTAG";
21
22 /* h is the number of spaced seeds and k is the length of spaced seeds */
23 unsigned h, k;
24 h = seedString.size();
25 k = seedString[0].size();
26
27 std::vector<std::vector<unsigned> > seedSet = parseSeed(seedString);
28
29 clock_t sTime = clock();
30 std::ifstream in(argv[argc-1]);
31 bool good = true;
32 for(string seq, hseq; good;) {
33 good = static_cast<bool>(getline(in, hseq));
34 good = static_cast<bool>(getline(in, seq));
35 good = static_cast<bool>(getline(in, hseq));
36 good = static_cast<bool>(getline(in, hseq));
37 if(good){
38 stHashIterator ssitr(seq, seedSet, h, k);
39 while (ssitr != ssitr.end()) {
40 if((ssitr.strandArray())[0])
41 ++countOnes;
42 ++ssitr;
43 }
44 }
45
46 }
47
48 std::cerr<< countOnes << std::endl;
49 std::cerr << (double)(clock() - sTime)/CLOCKS_PER_SEC << "\n";
50
51
52 return 0;
53 }
54