1 #ifndef VIENNA_RNA_PACKAGE_PAIR_MAT_H 2 #define VIENNA_RNA_PACKAGE_PAIR_MAT_H 13 # define INLINE inline 19 static const char Law_and_Order[] =
"_ACGUTXKI";
20 static int BP_pair[NBASES][NBASES] =
22 { { 0, 0, 0, 0, 0, 0, 0, 0 },
23 { 0, 0, 0, 0, 5, 0, 0, 5 },
24 { 0, 0, 0, 1, 0, 0, 0, 0 },
25 { 0, 0, 2, 0, 3, 0, 0, 0 },
26 { 0, 6, 0, 4, 0, 0, 0, 6 },
27 { 0, 0, 0, 0, 0, 0, 2, 0 },
28 { 0, 0, 0, 0, 0, 1, 0, 0 },
29 { 0, 6, 0, 0, 5, 0, 0, 0 } };
36 static int rtype[8] = {
37 0, 2, 1, 4, 3, 6, 5, 7
41 #pragma omp threadprivate(Law_and_Order, BP_pair, alias, pair, rtype) 45 #define ENCODE(c) encode_char(c) 56 code = (int)(c -
'A') + 1;
59 pos = strchr(Law_and_Order, c);
63 code = (int)(pos - Law_and_Order);
81 make_pair_matrix(
void)
86 for (i = 0; i < 5; i++)
91 for (i = 0; i < NBASES; i++)
92 for (j = 0; j < NBASES; j++)
93 pair[i][j] = BP_pair[i][j];
95 pair[3][4] = pair[4][3] = 0;
97 if (nonstandards != NULL) {
99 for (i = 0; i < (int)strlen(nonstandards); i += 2)
100 pair[encode_char(nonstandards[i])]
101 [encode_char(nonstandards[i + 1])] = 7;
104 for (i = 0; i < NBASES; i++)
105 for (j = 0; j < NBASES; j++)
106 rtype[pair[i][j]] = pair[j][i];
132 for (i = 1; i < MAXALPHA - 2; ) {
138 for (i = 1; i < MAXALPHA - 2; i++) {
153 rtype[pair[i][j]] = pair[j][i];
158 static INLINE
short *
159 encode_sequence(
const char *sequence,
162 unsigned int i, l = (
unsigned int)strlen(sequence);
163 short *S = (
short *)
vrna_alloc(
sizeof(
short) * (l + 2));
168 for (i = 1; i <= l; i++)
169 S[i] = (
short)encode_char(sequence[i - 1]);
175 for (i = 1; i <= l; i++)
176 S[i] = alias[(
short)encode_char(sequence[i - 1])];
void * vrna_alloc(unsigned size)
Allocate space safely.
int energy_set
0 = BP; 1=any with GC; 2=any with AU-parameter
int noGU
Global switch to forbid/allow GU base pairs at all.
char * nonstandards
contains allowed non standard base pairs
#define MAXALPHA
Maximal length of alphabet.
Definition: model.h:166
void vrna_message_error(const char *format,...)
Print an error message and die.
Here all all declarations of the global variables used throughout RNAlib.
General utility- and helper-functions used throughout the ViennaRNA Package.