-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdata.hpp
52 lines (47 loc) · 1.31 KB
/
data.hpp
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
// STEAK Specific Transposable Element Aligner (HERV-K)
// Copyright (C) 2015 Cindy Santander, Philippe Gambron
// Distributed under the GNU General Public License version 3 (GPLv3.txt or https://www.gnu.org/licenses/gpl-3.0.html)
#ifndef DATA_HPP
#define DATA_HPP
#include "samdata.hpp"
#include <string>
#include <vector>
#include <map>
class Read{
public:
std::string chromosome;
std::string name;
int position;
int quality;
double cigarValue;
std::string sequence;
std::string phred;
std::string cigarString;
int set(const SAMData& samData);
//int set(const std::string& i_chromosome, const std::string& i_name, const int i_position, const int i_quality, const std::string& i_sequence, const std::string& i_phred);
int set(const std::string& i_name, const std::string& i_sequence, const std::string& i_phred="");
};
/*
class Pair{
public:
std::string name;
Read reads[2];
int set(const SAMData& samData1, const SAMData& samData2);
inline Read& operator[](int i){
return reads[i];
}
};
*/
inline std::string create_complement(const std::string& sequence){
std::string s, c;
std::map<std::string, std::string> corr;
corr["A"]="T";
corr["G"]="C";
corr["C"]="G";
corr["T"]="A";
for(int i=sequence.length()-1; i>=0; --i){
s=s+corr[sequence.substr(i, 1)];
}
return s;
}
#endif