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);
53 static void make_pair_matrix(
void)
58 for (i=0; i<5; i++) alias[i] = (
short) i;
62 for (i=0; i<NBASES; i++) {
63 for (j=0; j<NBASES; j++)
64 pair[i][j] = BP_pair[i][j];
66 if (
noGU) pair[3][4] = pair[4][3] =0;
67 if (nonstandards!=NULL) {
68 for (i=0; i<(int)strlen(nonstandards); i+=2)
69 pair[encode_char(nonstandards[i])]
70 [encode_char(nonstandards[i+1])]=7;
72 for (i=0; i<NBASES; i++) {
73 for (j=0; j<NBASES; j++)
74 rtype[pair[i][j]] = pair[j][i];
104 for (i=1; i<MAXALPHA-2; ) {
110 for (i=1; i<MAXALPHA-2; i++) {
123 rtype[pair[i][j]] = pair[j][i];
128 static short *encode_sequence(
const char *sequence,
short how){
129 unsigned int i,l = (
unsigned int)strlen(sequence);
130 short *S = (
short *)
vrna_alloc(
sizeof(
short)*(l+2));
134 case 0:
for(i=1; i<=l; i++)
135 S[i]= (
short) encode_char(toupper(sequence[i-1]));
140 case 1:
for(i=1; i<=l; i++)
141 S[i] = alias[(
short) encode_char(toupper(sequence[i-1]))];
void * vrna_alloc(unsigned size)
Allocate space safely.
int energy_set
0 = BP; 1=any mit GC; 2=any mit AU-parameter
int noGU
Global switch to forbid/allow GU base pairs at all.
char * nonstandards
contains allowed non standard base pairs
General utility- and helper-functions used throughout the ViennaRNA Package.
#define MAXALPHA
Maximal length of alphabet.
Definition: model.h:174
Here all all declarations of the global variables used throughout RNAlib.
void vrna_message_error(const char message[])
Die with an error message.