rna.h
1.2 KB
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
#ifndef DEF_RNA
#define DEF_RNA
#include <Eigen/Core>
#include <map>
#include <sstream>
#include <string>
#include <vector>
using Eigen::MatrixXf;
using std::map;
using std::pair;
using std::string;
using std::vector;
#ifndef NUPACK_SHARED_CONSTANTS_H__
enum base_t { BASE_N = 0, BASE_A, BASE_C, BASE_G, BASE_U }; // Comment if you include nupack/shared.h
#else
typedef int base_t;
#endif
enum pair_t { PAIR_AU = 0, PAIR_CG, PAIR_GC, PAIR_UA, PAIR_GU, PAIR_UG, PAIR_OTHER = -1 };
class RNA
{
public:
RNA(void);
RNA(string name, string seq, bool verbose);
float get_pij(int i, int j);
string get_seq(void) const;
uint get_RNA_length(void) const;
void print_basepair_p_matrix(float theta) const;
bool verbose_; // Should we print things ?
private:
base_t base_type(char x) const;
string name_; // name of the rna
string seq_; // sequence of the rna with chars
uint n_; // length of the rna
MatrixXf pij_; // matrix of basepair probabilities
};
inline float RNA::get_pij(int i, int j) { return pij_(i, j); }
inline uint RNA::get_RNA_length() const { return n_; }
inline string RNA::get_seq(void) const { return seq_; }
#endif