8 static const char Law_and_Order[] =
"_ACGUTXKI";
9 static int BP_pair[NBASES][NBASES]=
11 {{ 0, 0, 0, 0, 0, 0, 0, 0},
12 { 0, 0, 0, 0, 5, 0, 0, 5},
13 { 0, 0, 0, 1, 0, 0, 0, 0},
14 { 0, 0, 2, 0, 3, 0, 0, 0},
15 { 0, 6, 0, 4, 0, 0, 0, 6},
16 { 0, 0, 0, 0, 0, 0, 2, 0},
17 { 0, 0, 0, 0, 0, 1, 0, 0},
18 { 0, 6, 0, 0, 5, 0, 0, 0}};
25 static int rtype[8] = {0, 2, 1, 4, 3, 6, 5, 7};
28 #pragma omp threadprivate(Law_and_Order, BP_pair, alias, pair, rtype)
32 #define ENCODE(c) encode_char(c)
34 static int encode_char(
char c) {
40 pos = strchr(Law_and_Order, c);
41 if (pos==NULL) code=0;
42 else code = (int) (pos-Law_and_Order);
52 extern void nrerror(
const char message[]);
54 static void make_pair_matrix(
void)
59 for (i=0; i<5; i++) alias[i] = (
short) i;
63 for (i=0; i<NBASES; i++) {
64 for (j=0; j<NBASES; j++)
65 pair[i][j] = BP_pair[i][j];
67 if (
noGU) pair[3][4] = pair[4][3] =0;
68 if (nonstandards!=NULL) {
69 for (i=0; i<(int)strlen(nonstandards); i+=2)
70 pair[encode_char(nonstandards[i])]
71 [encode_char(nonstandards[i+1])]=7;
73 for (i=0; i<NBASES; i++) {
74 for (j=0; j<NBASES; j++)
75 rtype[pair[i][j]] = pair[j][i];
105 for (i=1; i<MAXALPHA-2; ) {
111 for (i=1; i<MAXALPHA-2; i++) {
121 else nrerror(
"What energy_set are YOU using??");
124 rtype[pair[i][j]] = pair[j][i];
129 static short *encode_sequence(
const char *sequence,
short how){
130 unsigned int i,l = (
unsigned int)strlen(sequence);
131 short *S = (
short *)
space(
sizeof(
short)*(l+2));
135 case 0:
for(i=1; i<=l; i++)
136 S[i]= (
short) encode_char(toupper(sequence[i-1]));
141 case 1:
for(i=1; i<=l; i++)
142 S[i] = alias[(
short) encode_char(toupper(sequence[i-1]))];
void * space(unsigned size)
Allocate space safely.
int energy_set
0 = BP; 1=any mit GC; 2=any mit AU-parameter
Various utility- and helper-functions used throughout the Vienna RNA package.
#define MAXALPHA
Maximal length of alphabet.
Definition: model.h:14
char * nonstandards
contains allowed non standard base pairs
void nrerror(const char message[])
Die with an error message.
int noGU
Global switch to forbid/allow GU base pairs at all.
Here all all declarations of the global variables used throughout RNAlib.