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

Re: [Seqan-dev] problem with interval tree - assertion failed - how to use addInterval?

<-- thread -->
<-- date -->
  • From: Mat <matthias.dodt@mdc-berlin.de>
  • To: seqan-dev@lists.fu-berlin.de
  • Date: Fri, 26 Nov 2010 16:14:16 +0100
  • Reply-to: SeqAn Development <seqan-dev@lists.fu-berlin.de>
  • Subject: Re: [Seqan-dev] problem with interval tree - assertion failed - how to use addInterval?

Hi,

Okay if i so it like in the examples, it works but: How do i access "intervals" later in case i want to add an interval to the tree? then i would have to resize the "intervals" String? How does addInterval work?

thanks!

best,

mat

2nd version >>>

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;

        String<TInterval> intervals;
        resize(intervals,1);

        TInterval in;
        intervals[0].i1 = 0;
        intervals[0].i2 = length(fragStore.contigStore[n].seq);
        gip::MappedFragment f;
        intervals[0].cargo = f;


        TIntervalTree *tree = new TIntervalTree(intervals);
        contigMap[fragStore.contigNameStore[n]] = tree;
    }

<<<

Am 11/26/10 1:52 PM, schrieb Mat:
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
_______________________________________________ seqan-dev mailing list seqan-dev@lists.fu-berlin.de https://lists.fu-berlin.de/listinfo/seqan-dev
<-- thread -->
<-- date -->
  • References:
    • [Seqan-dev] problem with interval tree - assertion failed
      • From: Mat <matthias.dodt@mdc-berlin.de>
  • seqan-dev - November 2010 - 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