[Seqan-dev] finding mates in fragment store


Hi Guys!

I am loading a SAM file into a fragment store and would like to enter all the reads which have a mate into a graph, if the mate's were aligned to different contigs. I am not sure how to search the FragmentStore for a certain read id. I got:

...
    unsigned int nrAlignments = length(fragStore.alignedReadStore),mateCounter=0;

    for (unsigned int n=0;n<nrAlignments;++n){

        unsigned int mate_id = fragStore.alignedReadStore[n].pairMatchId;

        if(mate_id!=TReadStoreElement::INVALID_ID){
            ++mateCounter;
            std::cout << "read-id: " << n << ","<<fragStore.alignedReadStore[n].readId << std::endl;
            std::cout << "pair-id: " << fragStore.alignedReadStore[n].pairMatchId << std::endl;
            std::cout << "contig-id: " << fragStore.alignedReadStore[n].contigId << std::endl;

            //get mate contig-id

>>> the Fragment store is not indexed by the read_id...
            std::cout << "read-id: " << fragStore.alignedReadStore[mate_id].readId << std::endl;
            std::cout << "pair-id: " << fragStore.alignedReadStore[mate_id].pairMatchId << std::endl;
            std::cout << "contig-id: " << fragStore.alignedReadStore[mate_id].contigId << std::endl;
<<<<

            //ceck if congtig-ids are unequal...

            //insert into graph...
            break;
        }
    }
...

Thanks!

Best,

mat