[Seqan-dev] compatibility of repeat_base's operators with stl container adaptations


Hi,

I observed that findRepeats() from repeat_base.h relies on _operator[]_ and _resize()_ to work for the given type TRepeatStore &repString.

line 504:
    findRepeats(TRepeatStore &repString, ..){
        ...
        // copy low-complex regions to result string
        resize(repString, list.size());
        typename TRepeatList::const_iterator lit = list.begin();
        typename TRepeatList::const_iterator litEnd = list.end();
        for (TSize i = 0; lit != litEnd; ++lit, ++i)
            repString[i] = (*lit).second;
    }

I'm currently the adaptation of std::list rather than a StringSet, which does not (yet) contain proper functionality for these functions.

I like to propose the following change to this class:

    findRepeats(TRepeatStore &repString, ..){
        ...
        // copy low-complex regions to result string
        typename TRepeatList::const_iterator lit = list.begin();
        typename TRepeatList::const_iterator litEnd = list.end();
        for (TSize i = 0; lit != litEnd; ++lit, ++i)
            appendValue(repString, (*lit).second);
    }

Alternatively, the adaptions from the STL should probably get some additional functionality.

Cheers,
Fabian

--
Fabian Buske
Institute for Molecular Bioscience
The University of Queensland
Brisbane, Qld. 4072 Australia
Phone: (61)-(7)-334-62641