[Seqan-dev] problem with interval tree - assertion failed


Hey guys!

I got a problem with the interval tree. I want to load contigs and create intervals of the contigs sizes:

    //Interval tree construction
    typedef int TValue; //position type
    typedef gip::MappedFragment TCargo; // interval id type
    typedef IntervalAndCargo<TValue, TCargo*> TInterval;// interval type
    typedef IntervalTree<TValue, TCargo*> TIntervalTree;// interval tree type

    std::cout << "Loading contigs file..." << std::endl;
    if(!loadContigs(fragStore,genomeFileName)){
            std::cerr << "Error opening genome file!" << std::endl;
            return -1;
    }

    unsigned int numberOfContigs = length(fragStore.contigNameStore);
    std::cout << "Found " << numberOfContigs << " contigs in genome file." << std::endl;

    std::map<CharString, TIntervalTree*> contigMap;

    for(unsigned int n=0;n<numberOfContigs;++n){
        std::cout << "NAME: " << fragStore.contigNameStore[n] << std::endl;
        std::cout << "LENGTH: " << length(fragStore.contigStore[n].seq) << std::endl;
        TIntervalTree *tree = new TIntervalTree;
        TInterval in;
        in.i1 = 0;
        in.i2 = length(fragStore.contigStore[n].seq);
        in.cargo = NULL;

        addInterval(*tree, in);

     }

output:
=======
Loading contigs file...
Found 40 contigs in genome file.
/Users/mat/cpp_develop/seqan-trunk/projects/library/seqan/sequence/string_base.hNAME: 1
LENGTH: 6844
:219 Assertion failed : static_cast<TStringPos>(pos) < static_cast<TStringPos>(length(me)) was: 0 >= 0 (Trying to access an element behind the last one!)

if i remove the "addInterval" statement i get the output for each contig...

thanks!

best,

mat