-
Notifications
You must be signed in to change notification settings - Fork 1
/
bam_alignment_record.h
139 lines (114 loc) · 4.42 KB
/
bam_alignment_record.h
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
127
128
129
130
131
132
133
134
135
136
137
138
139
#ifndef _CORE_BAMALIGNMENTRECORD_H_
#define _CORE_BAMALIGNMENTRECORD_H_
#include<cstdio>
#include<string>
#include<vector>
#include<utility>
/**
.Class.BamAlignmentRecord
..cat:BAM I/O
..summary:Represent a record from a BAM/SAM file.
..remarks:While also used to represent SAM records, called $BamAlignmentRecord$ since the data directly reflects a BAM record (0-based positions, identify references by ids, not names, tags stored in BAM format.)
..include:seqan/bam_io.h
..see:Enum.BamFlags
.Memfunc.BamAlignmentRecord#BamAlignmentRecord
..class:Class.BamAlignmentRecord
..summary:Constructor.
..signature:BamAlignmentRecord()
..remarks:Only the default constructor is provided.
.Memvar.BamAlignmentRecord#INVALID_POS
..class:Class.BamAlignmentRecord
..summary:Static member with invalid/sentinel position value.
..type:nolink:$__uint32$
.Memvar.BamAlignmentRecord#INVALID_REFID
..class:Class.BamAlignmentRecord
..summary:Static member with invalid/sentinel reference id (-1 as in BAM/SAM).
..type:nolink:$__int32$
.Memvar.BamAlignmentRecord#INVALID_LEN
..class:Class.BamAlignmentRecord
..summary:Static member with invalid/sentinel position value.
..type:nolink:$__int32$
.Memvar.BamAlignmentRecord#qName
..class:Class.BamAlignmentRecord
..summary:The read/query name.
..type:Shortcut.CharString
.Memvar.BamAlignmentRecord#flag
..class:Class.BamAlignmentRecord
..summary:The flag of this mapping, see @Enum.BamFlags@ for flag constants and the $hasFlag*$ functions.
..type:nolink:$__uint16$
.Memvar.BamAlignmentRecord#rId
..class:Class.BamAlignmentRecord
..summary:ID of reference for this fragment mapping (0-based, $INVALID_REFID$ for '*').
..type:Shortcut.CharString
.Memvar.BamAlignmentRecord#pos
..class:Class.BamAlignmentRecord
..summary:The position of this fragment mapping (0-based, $INVALID_POS$ for '*').
..type:Shortcut.CharString
.Memvar.BamAlignmentRecord#mapQ
..class:Class.BamAlignmentRecord
..summary:The mapping quality (255 for '*').
..type:nolink:$__uint8$
.Memvar.BamAlignmentRecord#bin
..class:Class.BamAlignmentRecord
..summary:The bin of the alignment, automatically computed when writing BAM.
..type:nolink:$__uint16$
.Memvar.BamAlignmentRecord#cigar
..class:Class.BamAlignmentRecord
..summary:The CIGAR string as string of @Class.CigarElement@ objects (empty for '*').
..type:nolink:$String<CigarElement<> >$
.Memvar.BamAlignmentRecord#rNextId
..class:Class.BamAlignmentRecord
..summary:ID of reference for next fragment mapping (0-based, $INVALID_REFID$ for '*')
..type:nolink:$__int32$
.Memvar.BamAlignmentRecord#pNext
..class:Class.BamAlignmentRecord
..summary:Position of next fragment mapping (0-based, $INVALID_POS$ for '*')
..type:nolink:$__uint32$
.Memvar.BamAlignmentRecord#tLen
..class:Class.BamAlignmentRecord
..summary:The inferred template size ($INVALID_LEN$ for '*')
..type:nolink:$__int32$
.Memvar.BamAlignmentRecord#seq
..class:Class.BamAlignmentRecord
..summary:The sequence string (empty for '*').
..type:Shortcut.CharString
.Memvar.BamAlignmentRecord#qual
..class:Class.BamAlignmentRecord
..summary:String with Phred scores (as in SAM file, empty for '*').
..type:Shortcut.CharString
.Memvar.BamAlignmentRecord#tags
..class:Class.BamAlignmentRecord
..summary:Raw BAM tag string, use @Class.BamTagsDict@ for comfortable access.
..type:Shortcut.CharString
*/
class BamAlignmentRecord
{
public:
std::string qName; // QNAME
int flag; // FLAG
std::string rName; // REF SEQ NAME
int rID; // REF SEQ ID
int pos; // POS
int mapQ; // MAPQ mapping quality, 255 for */invalid
int bin; // bin for indexing
std::vector< std::pair<std::string,int> > cigar; // CIGAR string
int rNextID; // Ref ID of the next segment
std::string rNext; // RNEXT (0-based)
int pNext; // PNEXT (0-based)
int tLen; // TLEN
std::string seq; // SEQ, as in SAM/BAM file.
std::string qual; // Quality string as in SAM (Phred).
std::string tags; // Tags, raw as in BAM.
// Constants for marking pos, reference id and length members invalid (== *).
/* static int const INVALID_POS = MaxValue<int>::VALUE;
static int const INVALID_REFID = -1;
static int const INVALID_LEN = MaxValue<int>::VALUE;*/
BamAlignmentRecord(){}
};
//class BamAlignment
//{
//public:
// std::vector<BamAlignmentRecord> records;
//
//};
#endif