File: MappingResult.cpp

package info (click to toggle)
perm 0.4.0-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 976 kB
  • sloc: cpp: 13,499; makefile: 98; sh: 12
file content (65 lines) | stat: -rw-r--r-- 1,755 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include "MappingResult.h"
CMappingResult::CMappingResult(void)
{
    this->initialization();
}

CMappingResult::CMappingResult(CAlignmentsQ& aQue, unsigned int uiReadLength = 0)
{
    initialization();
    this->uiReadLength = uiReadLength;
    this->uiDiff = aQue.MinDiff; //This is the minimum distance of mappings
    this->MultipleMappedNo = aQue.load;
    myStrCpy(this->QNAME, aQue.tag, FILENAME_MAX);
    // aQue.read.decode(this->caRead);
}

CMappingResult::~CMappingResult(void)
{
    ;
}

void CMappingResult::initialization(void)
{
    this->QNAME[0] = '\0';
    this->FLAG = 0;
    this->strand = '+';
    this->RNAME[0] = '\0';
    this->uiPOS = 0;
    this->MAPQ = 0;
    this->CIGAR[0] = '\0';
    this->MRNM[0] = '\0';
    this->uiMPOS = 0;
    this->ISIZE = 0;
    this->caRead[0] = '\0';
    this->QScores[0] = '\0';
    this->revComRead[0] = '\0';
    this->revQScores[0] = '\0';
    this->rawScores[0] = '\0';
    this->TAG[0] = '\0';
    this->SNPtype = ' ';
    this->caRef[0] = '\0';
    this->mismatchScore = 0;
    this->uiReadLength = 0;
    this->isColorRead = false;
    // this->uiDiff = 0; // TODO uncomment it
}

// currently not used
string get_diff_bases_bt_read_ref(const char* ref, const char* read)
{
    char diff_bases_list[MAX_LINE];
    vector<int> mis;
    for (unsigned int i = 0; read[i] != '\0'; i++) {
        if (read[i] != ref[i]) {
            mis.push_back(i+1);
        }
    }
    int j = 0;
    for (vector<int>::iterator it = mis.begin(); it != mis.end(); it++) {
        sprintf(&(diff_bases_list[j]), "%d_%c,", *it, ref[*it]);
        j += ((*it < 10) ? 3 : 4); // assume read length < 100
        if ( *it >= 100) j++;      // assume read length < 1000
    }
    return(string(diff_bases_list));
}