File: CmpAlignment.hpp

package info (click to toggle)
pbseqlib 0~20161219-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,924 kB
  • ctags: 5,123
  • sloc: cpp: 82,727; makefile: 305; python: 239; sh: 8
file content (126 lines) | stat: -rw-r--r-- 3,043 bytes parent folder | download | duplicates (2)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#ifndef DATASTRUCTURES_ALIGNMENT_CMP_ALIGNMENT_H_
#define DATASTRUCTURES_ALIGNMENT_CMP_ALIGNMENT_H_
#include <map>
#include <vector>
#include <string>
#include <iostream>
#include <assert.h>
#include <algorithm>

#include "../Types.h"
#include "../Enumerations.h"

class CmpAlignmentBase  {
public:
    //
    // For use in referencing alignment sets. TODO: subclass.
    //
    PlatformId platformId;
    int Z;
    unsigned int index, readGroupId, movieId, refSeqId; 
    unsigned int expId, runId, panel;
    unsigned int x, y;
    unsigned int rcRefStrand;
    unsigned int holeNumber;
    unsigned int offsetBegin, offsetEnd;
    unsigned int setNumber, strobeNumber, mapQV, nBackRead, nReadOverlap;
    unsigned int subreadId;
    unsigned int nMatch, nMismatch, nIns, nDel;
    std::vector<unsigned char> alignmentArray;
    std::vector<unsigned int> alignmentIndex;
    static std::map<std::string,int> columnNameToIndex;
    static bool initializedColumnNameToIndex;
    std::map<std::string, std::vector<UChar> > fields;

    unsigned int *GetAlignmentIndex(); 

    int GetAlignmentIndexSize(); 

    unsigned int GetAlignedStrand(); 

    unsigned int GetRCRefStrand(); 

    // synonym 
    unsigned int GetTStrand(); 

    bool GetX(int &xp); 

    unsigned int GetAlignmentId(); 

    unsigned int GetX(); 

    unsigned int GetY(); 

    unsigned int GetMovieId(); 

    unsigned int GetAlnGroupId(); 

    unsigned int GetReadGroupId(); 

    unsigned int LookupColumnValue(const char * columnName); 

    void InitializeColumnNameToIndex(std::vector<std::string> &columnNames); 

    unsigned int GetHoleNumber(); 

    unsigned int GetRefGroupId(); 

    unsigned int GetRefSeqId(); 

    unsigned int GetOffsetBegin(); 

    unsigned int GetOffsetEnd(); 

    unsigned int GetQueryStart();

    unsigned int GetQueryEnd(); 

    unsigned int GetRefStart(); 

    unsigned int GetRefEnd();

    unsigned int GetNMatch(); 

    unsigned int GetNMismatch();

    unsigned int GetNInsertions();

    unsigned int GetNDeletions(); 

    unsigned int GetMapQV(); 

    unsigned int GetSubreadId(); 

    unsigned int GetStrobeNumber(); 

    unsigned int GetSetNumber(); 

    CmpAlignmentBase(PlatformId platformIdP=Springfield); 

    void SetPlatformId(PlatformId platformIdP); 
};

class CmpAlignment : public CmpAlignmentBase {
public:
    int qStrand, tStrand;
    DNALength qStart, qLength;
    DNALength tStart, tLength;
    //
    // Default constructor just calls the base constructor to initialize platoformType
    CmpAlignment(PlatformId pid=Springfield);

    void StoreAlignmentIndex(unsigned int *alignmentIndexPtr, DSLength alignmentIndexLength);

    void StoreAlignmentArray(unsigned char* alignmentArrayPtr, DSLength alignmentArrayLength); 

    template<typename T_Field>
    void StoreField(std::string fieldName, T_Field* fieldValues, DSLength length); 

    CmpAlignment &operator=(const CmpAlignment &rhs); 

    int operator<(const CmpAlignment &rhs) const; 

};

#include "CmpAlignmentImpl.hpp"
#endif