Created
July 30, 2012 11:36
-
-
Save soh-i/3206360 to your computer and use it in GitHub Desktop.
SeqAnのチュートリアル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <seqan/sequence.h> | |
using namespace std; | |
int main () { | |
seqan::String<char> text = "this is test using by seqan"; | |
seqan::String<char> pattern = "test"; | |
seqan::String<int> score; | |
resize(score, seqan::length(text)); | |
for (unsigned i=0; i<seqan::length(text)-seqan::length(pattern)+1; i++) { | |
int localScore = 0; | |
for ( unsigned j = 0; j<seqan::length(pattern); j++) { | |
if ( text[j+i] == pattern[j] ){ | |
localScore++; | |
} | |
score[i] = localScore; | |
} | |
for ( unsigned i = 0; i < seqan::length(score); i++){ | |
std::cout << score[i] << "hit count"; | |
std::cout << std::endl; | |
return 0; | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment