Replace Progs/RNAalifold with x64 binary and add all other programs
[jabaws.git] / binaries / src / ViennaRNA / lib / fold_vars.c
1 /* Last changed Time-stamp: <2008-06-27 17:21:42 ivo> */
2
3 /**
4 *** \file fold_vars.c
5 *** global variables to change behaviour of folding routines<BR>
6 *** Also there are some functions that make the live easier when
7 *** using functions of the Vienna RNA package
8 **/
9 #include <string.h>
10 #include <stdio.h>
11 #include "fold_vars.h"
12
13 int         circ = 0;
14
15 int         noGU = 0;             /* GU not allowed at all */
16
17 int         no_closingGU = 0;     /* GU allowed only inside stacks */
18
19 int         tetra_loop = 1;       /* Fold with specially stable 4-loops */
20
21 int         energy_set = 0;       /* 0 = BP; 1=any with GC; 2=any with AU parameters */
22
23 int         dangles = 2;          /* use dangling end energies */
24
25 char        *nonstandards = (char *)0;  /* contains allowed non standard bases */
26
27 double      temperature = 37.0;
28
29 int         james_rule = 1;       /* interior loops of size 2 get energy 0.8Kcal and
30                                     no mismatches (no longer used) */
31
32 int         oldAliEn = 0;         /* use old alifold-energies (without removing gaps) */
33
34 int         ribo = 0;             /* use ribosum instead of classic covariance term */
35
36 char        *RibosumFile = NULL;  /* TODO: compile ribosums into program
37                                     Warning: this variable will vanish */
38
39 int         csv = 0;              /*generate comma seperated output*/
40
41 bondT       *base_pair = NULL;
42
43 FLT_OR_DBL  *pr = NULL;           /* base pairing prob. matrix */
44
45 int         *iindx = NULL;        /* pr[i,j] -> pr[iindx[i]-j] */
46
47 double      pf_scale = -1;        /* scaling factor to avoid floating point overflows */
48
49 int         fold_constrained = 0; /* fold with constraints */
50
51 int         do_backtrack = 1;     /* calculate pair prob matrix in part_func() */
52
53 int         noLonelyPairs = 0;    /* avoid helices of length 1 */
54
55 char        backtrack_type = 'F'; /* 'C' require (1,N) to be bonded;
56                                     'M' seq is part of s multi loop */
57
58 int         *cut_points;
59
60 int         *strand;
61
62 int         gquad = 0;            /* consider g-qudruplexes in the calculations */
63
64 PUBLIC char * option_string(void){
65   static char options[100];
66   *options = '\0';
67   if (noGU) strcat(options, "-noGU ");
68   if (no_closingGU) strcat(options, "-noCloseGU ");
69   if (!tetra_loop) strcat(options, "-4 ");
70   if (noLonelyPairs) strcat(options, "-noLP ");
71   if (fold_constrained) strcat(options, "-C ");
72   if (dangles!=1) sprintf(options+strlen(options), "-d%d ", dangles);
73   if (temperature!=37.0)
74     sprintf(options+strlen(options), "-T %f ", temperature);
75   return options;
76 }
77
78 PUBLIC void set_model_details(model_detailsT *md){
79   if(md){
80     md->dangles     = dangles;
81     md->special_hp  = tetra_loop;
82     md->noLP        = noLonelyPairs;
83     md->noGU        = noGU;
84     md->noGUclosure = no_closingGU;
85     md->logML       = logML;
86     md->gquad       = gquad;
87   }
88 }