FU Logo
  • Startseite
  • Kontakt
  • Impressum
  • Home
  • Listenauswahl
  • Anleitungen

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

<-- thread -->
<-- date -->
  • From: "Holtgrewe, Manuel" <manuel.holtgrewe@fu-berlin.de>
  • To: SeqAn Development <seqan-dev@lists.fu-berlin.de>
  • Date: Mon, 9 May 2011 16:30:47 +0200
  • Acceptlanguage: en-US, de-DE
  • Reply-to: SeqAn Development <seqan-dev@lists.fu-berlin.de>
  • Subject: Re: [Seqan-dev] compatibility of repeat_base's operators with stl container adaptations

Hi Fabian,

changesets [9609] [9610] should make findRepeats() more generic. Note that I used reserve() regardless of the type of repString since it can be implemented for both lists and strings. The code using appendValue() will then be roughly equivalent to the existing code for Strings, i.e. only one reallocation of space. For lists, reserve() does nothing, but appendValue() always works efficiently for lists.

Please test whether this works and report back any problems.

Bests,
Manuel

Am 09.05.2011 um 06:04 schrieb Fabian Buske:

> 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
> 
> _______________________________________________
> seqan-dev mailing list
> seqan-dev@lists.fu-berlin.de
> https://lists.fu-berlin.de/listinfo/seqan-dev




<-- thread -->
<-- date -->
  • Follow-Ups:
    • Re: [Seqan-dev] compatibility of repeat_base's operators with stl container adaptations
      • From: Fabian Buske <f.buske@uq.edu.au>
  • References:
    • [Seqan-dev] compatibility of repeat_base's operators with stl container adaptations
      • From: Fabian Buske <f.buske@uq.edu.au>
  • seqan-dev - May 2011 - Archives indexes sorted by:
    [ thread ] [ subject ] [ author ] [ date ]
  • Complete archive of the seqan-dev mailing list
  • More info on this list...

Hilfe

  • FAQ
  • Dienstbeschreibung
  • ZEDAT Beratung
  • postmaster@lists.fu-berlin.de

Service-Navigation

  • Startseite
  • Listenauswahl

Einrichtung Mailingliste

  • ZEDAT-Portal
  • Mailinglisten Portal