IntaRNA 3.4.1
RNA-RNA interaction prediction | C++ API
Loading...
Searching...
No Matches
NussinovHandler.h
Go to the documentation of this file.
1
2#ifndef INTARNA_NUSSINOV_HANDLER
3#define INTARNA_NUSSINOV_HANDLER
4
5#include "IntaRNA/general.h"
8#include <vector>
9#include <utility>
10
11#include "IntaRNA/Matrix.h"
12
13namespace IntaRNA {
14
16public:
17
20
23
26
27 /***
28 * Get the partition function Q between the indices (from, to)
29 * @param from The start index of the region
30 * @param to The end index of the region
31 * @param seq The RNA Sequence
32 * @param basePairWeight The Boltzmann weight for energy distribution
33 * @param minLoopLength The minimum length of loops
34 * @param Q Lookup table for Q
35 * @param Qb Lookup table for Qb
36 * @returns the partition function value
37 */
38 static Z_type getQ(const size_t from, const size_t to, const RnaSequence &seq,
39 const Z_type basePairWeight, const size_t minLoopLength,
40 Z2dMatrix &Q, Z2dMatrix &Qb);
41
42 /***
43 * Get the base partition function Qb between the indices (from, to)
44 * @param from The start index of the region
45 * @param to The end index of the region
46 * @param seq The RNA Sequence
47 * @param basePairWeight The Boltzmann weight for energy distribution
48 * @param minLoopLength The minimum length of loops
49 * @param Q Lookup table for Q
50 * @param Qb Lookup table for Qb
51 * @returns the partition function value
52 */
53 static Z_type getQb(const size_t from, const size_t to, const RnaSequence &seq,
54 const Z_type basePairWeight, const size_t minLoopLength,
55 Z2dMatrix &Q, Z2dMatrix &Qb);
56
57 /***
58 * Get the base-pair probbility between the indices (from, to)
59 * @param from The start index of the region
60 * @param to The end index of the region
61 * @param seq The RNA Sequence
62 * @param basePairWeight The Boltzmann weight for energy distribution
63 * @param minLoopLength The minimum length of loops
64 * @param Q Lookup table for Q
65 * @param Qb Lookup table for Qb
66 * @param Pbp Lookup table for base-pair probabilities
67 * @returns the probability value
68 */
69 static Z_type getPbp(const size_t from, const size_t to, const RnaSequence &seq,
70 const Z_type basePairWeight, const size_t minLoopLength,
71 Z2dMatrix &Q, Z2dMatrix &Qb, Z2dMatrix &Ppb);
72
73 /***
74 * Get the unpaired probbility between the indices (from, to)
75 * @param from The start index of the region
76 * @param to The end index of the region
77 * @param seq The RNA Sequence
78 * @param basePairWeight The Boltzmann weight for energy distribution
79 * @param minLoopLength The minimum length of loops
80 * @param Q Lookup table for Q
81 * @param Qb Lookup table for Qb
82 * @param Pbp Lookup table for base-pair probabilities
83 * @param Pu Lookup table for unpaired probabilities
84 * @returns the probability value
85 */
86 static Z_type getPu(const size_t from, const size_t to, const RnaSequence &seq,
87 const Z_type basePairWeight, const size_t minLoopLength,
88 Z2dMatrix &Q, Z2dMatrix &Qb, Z2dMatrix &Ppb, Z2dMatrix &Pu);
89
90
91 /***
92 * Get the dotBracket corresponding to the nussinov of the subsequence (from, to)
93 * @param from The start of the subsequence
94 * @param to The end of the subsequence
95 * @param seq The given RNA sequence
96 * @param minLoopLength The minimum length of loops
97 */
98 static std::string dotBracket(const size_t from, const size_t to,
99 const RnaSequence &seq, const size_t minLoopLength, const E_type basePairEnergy = Ekcal_2_E(-1.0));
100
101 /***
102 * Store all the basepairs in pairs, given a traceback.
103 * @param from The start of the pairs
104 * @param to The end of the pairs
105 * @param traceback The matrix of the traceback indices
106 * @param pairs The resulting base-pairs
107 */
108 static void getBasePairs(const size_t from, const size_t to,
109 const IdxMatrix &traceback, Interaction::PairingVec &pairs);
110
111 /***
112 * Prints the given matrix to stream. Mainly for debug.
113 * @param out the stream to write to
114 * @param M the matrix to print
115 */
116 static void printMatrix( std::ostream & out, const NussinovHandler::E2dMatrix &M);
117};
118
119} // namespace IntaRNA
120#endif /* INTARNA_NUSSINOV_HANDLER */
std::vector< BasePair > PairingVec
type of a vector encoding base pair indices that are interacting
Definition Interaction.h:90
Definition NussinovHandler.h:15
static Z_type getQ(const size_t from, const size_t to, const RnaSequence &seq, const Z_type basePairWeight, const size_t minLoopLength, Z2dMatrix &Q, Z2dMatrix &Qb)
UpperTriangularMatrix< E_type > E2dMatrix
Energy triangular matrix.
Definition NussinovHandler.h:22
static Z_type getPbp(const size_t from, const size_t to, const RnaSequence &seq, const Z_type basePairWeight, const size_t minLoopLength, Z2dMatrix &Q, Z2dMatrix &Qb, Z2dMatrix &Ppb)
static void printMatrix(std::ostream &out, const NussinovHandler::E2dMatrix &M)
static void getBasePairs(const size_t from, const size_t to, const IdxMatrix &traceback, Interaction::PairingVec &pairs)
static std::string dotBracket(const size_t from, const size_t to, const RnaSequence &seq, const size_t minLoopLength, const E_type basePairEnergy=Ekcal_2_E(-1.0))
static Z_type getQb(const size_t from, const size_t to, const RnaSequence &seq, const Z_type basePairWeight, const size_t minLoopLength, Z2dMatrix &Q, Z2dMatrix &Qb)
UpperTriangularMatrix< Z_type > Z2dMatrix
Probability triangular matrix.
Definition NussinovHandler.h:19
static Z_type getPu(const size_t from, const size_t to, const RnaSequence &seq, const Z_type basePairWeight, const size_t minLoopLength, Z2dMatrix &Q, Z2dMatrix &Qb, Z2dMatrix &Ppb, Z2dMatrix &Pu)
UpperTriangularMatrix< size_t > IdxMatrix
Index triangular matrix.
Definition NussinovHandler.h:25
Definition RnaSequence.h:29
Definition Matrix.h:227
#define Ekcal_2_E(e)
convert energy in kcal/mol units to internal energy type
Definition general.h:113
Definition Accessibility.h:13
int E_type
type for energy values (energy + accessibility [ED]) (internally)
Definition general.h:78
double Z_type
type for probabilities, RT and Boltzmann values
Definition general.h:88