void makeMatch(vector<string>& matches, int n) {
     if (n == 1) return;
     for (int i = 0; i < n / 2; ++i) {
         matches[i] = "(" + matches[i] + "," + matches[n-1-i] + ")";
     }
     makeMatch(matches, n / 2);
 }
Exemple #2
0
Match* FusionMapper::mapRead(Read* r, bool& mapable, int distanceReq, int qualReq) {
    vector<SeqMatch> mapping = mIndexer->mapRead(r);
    
    //we only focus on the reads that can be mapped to two genome positions
    if(mapping.size() < 2){
        mapable = false;
        return NULL;
    }

    mapable = true;

    //if the left part of mapping result is reverse, use its reverse complement alternative and skip this one
    if(!mIndexer->inRequiredDirection(mapping)) {
        return NULL;
    }

    /*cout<<r->mName<<endl;
    cout<<r->mSeq.mStr<<endl;
    cout << mapping.size() << " mappings " << endl;
    vector<SeqMatch>::iterator iter;
    for(iter = mapping.begin(); iter!=mapping.end(); iter++){
        iter->print();
        cout << endl;
    }
    cout << endl;*/

    // TODO: set int readBreak, int leftContig, int leftPos, int rightContig, int rightPos
    Match* m = makeMatch(r, mapping);
    return m;
}
 string findContestMatch(int n) {
     vector<string> matches;
     for (int i = 0; i < n; ++i) {
         matches.push_back(to_string(i+1));
     }
     makeMatch(matches, n);
     return matches[0];
 }