-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCigarParser.h
54 lines (45 loc) · 1.27 KB
/
CigarParser.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
// cigarParser.h
// Author: Izaak Coleman
#ifndef CIGAR_PARSER
#define CIGAR_PARSER
#include <string>
class CigarParser {
/* Provides array access to cigar elements as the main functional interface.
Two functions in the main functional interface:
CigarParser::length_at(i) -> returns number of bases assigned to operation i.
CigarParser::operation_at(i) -> returns char representing operation i.
e.g cp = CigarParser("80M12I8M");
cout << cp.operation_at(1) << endl;
cout << cp.length_at(1) << endl;
will print to stdout:
I
12
*/
private:
std::string CIGAR; // The CIGAR STRING
int64_t sz; // # operations in CIGAR
public:
CigarParser(std::string const& cig);
/*
Takes CIGAR as input.
*/
CigarParser(std::string const & cig, bool const reverse);
/*
Takes CIGAR as input. If reverse == true, then the CIGAR string
is saved in reverse; this is useful when analysing reverse complements
of aligned fastqs.
*/
int64_t length_at(int64_t const i) const;
/*
Returns number of bases assigned to operation i.
*/
char operation_at(int64_t const i) const;
/*
Returns char representing operation i.
*/
int64_t size() const;
/*
Returns number of operations in CIGAR;
*/
};
#endif