1 #include <seqan/sequence.h> 2 #include <seqan/index.h> 3 4 using namespace seqan; 5 main()6int main() 7 { 8 DnaString text = "AAAACACAGTTTGA"; 9 Shape<Dna, UngappedShape<3> > myShape; 10 11 // loop using hash() and hashNext() starts at position 1 12 std::cout << hash(myShape, begin(text)) << '\t'; 13 for (unsigned i = 1; i < length(text) - length(myShape) + 1; ++i) 14 std::cout << hashNext(myShape, begin(text) + i) << '\t'; 15 std::cout << std::endl; 16 17 // loop using hashInit() and hashNext() starts at position 0 18 hashInit(myShape, begin(text)); 19 for (unsigned i = 0; i < length(text) - length(myShape) + 1; ++i) 20 std::cout << hashNext(myShape, begin(text) + i) << '\t'; 21 std::cout << std::endl; 22 23 return 0; 24 } 25