Skip to content

Instantly share code, notes, and snippets.

@soh-i
Created July 30, 2012 11:36
Show Gist options
  • Save soh-i/3206360 to your computer and use it in GitHub Desktop.
Save soh-i/3206360 to your computer and use it in GitHub Desktop.
SeqAnのチュートリアル
#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