[Seqan-dev] Help me


Hello


Please, help me.

I have problem using a external file such as lagan1.fasta (Escherichia coli) with demo program: find_exact.cpp.
During the running of the program, the program no count occurrences of needle in the haystack.


Could you say me how to solve this problem.


Thanks.

Julio


/// THE CODE OF MY PROBLEM

#include <iostream>
#include <seqan/find.h>

#include <fstream>
#include <cstdio>

#include <seqan/sequence.h>
#include <seqan/file.h>


using namespace seqan;

int main()
{

// Open a file using a file reader string.
    String<char> my_haystack = String<char, FileReader<Fasta> > ("lagan1.fasta");

    String<char> my_needle = "GATC";

    Finder<String<char> > finder(my_haystack);
    Pattern<String<char>, Horspool> pattern(my_needle);
   
// proof printing: correct printing
    ::std::cout << my_haystack << "\n\n\n"; 
    ::std::cout << my_needle << "\n";   

// the problem: no count the find position of my_needle within the my_haystack.
// How to solve this problem?

    while (find(finder, pattern))
    {
        ::std::cout << position(finder) << ","; 
    }                         

    ::std::cout << ::std::endl;


    // fstrm.close();
    return (0);
}