IntaRNA 3.4.1
RNA-RNA interaction prediction | C++ API
Loading...
Searching...
No Matches
HelixConstraint.h
Go to the documentation of this file.
1
2#ifndef INTARNA_HELIXCONSTRAINT_H
3#define INTARNA_HELIXCONSTRAINT_H
4
5#include "IntaRNA/general.h"
7
8#include <cstddef>
9#include <iostream>
10
11namespace IntaRNA {
12
20
21public:
22
33 HelixConstraint( const size_t minBP
34 , const size_t maxBP
35 , const size_t maxIL
36 , const E_type maxED
37 , const E_type maxE
38 , const bool noED
39 );
40
41 virtual ~HelixConstraint();
42
48 size_t
49 getMinBasePairs() const;
50
56 size_t
57 getMaxBasePairs() const;
58
63 size_t
64 getMaxIL() const;
65
70 E_type
71 getMaxED() const;
72
77 E_type
78 getMaxE() const;
79
86 bool
87 evalFullE() const;
88
93 size_t
95
100 size_t
101 getMaxLength1() const;
102
107 size_t
108 getMaxLength2() const;
109
116 friend std::ostream& operator<<(std::ostream& out, const HelixConstraint& c);
117
118protected:
119
121 size_t minBP;
122
124 size_t maxBP;
125
127 size_t maxIL;
128
131
134
138};
139
140
144
145inline
147 const size_t minBP_
148 , const size_t maxBP_
149 , const size_t maxIL_
150 , const E_type maxED_
151 , const E_type maxE_
152 , const bool checkFullE_)
153 :
154 minBP(minBP_)
155 , maxBP(maxBP_)
156 , maxIL(maxIL_)
157 , maxED(maxED_)
158 , maxE(maxE_)
159 , checkFullE(checkFullE_)
160{
161 if (minBP < 2) throw std::runtime_error("HelixConstraint() : minimal base pair number ("+toString(minBP)+") < 2");
162}
163
165
166inline
169
171
172inline
173size_t
175getMinBasePairs() const {
176 return minBP;
177}
178
180
181inline
182size_t
184getMaxBasePairs() const {
185 return maxBP;
186}
187
189
190inline
191size_t
193getMaxIL() const {
194 return maxIL;
195}
196
198
199inline
200E_type
202getMaxED() const {
203 return maxED;
204}
205
207
208inline
209E_type
211getMaxE() const {
212 return maxE;
213}
214
216
217inline
218bool
220evalFullE() const {
221 return checkFullE;
222}
223
225
226inline
227size_t
229getMaxLength1() const {
230 return getMaxBasePairs() + (getMaxBasePairs()-1) * getMaxIL();
231}
232
234
235inline
236size_t
238getMaxLength2() const {
239 return getMaxBasePairs() + (getMaxBasePairs()-1) * getMaxIL();
240}
241
243
244inline
245size_t
248 return getMaxIL();
249}
250
252
253inline
254std::ostream&
255operator<<(std::ostream& out, const HelixConstraint& c)
256{
257 out <<"HelixConstraint( minBP="<<c.getMinBasePairs()
258 <<", maxBP="<<c.getMaxBasePairs()
259 <<", maxIL="<<c.getMaxIL()
260 <<", maxED="<<E_2_Ekcal(c.getMaxED())
261 <<", maxE="<<E_2_Ekcal(c.getMaxE())
262 <<", evalFullE="<<(c.evalFullE()?"true":"false")
263 <<")";
264 return out;
265
266}
267
269
270} // namespace
271
272#endif //INTARNA_HELIXCONSTRAINT_H
Definition HelixConstraint.h:19
size_t minBP
the minimal number of base pairs allowed in the helix (>=2)
Definition HelixConstraint.h:121
size_t maxIL
the maximally allowed size of internal loops in the helix
Definition HelixConstraint.h:127
size_t maxBP
the maximal number of base pairs allowed in the helix (>=maxBP)
Definition HelixConstraint.h:124
size_t getMaxLength2() const
Definition HelixConstraint.h:238
virtual ~HelixConstraint()
Definition HelixConstraint.h:167
bool checkFullE
Definition HelixConstraint.h:137
E_type maxED
the maximal ED value (per sequence) allowed for a helix
Definition HelixConstraint.h:130
friend std::ostream & operator<<(std::ostream &out, const HelixConstraint &c)
Definition HelixConstraint.h:255
size_t getMinInternalLoopSize() const
Definition HelixConstraint.h:247
size_t getMaxBasePairs() const
Definition HelixConstraint.h:184
bool evalFullE() const
Definition HelixConstraint.h:220
size_t getMaxIL() const
Definition HelixConstraint.h:193
HelixConstraint(const size_t minBP, const size_t maxBP, const size_t maxIL, const E_type maxED, const E_type maxE, const bool noED)
Definition HelixConstraint.h:146
size_t getMinBasePairs() const
Definition HelixConstraint.h:175
E_type getMaxE() const
Definition HelixConstraint.h:211
size_t getMaxLength1() const
Definition HelixConstraint.h:229
E_type getMaxED() const
Definition HelixConstraint.h:202
E_type maxE
the maximal energie allowed for a helix
Definition HelixConstraint.h:133
#define toString(x)
Definition general.h:60
#define E_2_Ekcal(e)
convert internal energy type to energy value in kcal/mol units
Definition general.h:107
Definition Accessibility.h:13
int E_type
type for energy values (energy + accessibility [ED]) (internally)
Definition general.h:78
std::ostream & operator<<(std::ostream &out, const AccessibilityConstraint &c)
Definition AccessibilityConstraint.h:481