11 static const char Law_and_Order[] =
"_ACGUTXKI";
34 {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
35 { 0, 0, 0, 0, 5, 0, 0, 5, 0, 0, 0, 0,13, 0, 0,13},
36 { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0},
37 { 0, 0, 2, 0, 3, 0, 0, 0, 0, 0,10, 0,11, 0, 0, 0},
38 { 0, 6, 0, 4, 0, 0, 0, 6, 0,14, 0,12, 0, 0, 0,14},
39 { 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,10, 0},
40 { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0},
41 { 0, 6, 0, 0, 5, 0, 0, 0, 0,14, 0, 0,13, 0, 0, 0},
42 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
43 { 0, 0, 0, 0,21, 0, 0,21, 0, 0, 0, 0,29, 0, 0,29},
44 { 0, 0, 0,17, 0, 0, 0, 0, 0, 0, 0,25, 0, 0, 0, 0},
45 { 0, 0,18, 0,19, 0, 0, 0, 0, 0,26, 0,27, 0, 0, 0},
46 { 0,22, 0,20, 0, 0, 0,22, 0,30, 0,28, 0, 0, 0,30},
47 { 0, 0, 0, 0, 0, 0,18, 0, 0, 0, 0, 0, 0, 0,26, 0},
48 { 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,25, 0, 0},
49 { 0,22, 0, 0,21, 0, 0, 0, 0,30, 0, 0,29, 0, 0, 0}};
62 0, 2, 1, 4, 3, 6, 5, 7,
63 0,18,17,20,19,22,21, 7,
64 0,10, 9,12,11,14,13, 7,
65 0,26,25,28,27,30,29, 7};
68 #pragma omp threadprivate(Law_and_Order, BP_pair, alias, pair, rtype)
72 #define ENCODE(c) encode_char(c)
74 static int encode_char(
char c) {
80 pos = strchr(Law_and_Order, c);
81 if (pos==NULL) code=0;
82 else code = (int) (pos-Law_and_Order);
92 extern void nrerror(
const char message[]);
93 static void make_pair_matrix(
void)
99 for (i=0; i<5; i++) alias[i] = (
short) i;
104 for (i=8; i<13; i++) alias[i] = (
short) i;
109 for (i=0; i<NBASES; i++) {
110 for (j=0; j<NBASES; j++)
111 pair[i][j] = BP_pair[i][j];
114 pair[3][4] = pair[4][3] = 0;
115 pair[11][4] = pair[4][11] = 0;
116 pair[3][12] = pair[12][3] = 0;
117 pair[11][12] = pair[12][11] = 0;
121 if (nonstandards!=NULL) {
122 for (i=0; i<(int)strlen(nonstandards); i+=2)
123 pair[encode_char(nonstandards[i])]
124 [encode_char(nonstandards[i+1])]=7;
126 for (i=0; i<NBASES; i++) {
127 for (j=0; j<NBASES; j++)
128 rtype[pair[i][j]] = pair[j][i];
160 for (i=1; i<MAXALPHA-2; ) {
166 for (i=1; i<MAXALPHA-2; i++) {
176 else nrerror(
"What energy_set are YOU using??");
179 rtype[pair[i][j]] = pair[j][i];
184 static short *encode_sequence(
const char *sequence,
short how){
185 unsigned int i,l = (
unsigned int)strlen(sequence);
186 short *S = (
short *)
space(
sizeof(
short)*(l+2));
190 case 0:
for(i=1; i<=l; i++)
191 S[i]= (
short) encode_char(toupper(sequence[i-1]));
197 case 1:
for(i=1; i<=l; i++)
198 S[i] = alias[(
short) encode_char(toupper(sequence[i-1]))];
203 case -2:
for(i=1; i<=l; i++)
204 S[i] = ((
short) encode_char(toupper(sequence[i-1])))+8;
208 case -3:
for(i=1; i<=l; i++)
209 S[i] = alias[(
short) encode_char(toupper(sequence[i-1]))]+8;
214 default:
for(i=1; i<how; i++)
215 S[i] = alias[(
short) encode_char(toupper(sequence[i-1]))];
217 S[i] = alias[(
short) encode_char(toupper(sequence[i-1]))]+8;
void * space(unsigned size)
Allocate space safely.
#define NNUCLEOTIDES_HYBRID
Definition: energy_const.h:36
char * nonstandards
contains allowed non standard base pairs
Various utility- and helper-functions used throughout the Vienna RNA package.
#define MAXALPHA
Maximal length of alphabet.
Definition: data_structures.h:22
void nrerror(const char message[])
Die with an error message.
#define NBPAIRS_HYBRID
Definition: energy_const.h:34
Here all all declarations of the global variables used throughout RNAlib.
int noGU
Global switch to forbid/allow GU base pairs at all.
int energy_set
0 = BP; 1=any mit GC; 2=any mit AU-parameter