RNAlib-2 3 5
RNAlib-2 3 5
RNAlib-2 3 5
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.1.1 Quick-start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2.3 Kinfold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.4 RNAforester . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.5 Kinwalker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.14 Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6.4 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Generated by Doxygen
CONTENTS v
9 Examples 39
10 Deprecated List 45
11 Bug List 55
12 Module Index 57
12.1 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
14 File Index 61
Generated by Doxygen
vi CONTENTS
15 Module Documentation 65
15.1.2.15 vrna_eval_move(vrna_fold_compound_t vc, const char structure, int m1, int m2) 76
Generated by Doxygen
CONTENTS vii
15.1.2.21 energy_of_structure_pt(const char string, short ptable, short s, short s1, int
verbosity_level) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
15.1.2.23 energy_of_move(const char string, const char structure, int m1, int m2) . . . . 80
15.1.2.24 energy_of_move_pt(short pt, short s, short s1, int m1, int m2) . . . . . . . . 81
15.2.3.1 E_Hairpin(int size, int type, int si1, int sj1, const char string, vrna_param_t P) . 86
15.2.3.3 E_IntLoop(int n1, int n2, int type, int type_2, int si1, int sj1, int sp1, int sq1, vrna-
_param_t P) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
15.2.3.4 exp_E_Hairpin(int u, int type, short si1, short sj1, const char string, vrna_exp-
_param_t P) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
15.2.3.9 exp_E_IntLoop(int u1, int u2, int type, int type2, short si1, short sj1, short sp1,
short sq1, vrna_exp_param_t P) . . . . . . . . . . . . . . . . . . . . . . . . . 91
Generated by Doxygen
viii CONTENTS
15.4.2.1 VRNA_MODEL_DEFAULT_TEMPERATURE . . . . . . . . . . . . . . . . . . . 99
15.4.2.2 VRNA_MODEL_DEFAULT_PF_SCALE . . . . . . . . . . . . . . . . . . . . . . 99
15.4.2.3 VRNA_MODEL_DEFAULT_BETA_SCALE . . . . . . . . . . . . . . . . . . . . 99
Generated by Doxygen
CONTENTS ix
Generated by Doxygen
x CONTENTS
Generated by Doxygen
CONTENTS xi
Generated by Doxygen
xii CONTENTS
Generated by Doxygen
CONTENTS xiii
15.10.3.10VRNA_CONSTRAINT_DB_DEFAULT . . . . . . . . . . . . . . . . . . . . . . . 166
Generated by Doxygen
xiv CONTENTS
Generated by Doxygen
CONTENTS xv
15.14.2.10free_pf_arrays(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
15.14.2.13export_bppm(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
15.16Suboptimal structures sensu Stiegler et al. 1984 / Zuker et al. 1989 . . . . . . . . . . . . . . . . . 197
Generated by Doxygen
xvi CONTENTS
15.17.2.1 vrna_subopt(vrna_fold_compound_t vc, int delta, int sorted, FILE fp) . . . . . 200
15.17.2.3 subopt(char seq, char structure, int delta, FILE fp) . . . . . . . . . . . . . . 201
15.17.2.4 subopt_circ(char seq, char sequence, int delta, FILE fp) . . . . . . . . . . . 201
Generated by Doxygen
CONTENTS xvii
15.23.2.5 get_mpi(char Alseq[], int n_seq, int length, int mini) . . . . . . . . . . . . . . 215
15.23.2.6 encode_ali_sequence(const char sequence, short S, short s5, short s3, char
ss, unsigned short as, int circ) . . . . . . . . . . . . . . . . . . . . . . . . . 216
Generated by Doxygen
xviii CONTENTS
15.25Partition Function and Base Pair Probabilities for Sequence Alignment(s) . . . . . . . . . . . . . . 222
Generated by Doxygen
CONTENTS xix
Generated by Doxygen
xx CONTENTS
15.34.4.2 vrna_loopidx_update(int loopidx, const short pt, int length, const vrna_move_t
m) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
15.34.4.3 vrna_neighbors(vrna_fold_compound_t vc, const short pt, unsigned int options) 248
15.35.3.1 vrna_path(vrna_fold_compound_t vc, short pt, unsigned int steps, unsigned int
options) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Generated by Doxygen
CONTENTS xxi
15.41Incorporating ligands binding to specific sequence/structure motifs using soft constraints . . . . . . 266
Generated by Doxygen
xxii CONTENTS
15.43G-quadruplexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
15.43.2.3 backtrack_GQuad_IntLoop(int c, int i, int j, int type, short S, int ggg, int index,
int p, int q, vrna_param_t P) . . . . . . . . . . . . . . . . . . . . . . . . . . 271
15.43.2.4 backtrack_GQuad_IntLoop_L(int c, int i, int j, int type, short S, int ggg, int
maxdist, int p, int q, vrna_param_t P) . . . . . . . . . . . . . . . . . . . . . 271
Generated by Doxygen
CONTENTS xxiii
15.45Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
15.45.3.13vrna_urn(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
15.45.3.15vrna_time_stamp(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Generated by Doxygen
xxiv CONTENTS
15.45.3.17vrna_message_input_seq_simple(void) . . . . . . . . . . . . . . . . . . . . . . 290
15.46.2.9 export_fold_arrays(int f5_p, int c_p, int fML_p, int fM1_p, int indx_p,
char ptype_p) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
15.46.2.11export_circfold_arrays(int Fc_p, int FcH_p, int FcI_p, int FcM_p, int fM2_p,
int f5_p, int c_p, int fML_p, int fM1_p, int indx_p, char ptype_p) . . 298
15.46.2.13LoopEnergy(int n1, int n2, int type, int type_2, int si1, int sj1, int sp1, int sq1) . . . 298
15.46.2.14HairpinE(int size, int type, int si1, int sj1, const char string) . . . . . . . . . . . 298
Generated by Doxygen
CONTENTS xxv
15.47.2.7 export_cofold_arrays_gq(int f5_p, int c_p, int fML_p, int fM1_p, int
fc_p, int ggg_p, int indx_p, char ptype_p) . . . . . . . . . . . . . . . . 302
15.47.2.8 export_cofold_arrays(int f5_p, int c_p, int fML_p, int fM1_p, int fc_p,
int indx_p, char ptype_p) . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
15.49.2.2 pf_interact(const char s1, const char s2, pu_contrib p_c, pu_contrib p_c2,
int max_w, char cstruc, int incr3, int incr5) . . . . . . . . . . . . . . . . . . . . 310
Generated by Doxygen
xxvi CONTENTS
15.50.2.2 vrna_Lfoldz(const char string, int window_size, double min_z, FILE file) . . . . 313
15.50.2.4 Lfoldz(const char string, char structure, int maxdist, int zsc, double min_z) . . 314
15.51Partition Function and Equilibrium Probabilities for Locally Stable Secondary Structures . . . . . . 317
15.51.3.1 vrna_pfl_fold(const char sequence, int window_size, int max_bp_span, float cutoff)319
15.51.3.3 vrna_pfl_fold_up(const char sequence, int ulength, int window_size, int max_-
bp_span) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Generated by Doxygen
CONTENTS xxvii
15.54.2.10VRNA_CONVERT_OUTPUT_DANGLE5 . . . . . . . . . . . . . . . . . . . . . 327
15.54.2.11VRNA_CONVERT_OUTPUT_DANGLE3 . . . . . . . . . . . . . . . . . . . . . 327
15.54.2.12VRNA_CONVERT_OUTPUT_INT_11 . . . . . . . . . . . . . . . . . . . . . . . 327
15.54.2.13VRNA_CONVERT_OUTPUT_INT_21 . . . . . . . . . . . . . . . . . . . . . . . 327
15.54.2.14VRNA_CONVERT_OUTPUT_INT_22 . . . . . . . . . . . . . . . . . . . . . . . 327
15.54.2.15VRNA_CONVERT_OUTPUT_BULGE . . . . . . . . . . . . . . . . . . . . . . . 328
15.54.2.16VRNA_CONVERT_OUTPUT_INT . . . . . . . . . . . . . . . . . . . . . . . . . 328
15.54.2.17VRNA_CONVERT_OUTPUT_ML . . . . . . . . . . . . . . . . . . . . . . . . . 328
15.54.2.18VRNA_CONVERT_OUTPUT_MISC . . . . . . . . . . . . . . . . . . . . . . . . 328
15.54.2.19VRNA_CONVERT_OUTPUT_SPECIAL_HP . . . . . . . . . . . . . . . . . . . 328
15.54.2.20VRNA_CONVERT_OUTPUT_VANILLA . . . . . . . . . . . . . . . . . . . . . . 328
15.54.2.21VRNA_CONVERT_OUTPUT_NINIO . . . . . . . . . . . . . . . . . . . . . . . 328
15.54.2.22VRNA_CONVERT_OUTPUT_DUMP . . . . . . . . . . . . . . . . . . . . . . . 329
15.54.3.1 convert_parameter_file(const char iname, const char oname, unsigned int op-
tions) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Generated by Doxygen
xxviii CONTENTS
Generated by Doxygen
CONTENTS xxix
15.57.4.3 find_saddle(const char seq, const char struc1, const char struc2, int max) . . 352
15.57.4.5 get_path(const char seq, const char s1, const char s2, int maxkeep) . . . . . 353
Generated by Doxygen
xxx CONTENTS
15.59.2.20vrna_refBPdist_matrix(const short pt1, const short pt2, unsigned int turn) . . . 368
Generated by Doxygen
CONTENTS xxxi
15.61Functions to Read/Write several File Formats for RNA Sequences, Structures, and Alignments . . 376
Generated by Doxygen
xxxii CONTENTS
15.61.3.1 vrna_file_helixlist(const char seq, const char db, float energy, FILE file) . . . 379
15.61.3.5 vrna_file_msa_write(const char filename, const char names, const char aln,
const char id, const char structure, const char source, unsigned int options) . 382
15.62Functions for Creating RNA Secondary Structures Plots, Dot-Plots, and More . . . . . . . . . . . . 385
15.62.3.1 aliPS_color_aln(const char structure, const char filename, const char seqs[],
const char names[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
15.62.3.4 vrna_file_PS_rnaplot(const char seq, const char structure, const char file,
vrna_md_t md_p) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
15.62.3.5 vrna_file_PS_rnaplot_a(const char seq, const char structure, const char file,
const char pre, const char post, vrna_md_t md_p) . . . . . . . . . . . . . . 388
15.62.3.6 gmlRNA(char string, char structure, char ssfile, char option) . . . . . . . . . 389
15.62.3.11PS_rna_plot_a(char string, char structure, char file, char pre, char post) . 391
Generated by Doxygen
CONTENTS xxxiii
15.62.3.13PS_dot_plot_list(char seq, char filename, plist pl, plist mf, char comment) . 391
Generated by Doxygen
xxxiv CONTENTS
Generated by Doxygen
CONTENTS xxxv
17.4.2.5 TwoDpfold_pbacktrack5(TwoDpfold_vars vars, int d1, int d2, unsigned int length) 412
Generated by Doxygen
xxxvi CONTENTS
17.14.3.4 constrain_ptypes(const char constraint, unsigned int length, char ptype, int -
BP, int min_loop_size, unsigned int idx_type) . . . . . . . . . . . . . . . . . . . 429
Generated by Doxygen
CONTENTS xxxvii
17.24.2.2 K0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
Generated by Doxygen
xxxviii CONTENTS
17.27.2.3 E_Stem(int type, int si1, int sj1, int extLoop, vrna_param_t P) . . . . . . . . . . 446
17.27.2.4 exp_E_Stem(int type, int si1, int sj1, int extLoop, vrna_exp_param_t P) . . . . . 447
17.28.3.1 vrna_file_connect(const char seq, const char db, float energy, const char
identifier, FILE file) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
17.28.3.2 vrna_file_bpseq(const char seq, const char db, FILE file) . . . . . . . . . . . 449
17.28.3.3 vrna_file_json(const char seq, const char db, double energy, const char
identifier, FILE file) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
17.28.3.8 read_record(char header, char sequence, char rest, unsigned int options) 452
Generated by Doxygen
CONTENTS xxxix
17.33.2.6 pr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
Generated by Doxygen
xl CONTENTS
17.50.2.7 expLoopEnergy(int u1, int u2, int type, int type2, short si1, short sj1, short sp1,
short sq1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
17.50.2.8 expHairpinEnergy(int u, int type, short si1, short sj1, const char string) . . . . . 480
Generated by Doxygen
CONTENTS xli
17.51.2.5 get_concentrations(double FEAB, double FEAA, double FEBB, double FEA, dou-
ble FEB, double startconc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
Generated by Doxygen
xlii CONTENTS
Generated by Doxygen
CONTENTS xliii
17.70.2.12time_stamp(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
Bibliography 514
Index 515
Generated by Doxygen
Chapter 1
Date
1994-2016
Authors
Table of Contents
Introduction
folding_routines
Examples
2 ViennaRNA Package core - RNAlib
1.1 Introduction
The core of the Vienna RNA Package ([10], [8]) is formed by a collection of routines for the prediction and com-
parison of RNA secondary structures. These routines can be accessed through stand-alone programs, such as
RNAfold, RNAdistance etc., which should be sufficient for most users. For those who wish to develop their own
programs we provide a library which can be linked to your own code.
This document describes the library and will be primarily useful to programmers. However, it also contains details
about the implementation that may be of interest to advanced users. The stand-alone programs are described in
separate man pages. The latest version of the package including source code and html versions of the documen-
tation can be found at
http://www.tbi.univie.ac.at/RNA/
Generated by Doxygen
Chapter 2
For best portability the ViennaRNA package uses the GNU autoconf and automake tools. The instructions below are
for installing the ViennaRNA package from source. However, pre-compiled binaries for various Linux distributions,
as well as for Windows users are available from Download section of the main ViennaRNA homepage.
2.1.1 Quick-start
If you do not have root privileges on your computer, you might want to install the ViennaRNA Package to a location
where you actually have write access to. To do so, you can set the installation prefix of the ./configure script like so:
./configure --prefix=/home/username/ViennaRNA
make install
This will install the entire ViennaRNA Package into a new directory ViennaRNA directly into the users username
home directory.
4 Installation and Configuration of RNAlib Features
Although users will find /usr/bin/gcc and /usr/bin/g++ executables in their directory tree, these programs are not at
all what they pretend to be. Instead of including the GNU programs, Apple decided to install clang/llvm in disguise.
Unfortunately, the default version of clang/llvm does not support OpenMP (yet), but only complains at a late stage
of the build process when this support is required. Therefore, it seems necessary to deactivate OpenMP support by
passing the option disable-openmp to the ./configure script.
Additionally, since MacOS X 10.5 the perl and python installation distributed with MacOS X always include so called
universal-binaries (a.k.a. fat-binaries), i.e. binaries for multiple architecture types. In order to compile and link the
programs, library, and scripting language interfaces of the ViennaRNA Package for multiple architectures, we've
added a new configure switch that sets up the required changes automatically:
./configure --enable-universal-binary
Note
Note, that with link time optimization turned on, MacOS X's default compiler (llvm/clang) generates an in-
termediary binary format that can not easily be combined into a multi-architecture library. Therefore, the
enable-universal-binary switch turns off link time optimization!
The ViennaRNA Package includes additional executable programs such as RNAforester, Kinfold, and Kinwalker.
Furthermore, we include several features in our C-library that may be activated by default, or have to be explicitly
turned on at configure-time. Below we list a selection of the available configure options that affect the features
included in all executable programs, the RNAlib C-library, and the corresponding scripting language interface(s).
The ViennaRNA Package comes with scripting language interfaces for Perl 5, Python 2, and Python 3 (provided by
swig), that allow one to use the implemented algorithms directly without the need of calling an executable program.
The interfaces are build by default whenever the autoconf tool-chain detects the required build tools on your system.
You may, however, explicitly turn off particular scripting language interface support at configure-time, for instance
for Perl 5 and Python 2, before the actual installation.
Example:
Disabling the scripting language support all-together can be accomplished using the following switch:
./configure --without-swig
The programs AnalyseSeqs and AnalyseDists offer some cluster analysis tools (split decomposition, statistical
geometry, neighbor joining, Ward's method) for sequences and distance data. To also build these programs add
--with-cluster
Generated by Doxygen
2.2 Configuring RNAlib features 5
2.2.3 Kinfold
The Kinfold program can be used to simulate the folding dynamics of an RNA molecule, and is compiled by default.
Use the
--without-kinfold
2.2.4 RNAforester
The RNAforester program is used for comparing secondary structures using tree alignment. Similar to Kinfold, use
the
--without-forester
2.2.5 Kinwalker
The Kinwalker algorithm performs co-transcriptional folding of RNAs, starting at a user specified structure (default-
: open chain) and ending at the minimum free energy structure. Compilation and installation of this program is
deactivated by default. Use the
--with-kinwalker
To increase the performance of our implementations, the ViennaRNA Package tries to make use of the Link Time
Optimization (LTO) feature of modern C-compilers. If you are experiencing any troubles at make-time or run-time,
or the configure script for some reason detects that your compiler supports this feature although it doesn't, you can
deactivate it using the flag
./configure --disable-lto
To enable concurrent computation of our implementations and in some cases parallelization of the algorithms we
make use of the OpenMP API. This interface is well understood by most modern compilers. However, in some
cases it might be necessary to deactivate OpenMP support and therefore transform RNAlib into a C-library that is
not entirely thread-safe. To do so, add the following configure option
./configure --disable-openmp
Generated by Doxygen
6 Installation and Configuration of RNAlib Features
Stochastic backtracking for single RNA sequences, e.g. available through the RNAsubopt program, received a
major speedup by implementing a Boustrophedon scheme (see this article for details). If for some reason you want
to deactivate this feature, you can do that by adding the following switch to the configure script:
./configure --disable-boustrophedon
By default, RNALfold that comes with the ViennaRNA Package allows for z-score filtering of its predicted results
using a support vector machine (SVM). However, the library we use to implement this feature (libsvm) is statically
linked to our own RNAlib. If this introduces any problems for your own third-party programs that link against RNAlib,
you can safely switch off the z-scoring implementation using
./configure --without-svm
The new program RNApvmin computes a pseudo-energy perturbation vector that aims to minimize the discrepancy
of predicted, and observed pairing probabilities. For that purpose it implements several methods to solve the
optimization problem. Many of them are provided by the GNU Scientific Library, which is why the RNApvmin
program, and the RNAlib C-library are required to be linked against libgsl. If this introduces any problems in your
own third-party programs that link against RNAlib, you can turn off a larger portion of available minimizers in RN-
Apvmin and linking against libgsl all-together, using the switch
./configure --without-gsl
By default, we use C11/C++11 features in our implementations. This mainly accounts for unnamed unions/structs
within RNAlib. The configure script automatically detects whether or not your compiler understands these features.
In case you are using an older compiler, these features will be deactivated by setting a specific pre-processor
directive. If for some reason you want to deactivate C11/C++11 features despite the capabilities of your compiler,
use the following configure option:
./configure --disable-c11
Since version 2.2 we are in the process of transforming the API of our RNAlib. Hence, several symbols are marked
as deprecated whenever they have been replaced by the new API. By default, deprecation warnings at compile time
are deactivated. If you want to get your terminal spammed by tons of deprecation warnings, enable them using:
./configure --enable-warn-deprecated
Generated by Doxygen
2.3 Linking against RNAlib 7
Calculation of partition functions (via RNAfold -p) uses double precision floats by default, to avoid overflow errors
on longer sequences. If your machine has little memory and you don't plan to fold sequences over 1000 bases in
length you can compile the package to do the computations in single precision by running
./configure --enable-floatpf
Note
Using this option is discouraged and not necessary on most modern computers.
2.2.14 Help
For a complete list of all ./configure options and important environment variables, type
./configure --help
For more general information on the build process see the INSTALL.configure file.
In order to use our implemented algorithms you simply need to link your program to our RNAlib C-library that usually
comes along with the ViennaRNA Package installation. If you've installed the ViennaRNA Package as a pre-build
binary package, you probably need the corresponding development package, e.g. viennarna-devel, or viennarna-
dev. The only thing that is left is to include the ViennaRNA header files into your source code, e.g.:
#include <ViennaRNA/mfe.h>
See also
In the Examples and Some Examples using RNAlib API v3.0 sections, we list a small set of example code that
usually is a good starting point for your application.
Generated by Doxygen
8 Installation and Configuration of RNAlib Features
Of course, simply adding the ViennaRNA header files into your source code is usually not enough. You probably
need to tell your compiler where to find the header files, and sometimes add additional pre-processor directives.
Whenever your installation of RNAlib was build with default settings and the header files were installed into their
default location, a simple
-I/usr/include
pre-processor/compile flag should suffice. It can even be omitted in this case, since your compiler should search
this directory by default anyway. You only need to change the path from /usr/include to the correct location whenever
the header files have been installed into a non-standard directory.
On the other hand, if you've compiled RNAlib with some non-default settings then you probably need to define some
additional pre-processor macros:
Add this directive to your pre-processor/compile flags only if RNAlib was build with the disable-c11
configure option.
See also
Note
Adding this directive enables compiler warnings whenever you use symbols in RNAlib that are marked
deprecated.
See also
USE_FLOAT_PF . . . Use single precision floating point operations instead of double precision in partition
function computations.
Warning
Define this macro only if RNAlib was build with the enable-floatpf configure option!
See also
Simply add the corresponding definition(s) to your pre-processor/compile flags, for instance:
-DVRNA_DISABLE_C11_FEATURES
Finally, linking against RNAlib is achieved by adding the following linker flag
Again, the path to the library, /usr/lib, may be omitted if this path is searched for libraries by default. The second flag
tells the linker to include libRNA.a, and the remaining two flags activate Link Time Optimization (LTO) and OpenMP
support support, respectively.
Generated by Doxygen
2.3 Linking against RNAlib 9
Note
-flto
Instead of hard-coding the required compiler and linker flags, you can also let the pkg-config tool automatically
determine the required flags. This tool is usually packaged for any Linux distribution and should be available for
MacOS X and MinGW as well. We ship a file RNAlib2.pc which is installed along with the static libRNA.a C-library
and populated with all required compiler and linker flags that correspond to your configure time decisions.
The compiler flags required for properly building your code that uses RNAlib can be easily obtained via
With this widely accepted standard it is also very easy to integrate RNAlib in your autotools project, just have a look
at the PKG_CHECK_MODULES macro.
Generated by Doxygen
10 Installation and Configuration of RNAlib Features
Generated by Doxygen
Chapter 3
The standard representation of a secondary structure is the bracket notation, where matching brackets symbolize
base pairs and unpaired bases are shown as dots. Alternatively, one may use two types of node labels, 'P' for paired
and 'U' for unpaired; a dot is then replaced by '(U)', and each closed bracket is assigned an additional identifier 'P'.
We call this the expanded notation. In [6] a condensed representation of the secondary structure is proposed, the
so-called homeomorphically irreducible tree (HIT) representation. Here a stack is represented as a single pair of
matching brackets labeled 'P' and weighted by the number of base pairs. Correspondingly, a contiguous strain of
unpaired bases is shown as one pair of matching brackets labeled 'U' and weighted by its length. Generally any
string consisting of matching brackets and identifiers is equivalent to a plane tree with as many different types of
nodes as there are identifiers.
Bruce Shapiro proposed a coarse grained representation [17], which, does not retain the full information of the
secondary structure. He represents the different structure elements by single matching brackets and labels them
as 'H' (hairpin loop), 'I' (interior loop), 'B' (bulge), 'M' (multi-loop), and 'S' (stack). We extend his alphabet by an extra
letter for external elements 'E'. Again these identifiers may be followed by a weight corresponding to the number of
unpaired bases or base pairs in the structure element. All tree representations (except for the dot-bracket form) can
be encapsulated into a virtual root (labeled 'R'), see the example below.
The following example illustrates the different linear tree representations used by the package. All lines show the
same secondary structure.
a) .((((..(((...)))..((..)))).)).
(U)(((((U)(U)((((U)(U)(U)P)P)P)(U)(U)(((U)(U)P)P)P)P)(U)P)P)(U)
b) (U)(((U2)((U3)P3)(U2)((U2)P2)P2)(U)P2)(U)
c) (((H)(H)M)B)
((((((H)S)((H)S)M)S)B)S)
(((((((H)S)((H)S)M)S)B)S)E)
d) ((((((((H3)S3)((H2)S2)M4)S2)B1)S2)E2)R)
Above: Tree representations of secondary structures. a) Full structure: the first line shows the more convenient
condensed notation which is used by our programs; the second line shows the rather clumsy expanded notation
for completeness, b) HIT structure, c) different versions of coarse grained structures: the second line is exactly
Shapiro's representation, the first line is obtained by neglecting the stems. Since each loop is closed by a unique
stem, these two lines are equivalent. The third line is an extension taking into account also the external digits. d)
weighted coarse structure, this time including the virtual root.
For the output of aligned structures from string editing, different representations are needed, where we put the label
on both sides. The above examples for tree representations would then look like:
12 Parsing and Comparing - Functions to Manipulate Structures
a) (UU)(P(P(P(P(UU)(UU)(P(P(P(UU)(UU)(UU)P)P)P)(UU)(UU)(P(P(UU)(U...
b) (UU)(P2(P2(U2U2)(P2(U3U3)P3)(U2U2)(P2(U2U2)P2)P2)(UU)P2)(UU)
c) (B(M(HH)(HH)M)B)
(S(B(S(M(S(HH)S)(S(HH)S)M)S)B)S)
(E(S(B(S(M(S(HH)S)(S(HH)S)M)S)B)S)E)
d) (R(E2(S2(B1(S2(M4(S3(H3)S3)((H2)S2)M4)S2)B1)S2)E2)R)
Several functions are provided for parsing structures and converting to different representations.
Convert the full structure from bracket notation to the expanded notation including root.
Converts the full structure from bracket notation to the HIT notation including root.
Converts the full structure from bracket notation to the a coarse grained notation using the 'H' 'B' 'I' 'M' and 'R'
identifiers.
Converts the full structure from bracket notation to the weighted coarse grained notation using the 'H' 'B' 'I' 'M' 'S' 'E'
and 'R' identifiers.
Inserts missing 'S' identifiers in unweighted coarse grained structures as obtained from b2C().
Restores the bracket notation from an expanded full or HIT tree, that is any tree using only identifiers 'U' 'P' and 'R'.
See also
Generated by Doxygen
13
Distance Measures
A simple measure of dissimilarity between secondary structures of equal length is the base pair distance, given by
the number of pairs present in only one of the two structures being compared. I.e. the number of base pairs that
have to be opened or closed to transform one structure into the other. It is therefore particularly useful for comparing
structures on the same sequence. It is implemented by
Compute the "base pair" distance between two secondary structures s1 and s2.
For other cases a distance measure that allows for gaps is preferable. We can define distances between structures
as edit distances between trees or their string representations. In the case of string distances this is the same as
"sequence alignment". Given a set of edit operations and edit costs, the edit distance is given by the minimum
sum of the costs along an edit path converting one object into the other. Edit distances like these always define a
metric. The edit operations used by us are insertion, deletion and replacement of nodes. String editing does not
pay attention to the matching of brackets, while in tree editing matching brackets represent a single node of the tree.
Tree editing is therefore usually preferable, although somewhat slower. String edit distances are always smaller or
equal to tree edit distances.
The different level of detail in the structure representations defined above naturally leads to different measures of
distance. For full structures we use a cost of 1 for deletion or insertion of an unpaired base and 2 for a base pair.
Replacing an unpaired base for a pair incurs a cost of 1.
/* Null, H, B, I, M, S, E */
{ 0, 2, 2, 2, 2, 1, 1}, /* Null replaced */
{ 2, 0, 2, 2, 2, INF, INF}, /* H replaced */
{ 2, 2, 0, 1, 2, INF, INF}, /* B replaced */
{ 2, 2, 1, 0, 2, INF, INF}, /* I replaced */
{ 2, 2, 2, 2, 0, INF, INF}, /* M replaced */
{ 1, INF, INF, INF, INF, 0, INF}, /* S replaced */
{ 1, INF, INF, INF, INF, INF, 0}, /* E replaced */
/* Null, H, B, I, M, S, E */
{ 0, 100, 5, 5, 75, 5, 5}, /* Null replaced */
{ 100, 0, 8, 8, 8, INF, INF}, /* H replaced */
{ 5, 8, 0, 3, 8, INF, INF}, /* B replaced */
{ 5, 8, 3, 0, 8, INF, INF}, /* I replaced */
{ 75, 8, 8, 8, 0, INF, INF}, /* M replaced */
{ 5, INF, INF, INF, INF, 0, INF}, /* S replaced */
{ 5, INF, INF, INF, INF, INF, 0}, /* E replaced */
The lower matrix uses the costs given in [18]. All distance functions use the following global variables:
int cost_matrix;
int edit_backtrack;
Produce an alignment of the two structures being compared by tracing the editing path giving the minimum distance.
char *aligned_line[4];
Contains the two aligned structures after a call to one of the distance functions with edit_backtrack set to 1.
See also
Generated by Doxygen
14 Parsing and Comparing - Functions to Manipulate Structures
Constructs a Tree ( essentially the postorder list ) of the structure 'struc', for use in tree_edit_distance().
See also
See also
For comparison of base pair probability matrices, the matrices are first condensed into probability profiles which are
the compared by alignment.
condense pair probability matrix into a vector containing probabilities for unpaired, upstream paired and downstream
paired.
See also
Generated by Doxygen
Chapter 4
Table of Contents
Miscellaneous Utilities
int PS_rna_plot_a (
char *string,
char *structure,
char *file,
char *pre,
char *post)
Produce a secondary structure graph in PostScript including additional annotation macros and write it to 'filename'.
Produce a secondary structure graph in Graph Meta Language (gml) and write it to a file.
16 Utilities - Odds and Ends
int rna_plot_type
Calculate nucleotide coordinates for secondary structure plot the Simple way
See also
See also
Generated by Doxygen
4.3 Producing (colored) alignments 17
int PS_color_aln (
const char *structure,
const char *filename,
const char *seqs[],
const char *names[])
Generated by Doxygen
18 Utilities - Odds and Ends
Print structure constraint characters to stdout. (constraint support is specified by option parameter)
void constrain_ptypes (
const char *constraint,
unsigned int length,
char *ptype,
int *BP,
int min_loop_size,
unsigned int idx_type)
Get a timestamp.
Generated by Doxygen
4.6 Miscellaneous Utilities 19
See also
utils.h for a complete overview and detailed description of the utility functions
Generated by Doxygen
20 Utilities - Odds and Ends
Generated by Doxygen
Chapter 5
5.1 Introduction
With version 2.2 we introduce the new API that will take over the old one in the future version 3.0. By then, backwards
compatibility will be broken, and third party applications using RNAlib need to be ported. This switch of API became
necessary, since many new features found their way into the RNAlib where a balance between threadsafety and
easy-to-use library functions is hard or even impossible to establish. Furthermore, many old functions of the library
are present as slightly modified copies of themself to provide a crude way to overload functions.
Therefore, we introduce the new v3.0 API very early in our development stage such that developers have enough
time to migrate to the new functions and interfaces. We also started to provide encapsulation of the RNAlib functions,
data structures, typedefs, and macros by prefixing them with vrna_ and VRNA_ , respectively. Header files should
also be included using the ViennaRNA/ namespace, e.g.
#include <ViennaRNA/fold.h>
#include <fold.h>
...
...
Examples on how to use the new v3.0 API can be found in the Using the 'new' v3.0 API section.
22 RNAlib API v3.0
Generated by Doxygen
Chapter 6
6.1 Introduction
For an easy integration into scripting languages, we provide an automatically generated interface to the RNAlib
C-library, generated with scripting.
The main difference when using a scripting language interface compared to direct calls of RNAlib C functions is,
that the prefix 'vrna_' is dropped. For instance, when calling the vrna_fold() function, corresponding calls in perl or
python are RNA::fold(), and RNA.fold(), respectively.
Functions that are dedicated to work on specific data structures only, e.g. the vrna_fold_compound_t, are usually
not exported at all. Instead, they are attached as object methods of a corresponding class (see Object oriented
Interface for data structures for detailed information).
For data structures, typedefs, and enumerations the 'vrna_' prefixes are dropped as well, together with their suffixes
'_s', '_t', and '_e', respectively. Furthermore, data structures are usually transformed into classes and relevant
functions of the C-library are attached as methods.
6.4 Examples
Examples on the basic usage of the scripting language interfaces can be found in the Perl Examples and Python
Examples section.
Special notes on how functions, structures, enums, and macro definitions are actually wrapped, can be found here:
SWIG Wrapper Notes.
24 Scripting Language interface(s)
Generated by Doxygen
Chapter 7
Below, you find an enumeration of special note on how functions, structures, enums, and macro definitions are
wrapped.
Global vrna_eval_move (vrna_fold_compound_t vc, const char structure, int m1, int m2)
This function is attached as method eval_move() to objects of type fold_compound
Global vrna_eval_move_pt (vrna_fold_compound_t vc, short pt, int m1, int m2)
This function is attached as method eval_move_pt() to objects of type fold_compound
The resulting object has a list of attached methods which in most cases directly correspond to functions that
mainly operate on the corresponding C data structure:
Global vrna_file_commands_apply (vrna_fold_compound_t vc, const char filename, unsigned int op-
tions)
This function is attached as method file_commands_apply() to objects of type fold_compound
Global vrna_hc_add_bp (vrna_fold_compound_t vc, int i, int j, char option)
This function is attached as method hc_add_bp() to objects of type fold_compound
Global vrna_hc_add_bp_nonspecific (vrna_fold_compound_t vc, int i, int d, char option)
This function is attached as method hc_add_bp_nonspecific() to objects of type fold_compound
Global vrna_hc_add_from_db (vrna_fold_compound_t vc, const char constraint, unsigned int options)
This function is attached as method hc_add_from_db() to objects of type fold_compound
Global vrna_hc_add_up (vrna_fold_compound_t vc, int i, char option)
This function is attached as method hc_add_up() to objects of type fold_compound
Global vrna_hc_init (vrna_fold_compound_t vc)
This function is attached as method hc_init() to objects of type fold_compound
Class vrna_md_s
This data structure is wrapped as an object md with multiple related functions attached as methods.
A new set of default parameters can be obtained by calling the constructure of md:
The resulting object has a list of attached methods which directly correspond to functions that mainly operate
on the corresponding C data structure:
reset() vrna_md_set_default()
Generated by Doxygen
27
set_from_globals() set_model_details()
option_string() vrna_md_option_string()
Note, that default parameters can be modified by directly setting any of the following global variables. Internally,
getting/setting default parameters using their global variable representative translates into calls of the following
functions, therefore these wrappers for these functions do not exist in the scripting language interface(s):
Generated by Doxygen
28 SWIG Wrapper Notes
or an entire 2-dimensional matrix with dimensions n x n that stores free energy contributions for any base pair
(i,j) with 1 i < j n:
fold_compound.sc_add_bp(matrix, options)
or an entire vector that stores free energy contributions for each nucleotide i with 1 i n:
fold_compound.sc_add_bp(vector, options)
Generated by Doxygen
29
Generated by Doxygen
30 SWIG Wrapper Notes
Generated by Doxygen
Chapter 8
The ClustalW format is a relatively simple text file containing a single multiple sequence alignment of DNA, RNA,
or protein sequences. It was first used as an output format for the clustalw programs, but nowadays it may also be
generated by various other sequence alignment tools. The specification is straight forward:
CLUSTAL W
or
CLUSTALW
Finally, one or more blocks of sequence data are following, where each block is separated by at least one
empty line
Each line in a blocks of sequence data consists of the sequence name followed by the sequence symbols, sep-
arated by at least one whitespace character. Usually, the length of a sequence in one block does not exceed 60
symbols. Optionally, an additional whitespace separated cumulative residue count may follow the sequence sym-
bols. Optionally, a block may be followed by a line depicting the degree of conservation of the respective alignment
columns.
Note
Sequence names and the sequences must not contain whitespace characters! Allowed gap symbols are the
hyphen ("-"), and dot (".").
32 Input / Output File Formats
Warning
Please note that many programs that output this format tend to truncate the sequence names to a limited
number of characters, for instance the first 15 characters. This can destroy the uniqueness of identifiers in
your MSA.
AL031296.1/85969-86120 CUGCCUCACAACGUUUGUGCCUCAGUUACCCGUAGAUGUAGUGAGGGUAACAAUACUUAC
AANU01225121.1/438-603 CUGCCUCACAACAUUUGUGCCUCAGUUACUCAUAGAUGUAGUGAGGGUGACAAUACUUAC
AAWR02037329.1/29294-29150 ---CUCGACACCACU---GCCUCGGUUACCCAUCGGUGCAGUGCGGGUAGUAGUACCAAU
AL031296.1/85969-86120 UCUCGUUGGUGAUAAGGAACAGCU
AANU01225121.1/438-603 UCUCGUUGGUGAUAAGGAACAGCU
AAWR02037329.1/29294-29150 GCUAAUUAGUUGUGAGGACCAACU
# STOCKHOLM 1.0
#=GF AC RF01293
#=GF ID ACA59
#=GF DE Small nucleolar RNA ACA59
#=GF AU Wilkinson A
#=GF SE Predicted; WAR; Wilkinson A
#=GF SS Predicted; WAR; Wilkinson A
#=GF GA 43.00
#=GF TC 44.90
#=GF NC 40.30
#=GF TP Gene; snRNA; snoRNA; HACA-box;
#=GF BM cmbuild -F CM SEED
#=GF CB cmcalibrate --mpi CM
#=GF SM cmsearch --cpu 4 --verbose --nohmmonly -E 1000 -Z 549862.597050 CM SEQDB
#=GF DR snoRNABase; ACA59;
#=GF DR SO; 0001263; ncRNA_gene;
#=GF DR GO; 0006396; RNA processing;
#=GF DR GO; 0005730; nucleolus;
#=GF RN [1]
#=GF RM 15199136
#=GF RT Human box H/ACA pseudouridylation guide RNA machinery.
#=GF RA Kiss AM, Jady BE, Bertrand E, Kiss T
#=GF RL Mol Cell Biol. 2004;24:5797-5807.
#=GF WK Small_nucleolar_RNA
#=GF SQ 3
AL031296.1/85969-86120 CUGCCUCACAACGUUUGUGCCUCAGUUACCCGUAGAUGUAGUGAGGGUAACAAUACUUACUCUCGUUGGUGAUAAGGAACAGC
AANU01225121.1/438-603 CUGCCUCACAACAUUUGUGCCUCAGUUACUCAUAGAUGUAGUGAGGGUGACAAUACUUACUCUCGUUGGUGAUAAGGAACAGC
AAWR02037329.1/29294-29150 ---CUCGACACCACU---GCCUCGGUUACCCAUCGGUGCAGUGCGGGUAGUAGUACCAAUGCUAAUUAGUUGUGAGGACCAAC
#=GC SS_cons -----((((,<<<<<<<<<___________>>>>>>>>>,,,,<<<<<<<______>>>>>>>,,,,,)))):::::::::::
#=GC RF CUGCcccaCAaCacuuguGCCUCaGUUACcCauagguGuAGUGaGgGuggcAaUACccaCcCucgUUgGuggUaAGGAaCAgC
//
Generated by Doxygen
8.1 File formats for Multiple Sequence Alignments (MSA) 33
Note
Sequence names must not contain whitespace characters. Otherwise, the parts after the first whitespace will
be dropped. The only allowed gap character is the hyphen ("-").
>AL031296.1/85969-86120
CUGCCUCACAACGUUUGUGCCUCAGUUACCCGUAGAUGUAGUGAGGGUAACAAUACUUAC
UCUCGUUGGUGAUAAGGAACAGCU
>AANU01225121.1/438-603
CUGCCUCACAACAUUUGUGCCUCAGUUACUCAUAGAUGUAGUGAGGGUGACAAUACUUAC
UCUCGUUGGUGAUAAGGAACAGCU
>AAWR02037329.1/29294-29150
---CUCGACACCACU---GCCUCGGUUACCCAUCGGUGCAGUGCGGGUAGUAGUACCAAU
GCUAAUUAGUUGUGAGGACCAACU
The multiple alignment format (MAF) is usually used to store multiple alignments on DNA level between entire
genomes. It consists of independent blocks of aligned sequences which are annotated by their genomic location.
Consequently, an MAF formatted MSA file may contain multiple records. MAF files start with a line
##maf
which is optionally extended by whitespace delimited key=value pairs. Lines starting with the character ("#") are
considered comments and usually ignored.
A MAF block starts with character ("a") at the beginning of a line, optionally followed by whitespace delimited
key=value pairs. The next lines start with character ("s") and contain sequence information of the form
where
start is the start of the aligned region within the source (0-based)
strand is either ("+") or ("-"), depicting the location of the aligned region relative to the source
srcSize is the size of the entire sequence source, e.g. the full chromosome
sequence is the aligned sequence including gaps depicted by the hyphen ("-")
Here is an example alignment in MAF format (bluntly taken from the UCSC Genome browser website):
Generated by Doxygen
34 Input / Output File Formats
a score=23262.0
s hg16.chr7 27578828 38 + 158545518 AAA-GGGAATGTTAACCAAATGA---ATTGTCTCTTACGGTG
s panTro1.chr6 28741140 38 + 161576975 AAA-GGGAATGTTAACCAAATGA---ATTGTCTCTTACGGTG
s baboon 116834 38 + 4622798 AAA-GGGAATGTTAACCAAATGA---GTTGTCTCTTATGGTG
s mm4.chr6 53215344 38 + 151104725 -AATGGGAATGTTAAGCAAACGA---ATTGTCTCTCAGTGTG
s rn3.chr4 81344243 40 + 187371129 -AA-GGGGATGCTAAGCCAATGAGTTGTTGTCTCTCAATGTG
a score=5062.0
s hg16.chr7 27699739 6 + 158545518 TAAAGA
s panTro1.chr6 28862317 6 + 161576975 TAAAGA
s baboon 241163 6 + 4622798 TAAAGA
s mm4.chr6 53303881 6 + 151104725 TAAAGA
s rn3.chr4 81444246 6 + 187371129 taagga
a score=6636.0
s hg16.chr7 27707221 13 + 158545518 gcagctgaaaaca
s panTro1.chr6 28869787 13 + 161576975 gcagctgaaaaca
s baboon 249182 13 + 4622798 gcagctgaaaaca
s mm4.chr6 53310102 13 + 151104725 ACAGCTGAAAATA
The RNAlib and many programs of the ViennaRNA Package can parse and apply data from so-called command
files. These commands may refer to structure constraints or even extensions of the RNA folding grammar (such
as Unstructured domains). Commands are given as a line of whitespace delimited data fields. The syntax we use
extends the constraint definitions used in the mfold / UNAfold software, where each line begins with a command
character followed by a set of positions.
However, we introduce several new commands, and allow for an optional loop type context specifier in form of
a sequence of characters, and an orientation flag that enables one to force a nucleotide to pair upstream, or
downstream.
F . . . Force
P . . . Prohibit
C . . . Conflicts/Context dependency
Generated by Doxygen
8.2 File formats to manipulate the RNA folding grammar 35
The optional loop type context specifier [LOOP] may be a combination of the following:
E . . . Exterior loop
H . . . Hairpin loop
I . . . Interior loop
M . . . Multibranch loop
A . . . All loops
For structure constraints, we additionally allow one to address base pairs enclosed by a particular kind of loop,
which results in the specifier [WHERE] which consists of [LOOP] plus the following character:
If no [LOOP] or [WHERE] flags are set, all contexts are considered (equivalent to A )
For particular nucleotides that are forced to pair, the following [ORIENTATION] flags may be used:
U . . . Upstream
D . . . Downstream
Sequence positions of nucleotides/base pairs are 1 based and consist of three positions i, j , and k . Alternativly,
four positions may be provided as a pair of two position ranges [i : j], and [k : l] using the '-' sign as delimiter within
each range, i.e. i j , and k l.
Generated by Doxygen
36 Input / Output File Formats
Below are resulting general cases that are considered valid constraints:
F i 0 k [WHERE] [ORIENTATION]
Description:
Enforces the set of k consecutive nucleotides starting at position i to be paired. The optional loop type
specifier [WHERE] allows to force them to appear as closing/enclosed pairs of certain types of loops.
2. "Forcing a set of consecutive base pairs to form":
Syntax:
F i j k [WHERE]
Description:
Enforces the base pairs (i, j), . . . , (i+(k 1), j (k 1)) to form. The optional loop type specifier [WHERE]
allows to specify in which loop context the base pair must appear.
3. "Prohibiting a range of nucleotide positions to be paired":
Syntax:
P i 0 k [WHERE]
Description:
Prohibit a set of k consecutive nucleotides to participate in base pairing, i.e. make these positions unpaired.
The optional loop type specifier [WHERE] allows to force the nucleotides to appear within the loop of specific
types.
4. "Probibiting a set of consecutive base pairs to form":
Syntax:
P i j k [WHERE]
Description:
Probibit the base pairs (i, j), . . . , (i + (k 1), j (k 1)) to form. The optional loop type specifier [WHERE]
allows to specify the type of loop they are disallowed to be the closing or an enclosed pair of.
5. "Prohibiting two ranges of nucleotides to pair with each other":
Syntax:
Description:
Prohibit any nucleotide p [i : j] to pair with any other nucleotide q [k : l]. The optional loop type specifier
[WHERE] allows to specify the type of loop they are disallowed to be the closing or an enclosed pair of.
6. "Enforce a loop context for a range of nucleotide positions":
Syntax:
C i 0 k [WHERE]
Description:
This command enforces nucleotides to be unpaired similar to prohibiting nucleotides to be paired, as de-
scribed above. It too marks the corresponding nucleotides to be unpaired, however, the [WHERE] flag can
be used to enforce specfic loop types the nucleotides must appear in.
Generated by Doxygen
8.2 File formats to manipulate the RNA folding grammar 37
C i j k
Description:
Remove all base pairs that conflict with a set of consecutive base pairs (i, j), . . . , (i + (k 1), j (k 1)).
Two base pairs (i, j) and (p, q) conflict with each other if i < p < j < q , or p < i < q < j .
A i j k [WHERE]
Description:
This command enables the formation of the consecutive base pairs (i, j), . . . , (i + (k 1), j (k 1)), no
matter if they are canonical, or non-canonical. In contrast to the above F and W commands, which remove
conflicting base pairs, the A command does not. Therefore, it may be used to allow non-canoncial base pair
interactions. Since the RNAlib does not contain free energy contributions Eij for non-canonical base pairs
(i, j), they are scored as the maximum of similar, known contributions. In terms of a Nussinov like scoring
function the free energy of non-canonical base pairs is therefore estimated as
Eij = min max Eik , max Ekj .
(i,k){GC,CG,AU,U A,GU,U G} (k,j){GC,CG,AU,U A,GU,U G}
The optional loop type specifier [WHERE] allows to specify in which loop context the base pair may appear.
E i 0 k e
Description:
Use this command to apply a pseudo free energy of e to the set of k consecutive nucleotides, starting
at position i. The pseudo free energy is applied only if these nucleotides are considered unpaired in the
recursions, or evaluations, and is expected to be given in kcal/mol.
E i j k e
Use this command to apply a pseudo free energy of e to the set of base pairs (i, j), . . . , (i + (k 1), j
(k 1)). Energies are expected to be given in kcal/mol.
UD m e [LOOP]
Description:
Add ligand binding to unpaired sequence motif m (given in IUPAC format, capital letters) with binding energy
e in particular loop type(s).
Example:
Generated by Doxygen
38 Input / Output File Formats
UD AAA -5.0 A
The above example applies a binding free energy of 5kcal/mol for a motif AAA that may be present in all
loop types.
Generated by Doxygen
Chapter 9
Examples
The following program exercises most commonly used functions of the library. The program folds two sequences
using both the mfe and partition function algorithms and calculates the tree edit and profile distance of the resulting
structures and base pairing probabilities.
Note
This program uses the old API of RNAlib, which is in part already marked deprecated. Please consult the
RNAlib API v3.0 page for details of what changes are necessary to port your implementation to the new API.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "utils.h"
#include "fold_vars.h"
#include "fold.h"
#include "part_func.h"
#include "inverse.h"
#include "RNAstruct.h"
#include "treedist.h"
#include "stringdist.h"
#include "profiledist.h"
void main()
{
char *seq1="CGCAGGGAUACCCGCG", *seq2="GCGCCCAUAGGGACGC",
*struct1,* struct2,* xstruc;
float e1, e2, tree_dist, string_dist, profile_dist, kT;
Tree *T1, *T2;
swString *S1, *S2;
float *pf1, *pf2;
FLT_OR_DBL *bppm;
/* fold at 30C instead of the default 37C */
temperature = 30.; /* must be set *before* initializing */
S1 = Make_swString(xstruc);
free(xstruc);
xstruc = expand_Full(struct2);
T2 = make_tree(xstruc);
S2 = Make_swString(xstruc);
free(xstruc);
/* for longer sequences one should also set a scaling factor for
partition function folding, e.g: */
kT = (temperature+273.15)*1.98717/1000.; /* kT in kcal/mol */
pf_scale = exp(-e1/kT/strlen(seq1));
e2 = pf_fold(seq2, struct2);
/* get the base pair probability matrix for the previous run of pf_fold() */
bppm = export_bppm();
pf2 = Make_bp_profile_bppm(bppm, strlen(seq2));
free_profile(pf1); free_profile(pf2);
}
where ${hpath} and ${lpath} point to the location of the header files and library, respectively.
Note
As default, the RNAlib is compiled with build-in OpenMP multithreading support. Thus, when linking your own
object files to the library you have to pass the compiler specific ${OPENMP_CFLAGS} (e.g. '-fopenmp' for
gcc) even if your code does not use openmp specific code. However, in that case the OpenMP flags may be
ommited when compiling example.c
Generated by Doxygen
9.2 Perl Examples 41
The following is a simple program that computes the MFE, partition function, and centroid structure by making use
of the v3.0 API.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ViennaRNA/data_structures.h>
#include <ViennaRNA/params.h>
#include <ViennaRNA/utils.h>
#include <ViennaRNA/eval.h>
#include <ViennaRNA/fold.h>
#include <ViennaRNA/part_func.h>
/* call PF function */
FLT_OR_DBL en = vrna_pf(vc, prob_string);
/* print centroid structure, its free energy and mean distance to the ensemble */
printf("%s (%6.2f d=%6.2f)\n", cent, vrna_eval_structure(vc, cent), dist);
return EXIT_SUCCESS;
}
00001 #!/usr/bin/perl
00002
00003 use warnings;
00004 use strict;
Generated by Doxygen
42 Examples
00005
00006 use RNA;
00007
00008 my $seq1 = "CGCAGGGAUACCCGCG";
00009
00010 # compute minimum free energy (mfe) and corresponding structure
00011 my ($ss, $mfe) = RNA::fold($seq1);
00012
00013 # print output
00014 printf "%s [ %6.2f ]\n", $ss, $mfe;
The 'fold_compound' class that serves as an object oriented interface for vrna_fold_compound_t
00001 #!/usr/bin/perl
00002
00003 use warnings;
00004 use strict;
00005
00006 use RNA;
00007
00008 my $seq1 = "CGCAGGGAUACCCGCG";
00009
00010 # create new fold_compound object
00011 my $fc = new RNA::fold_compound($seq1);
00012
00013 # compute minimum free energy (mfe) and corresponding structure
00014 my ($ss, $mfe) = $fc->mfe();
00015
00016 # print output
00017 printf "%s [ %6.2f ]\n", $ss, $mfe;
The 'fold_compound' class that serves as an object oriented interface for vrna_fold_compound_t
Generated by Doxygen
9.3 Python Examples 43
Generated by Doxygen
44 Examples
Generated by Doxygen
Chapter 10
Deprecated List
Global bondT
Use vrna_bp_stack_t instead!
Global bp_distance (const char str1, const char str2)
Use vrna_bp_distance instead
Global bppm_symbol (const float x)
Use vrna_bpp_symbol() instead!
Global bppm_to_structure (char structure, FLT_OR_DBL pr, unsigned int length)
Use vrna_db_from_probs() instead!
Global centroid (int length, double dist)
This function is deprecated and should not be used anymore as it is not threadsafe!
Global circalifold (const char strings, char structure)
Usage of this function is discouraged! Use vrna_alicircfold(), and vrna_mfe() instead!
46 Deprecated List
Generated by Doxygen
47
Global energy_of_struct_par (const char string, const char structure, vrna_param_t parameters, int
verbosity_level)
Use vrna_eval_structure() or vrna_eval_structure_verbose() instead!
Global energy_of_struct_pt (const char string, short ptable, short s, short s1)
This function is deprecated and should not be used in future programs! Use energy_of_structure_pt() instead!
Global energy_of_struct_pt_par (const char string, short ptable, short s, short s1, vrna_param_-
t parameters, int verbosity_level)
Use vrna_eval_structure_pt() or vrna_eval_structure_pt_verbose() instead!
Global energy_of_structure (const char string, const char structure, int verbosity_level)
Use vrna_eval_structure() or vrna_eval_structure_verbose() instead!
Global energy_of_structure_pt (const char string, short ptable, short s, short s1, int verbosity_level)
Use vrna_eval_structure_pt() or vrna_eval_structure_pt_verbose() instead!
Global expHairpinEnergy (int u, int type, short si1, short sj1, const char string)
Use exp_E_Hairpin() from loop_energies.h instead
Global expLoopEnergy (int u1, int u2, int type, int type2, short si1, short sj1, short sp1, short sq1)
Use exp_E_IntLoop() from loop_energies.h instead
Global export_circfold_arrays (int Fc_p, int FcH_p, int FcI_p, int FcM_p, int fM2_p, int f5_p, int
c_p, int fML_p, int fM1_p, int indx_p, char ptype_p)
See vrna_mfe() and vrna_fold_compound_t for the usage of the new API!
Global export_circfold_arrays_par (int Fc_p, int FcH_p, int FcI_p, int FcM_p, int fM2_p, int f5_p, int
c_p, int fML_p, int fM1_p, int indx_p, char ptype_p, vrna_param_t P_p)
See vrna_mfe() and vrna_fold_compound_t for the usage of the new API!
Global export_cofold_arrays (int f5_p, int c_p, int fML_p, int fM1_p, int fc_p, int indx_p, char
ptype_p)
folding matrices now reside within the vrna_fold_compound_t. Thus, this function will only work in conjunction
with a prior call to the deprecated functions cofold() or cofold_par()
Global export_cofold_arrays_gq (int f5_p, int c_p, int fML_p, int fM1_p, int fc_p, int ggg_p, int
indx_p, char ptype_p)
folding matrices now reside within the fold compound. Thus, this function will only work in conjunction with a
prior call to cofold() or cofold_par()
Global export_fold_arrays (int f5_p, int c_p, int fML_p, int fM1_p, int indx_p, char ptype_p)
See vrna_mfe() and vrna_fold_compound_t for the usage of the new API!
Global export_fold_arrays_par (int f5_p, int c_p, int fML_p, int fM1_p, int indx_p, char ptype-
_p, vrna_param_t P_p)
See vrna_mfe() and vrna_fold_compound_t for the usage of the new API!
Generated by Doxygen
48 Deprecated List
Global fold_par (const char sequence, char structure, vrna_param_t parameters, int is_constrained, int
is_circular)
use vrna_mfe() instead!
Global free_alifold_arrays (void)
Usage of this function is discouraged! It only affects memory being free'd that was allocated by an old API
function before. Release of memory occupied by the newly introduced vrna_fold_compound_t is handled by
vrna_vrna_fold_compound_free()
Global free_alipf_arrays (void)
Usage of this function is discouraged! This function only free's memory allocated by old API function calls.
Memory allocated by any of the new API calls (starting with vrna_) will be not affected!
Global free_arrays (void)
See vrna_fold(), vrna_circfold(), or vrna_mfe() and vrna_fold_compound_t for the usage of the new API!
Global free_co_arrays (void)
This function will only free memory allocated by a prior call of cofold() or cofold_par(). See vrna_mfe_dimer()
for how to use the new API
Global free_co_pf_arrays (void)
This function will be removed for the new API soon! See vrna_pf_dimer(), vrna_fold_compound(), and vrna_-
fold_compound_free() for an alternative
Global free_pf_arrays (void)
See vrna_fold_compound_t and its related functions for how to free memory occupied by the dynamic program-
ming matrices
Global get_alipf_arrays (short S_p, short S5_p, short S3_p, unsigned short a2s_p, char -
Ss_p, FLT_OR_DBL qb_p, FLT_OR_DBL qm_p, FLT_OR_DBL q1k_p, FLT_OR_DBL qln_p,
short pscore)
It is discouraged to use this function! The new vrna_fold_compound_t allows direct access to all necessary
consensus structure prediction related variables!
Global get_boltzmann_factor_copy (vrna_exp_param_t parameters)
Use vrna_exp_params_copy() instead!
Global get_boltzmann_factors (double temperature, double betaScale, vrna_md_t md, double pf_scale)
Use vrna_exp_params() instead!
Global get_boltzmann_factors_ali (unsigned int n_seq, double temperature, double betaScale, vrna_md_t
md, double pf_scale)
Use vrna_exp_params_comparative() instead!
Global get_centroid_struct_gquad_pr (int length, double dist)
This function is deprecated and should not be used anymore as it is not threadsafe!
Global get_centroid_struct_pl (int length, double dist, vrna_plist_t pl)
This function was renamed to vrna_centroid_from_plist()
Global get_centroid_struct_pr (int length, double dist, FLT_OR_DBL pr)
This function was renamed to vrna_centroid_from_probs()
Global get_concentrations (double FEAB, double FEAA, double FEBB, double FEA, double FEB, double
startconc)
{ Use vrna_pf_dimer_concentrations() instead!}
Global get_line (FILE fp)
Use vrna_read_line() as a substitute!
Global get_monomere_mfes (float e1, float e2)
{This function is obsolete and will be removed soon!}
Global get_mpi (char Alseq[], int n_seq, int length, int mini)
Use vrna_aln_mpi() as a replacement
Generated by Doxygen
49
Global get_TwoDfold_variables (const char seq, const char structure1, const char structure2, int circ)
Use the new API that relies on vrna_fold_compound_t and the corresponding functions vrna_fold_compound-
_TwoD(), vrna_mfe_TwoD(), and vrna_fold_compound_free() instead!
Global get_TwoDpfold_variables (const char seq, const char structure1, char structure2, int circ)
Use the new API that relies on vrna_fold_compound_t and the corresponding functions vrna_fold_compound-
_TwoD(), vrna_pf_TwoD(), and vrna_fold_compound_free() instead!
Global HairpinE (int size, int type, int si1, int sj1, const char string)
{This function is deprecated and will be removed soon. Use E_Hairpin() instead!}
Global iindx
Do not use this variable anymore!
Global Lfoldz (const char string, char structure, int maxdist, int zsc, double min_z)
Use vrna_mfe_window_zscore() instead!
Global LoopEnergy (int n1, int n2, int type, int type_2, int si1, int sj1, int sp1, int sq1)
{This function is deprecated and will be removed soon. Use E_IntLoop() instead!}
Generated by Doxygen
50 Deprecated List
Global PAIR
Use vrna_basepair_t instead!
Global pair_info
Use vrna_pinfo_t instead!
Global paramT
Use vrna_param_t instead!
Global parenthesis_structure (char structure, vrna_bp_stack_t bp, int length)
use vrna_parenthesis_structure() instead
Global parenthesis_zuker (char structure, vrna_bp_stack_t bp, int length)
use vrna_parenthesis_zuker instead
Global path_t
Use vrna_path_t instead!
Global pbacktrack_circ (char sequence)
Use vrna_pbacktrack() instead.
Global pf_circ_fold (const char sequence, char structure)
Use vrna_pf() instead!
Global pf_fold_par (const char sequence, char structure, vrna_exp_param_t parameters, int calculate-
_bppm, int is_constrained, int is_circular)
Use vrna_pf() instead
Global pf_paramT
Use vrna_exp_param_t instead!
Global plist
Use vrna_plist_t instead!
Global pr
Do not use this variable anymore!
Global print_tty_constraint (unsigned int option)
Use vrna_message_constraints() instead!
Generated by Doxygen
51
Global sect
Use vrna_sect_t instead!
Global set_model_details (vrna_md_t md)
This function will vanish as soon as backward compatibility of RNAlib is dropped (expected in version 3). Use
vrna_md_set_default() instead!
Global SOLUTION
Use vrna_subopt_solution_t instead!
Global space (unsigned size)
Use vrna_alloc() instead!
Global st_back
set the uniq_ML flag in vrna_md_t before passing it to vrna_fold_compound().
Global stackProb (double cutoff)
Use vrna_stack_prob() instead!
Global str_DNA2RNA (char sequence)
Use vrna_seq_toRNA() instead!
Global str_uppercase (char sequence)
Use vrna_seq_toupper() instead!
Global temperature
Use vrna_md_defaults_temperature(), and vrna_md_defaults_temperature_get() to change, and read the global
default temperature settings
Global time_stamp (void)
Use vrna_time_stamp() instead!
Global TwoDfold_backtrack_f5 (unsigned int j, int k, int l, TwoDfold_vars vars)
Use the new API that relies on vrna_fold_compound_t and the corresponding functions vrna_fold_compound-
_TwoD(), vrna_mfe_TwoD(), vrna_backtrack5_TwoD(), and vrna_fold_compound_free() instead!
Generated by Doxygen
52 Deprecated List
Global TwoDfold_vars
This data structure will be removed from the library soon! Use vrna_fold_compound_t and the corresponding
functions vrna_fold_compound_TwoD(), vrna_mfe_TwoD(), and vrna_fold_compound_free() instead!
Global TwoDfoldList (TwoDfold_vars vars, int distance1, int distance2)
Use the new API that relies on vrna_fold_compound_t and the corresponding functions vrna_fold_compound-
_TwoD(), vrna_mfe_TwoD(), and vrna_fold_compound_free() instead!
Global TwoDpfold_pbacktrack (TwoDpfold_vars vars, int d1, int d2)
Use the new API that relies on vrna_fold_compound_t and the corresponding functions vrna_fold_compound-
_TwoD(), vrna_pf_TwoD(), vrna_pbacktrack_TwoD(), and vrna_fold_compound_free() instead!
Global TwoDpfold_pbacktrack5 (TwoDpfold_vars vars, int d1, int d2, unsigned int length)
Use the new API that relies on vrna_fold_compound_t and the corresponding functions vrna_fold_compound-
_TwoD(), vrna_pf_TwoD(), vrna_pbacktrack5_TwoD(), and vrna_fold_compound_free() instead!
Class TwoDpfold_vars
This data structure will be removed from the library soon! Use vrna_fold_compound_t and the corresponding
functions vrna_fold_compound_TwoD(), vrna_pf_TwoD(), and vrna_fold_compound_free() instead!
Global TwoDpfoldList (TwoDpfold_vars vars, int maxDistance1, int maxDistance2)
Use the new API that relies on vrna_fold_compound_t and the corresponding functions vrna_fold_compound-
_TwoD(), vrna_pf_TwoD(), and vrna_fold_compound_free() instead!
Global unpack_structure (const char packed)
Use vrna_db_unpack() as a replacement
Global update_alifold_params (void)
Usage of this function is discouraged! The new API uses vrna_fold_compound_t to lump all folding related
necessities together, including the energy parameters. Use vrna_update_fold_params() to update the energy
parameters within a vrna_fold_compound_t.
Global update_co_pf_params (int length)
Use vrna_exp_params_subst() instead!
Global update_co_pf_params_par (int length, vrna_exp_param_t parameters)
Use vrna_exp_params_subst() instead!
Global update_cofold_params (void)
See vrna_params_subst() for an alternative using the new API
Global update_cofold_params_par (vrna_param_t parameters)
See vrna_params_subst() for an alternative using the new API
Global update_fold_params (void)
For non-default model settings use the new API with vrna_params_subst() and vrna_mfe() instead!
Global update_fold_params_par (vrna_param_t parameters)
For non-default model settings use the new API with vrna_params_subst() and vrna_mfe() instead!
Global update_pf_params (int length)
Use vrna_exp_params_subst() instead
Global update_pf_params_par (int length, vrna_exp_param_t parameters)
Use vrna_exp_params_subst() instead
Global urn (void)
Use vrna_urn() instead!
Global VRNA_CONSTRAINT_FILE
Use 0 instead!
Global VRNA_CONSTRAINT_MULTILINE
see vrna_extract_record_rest_structure()
Generated by Doxygen
53
Global VRNA_CONSTRAINT_NO_HEADER
This mode is not supported anymore!
Global VRNA_CONSTRAINT_SOFT_MFE
This flag has no meaning anymore, since constraints are now always stored!
Global VRNA_CONSTRAINT_SOFT_PF
Use VRNA_OPTION_PF instead!
Global vrna_exp_param_s::id
This attribute will be removed in version 3
Global vrna_extract_record_rest_constraint (char cstruc, const char lines, unsigned int option)
Use vrna_extract_record_rest_structure() instead!
Global vrna_fc_s::pscore_pf_compat
This attribute will vanish in the future!
Global vrna_fc_s::ptype_pf_compat
This attribute will vanish in the future! It's meant for backward compatibility only!
Global warn_user (const char message[])
Use vrna_message_warning() instead!
Global xrealloc (void p, unsigned size)
Use vrna_realloc() instead!
Global zukersubopt (const char string)
use vrna_zukersubopt() instead
Global zukersubopt_par (const char string, vrna_param_t parameters)
use vrna_zukersubopt() instead
Generated by Doxygen
54 Deprecated List
Generated by Doxygen
Chapter 11
Bug List
Module domains_up
Although the additional production rule(s) for unstructured domains in the descriptions of this feature are always
treated as 'segments possibly bound to one or more ligands', the current implementation requires that at least
one ligand is bound. The default implementation already takes care of the required changes, however, upon
using callback functions other than the default ones, one has to take care of this fact. Please also note, that
this behavior might change in one of the next releases, such that the decomposition schemes as shown above
comply with the actual implementation.
Global vrna_subopt_zuker (vrna_fold_compound_t vc)
Due to resizing, any pre-existing constraints will be lost!
56 Bug List
Generated by Doxygen
Chapter 12
Module Index
12.1 Modules
Generated by Doxygen
Chapter 13
_struct_en
Data structure for energy_of_move() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
COORDINATE
This is a workarround for the SWIG Perl Wrapper RNA plot function that returns an array of type
COORDINATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
Postorder_list
Postorder data structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
swString
Some other data structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
Tree
Tree data structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
TwoDpfold_vars
Variables compound for 2Dfold partition function folding . . . . . . . . . . . . . . . . . . . . . 399
vrna_command_s
List element for commands ready for application to a vrna_fold_compound_t . . . . . . . . . . 400
vrna_dotplot_auxdata_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
vrna_gr_aux_s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
vrna_hx_s
Data structure representing an entry of a helix list . . . . . . . . . . . . . . . . . . . . . . . . 401
vrna_md_s
The data structure that contains the complete model details used throughout the calculations . 401
vrna_pinfo_s
A base pair info structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
vrna_sc_motif_s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
vrna_structured_domains_s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
vrna_subopt_sol_s
Solution element from subopt.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
vrna_unstructured_domain_motif_s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
60 Data Structure Index
Generated by Doxygen
Chapter 14
File Index
ViennaRNA/1.8.4_epars.h
Free energy parameters for parameter file conversion . . . . . . . . . . . . . . . . . . . . . . 407
ViennaRNA/1.8.4_intloops.h
Free energy parameters for interior loop contributions needed by the parameter file conversion
functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
ViennaRNA/2Dfold.h
MFE structures for base pair distance classes . . . . . . . . . . . . . . . . . . . . . . . . . . 408
ViennaRNA/2Dpfold.h
Partition function implementations for base pair distance classes . . . . . . . . . . . . . . . . 409
ViennaRNA/ali_plex.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/alifold.h
Functions for comparative structure prediction using RNA sequence alignments . . . . . . . . 413
ViennaRNA/aln_util.h
Various utility- and helper-functions for sequence alignments and comparative structure predic-
tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
ViennaRNA/alphabet.h
Functions to process, convert, and generally handle different nucleotide and/or base pair alpha-
bets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
ViennaRNA/boltzmann_sampling.h
Boltzmann Sampling of secondary structures from the ensemble . . . . . . . . . . . . . . . . 417
ViennaRNA/centroid.h
Centroid structure computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
ViennaRNA/cofold.h
MFE implementations for RNA-RNA interaction . . . . . . . . . . . . . . . . . . . . . . . . . 419
ViennaRNA/combinatorics.h
Various implementations that deal with combinatorial aspects of RNA/DNA folding . . . . . . . 420
ViennaRNA/commands.h
Parse and apply different commands that alter the behavior of secondary structure prediction
and evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
ViennaRNA/constraints.h
Functions and data structures for constraining secondary structure predictions and evaluation . 424
ViennaRNA/constraints_hard.h
Functions and data structures for handling of secondary structure hard constraints . . . . . . . 426
ViennaRNA/constraints_ligand.h
Functions for incorporation of ligands binding to hairpin and interior loop motifs using the soft
constraints framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
62 File Index
ViennaRNA/constraints_SHAPE.h
This module provides function to incorporate SHAPE reactivity data into the folding recursions
by means of soft constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
ViennaRNA/constraints_soft.h
Functions and data structures for secondary structure soft constraints . . . . . . . . . . . . . 432
ViennaRNA/convert_epars.h
Functions and definitions for energy parameter file format conversion . . . . . . . . . . . . . . 433
ViennaRNA/data_structures.h
Various data structures and pre-processor macros . . . . . . . . . . . . . . . . . . . . . . . 434
ViennaRNA/dist_vars.h
Global variables for Distance-Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
ViennaRNA/dp_matrices.h
Functions to deal with standard dynamic programming (DP) matrices . . . . . . . . . . . . . . 438
ViennaRNA/duplex.h
Functions for simple RNA-RNA duplex interactions . . . . . . . . . . . . . . . . . . . . . . . 439
ViennaRNA/edit_cost.h
Global variables for Edit Costs included by treedist.c and stringdist.c . . . . . . . . . . . . . . 439
ViennaRNA/energy_const.h
Energy parameter constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
ViennaRNA/energy_par.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/equilibrium_probs.h
Equilibrium Probability implementations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
ViennaRNA/eval.h
Functions and variables related to energy evaluation of sequence/structure pairs . . . . . . . . 442
ViennaRNA/exterior_loops.h
Energy evaluation of exterior loops for MFE and partition function calculations . . . . . . . . . 444
ViennaRNA/file_formats.h
Read and write different file formats for RNA sequences, structures . . . . . . . . . . . . . . . 447
ViennaRNA/file_formats_msa.h
Functions dealing with file formats for Multiple Sequence Alignments (MSA) . . . . . . . . . . 453
ViennaRNA/file_utils.h
Several utilities for file handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
ViennaRNA/findpath.h
A breadth-first search heuristic for optimal direct folding paths . . . . . . . . . . . . . . . . . . 455
ViennaRNA/fold.h
MFE calculations for single RNA sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
ViennaRNA/fold_vars.h
Here all all declarations of the global variables used throughout RNAlib . . . . . . . . . . . . . 457
ViennaRNA/gquad.h
G-quadruplexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
ViennaRNA/grammar.h
Implementations for the RNA folding grammar . . . . . . . . . . . . . . . . . . . . . . . . . . 460
ViennaRNA/hairpin_loops.h
Energy evaluation of hairpin loops for MFE and partition function calculations . . . . . . . . . 460
ViennaRNA/interior_loops.h
Energy evaluation of interior loops for MFE and partition function calculations . . . . . . . . . 461
ViennaRNA/intl11.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/intl11dH.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/intl21.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/intl21dH.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/intl22.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/intl22dH.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/inverse.h
Inverse folding routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
ViennaRNA/Lfold.h
Functions for locally optimal MFE structure prediction . . . . . . . . . . . . . . . . . . . . . . 463
ViennaRNA/loop_energies.h
Energy evaluation for MFE and partition function calculations . . . . . . . . . . . . . . . . . . 464
Generated by Doxygen
14.1 File List 63
ViennaRNA/LPfold.h
Partition function implementation for the Lfold algorithm . . . . . . . . . . . . . . . . . . . . . 464
ViennaRNA/MEA.h
Computes a MEA (maximum expected accuracy) structure . . . . . . . . . . . . . . . . . . . 465
ViennaRNA/mfe.h
MFE calculations for single RNA sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
ViennaRNA/mm.h
Several Maximum Matching implementations . . . . . . . . . . . . . . . . . . . . . . . . . . 466
ViennaRNA/model.h
The model details data structure and its corresponding modifiers . . . . . . . . . . . . . . . . 467
ViennaRNA/move_set.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/multibranch_loops.h
Energy evaluation of multibranch loops for MFE and partition function calculations . . . . . . . 471
ViennaRNA/naview.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
ViennaRNA/neighbor.h
Methods to compute the neighbors of an RNA secondary structure . . . . . . . . . . . . . . . 473
ViennaRNA/pair_mat.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/params.h
Functions to deal with sets of energy parameters . . . . . . . . . . . . . . . . . . . . . . . . 475
ViennaRNA/part_func.h
Partition function implementations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
ViennaRNA/part_func_co.h
Partition function for two RNA sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
ViennaRNA/part_func_up.h
Implementations for accessibility and RNA-RNA interaction as a stepwise process . . . . . . . 485
ViennaRNA/perturbation_fold.h
Find a vector of perturbation energies that minimizes the discripancies between predicted and
observed pairing probabilities and the amount of neccessary adjustments . . . . . . . . . . . 486
ViennaRNA/PKplex.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/plex.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/plot_aln.h
Various functions for plotting Sequence / Structure Alignments . . . . . . . . . . . . . . . . . 487
ViennaRNA/plot_layouts.h
Secondary structure plot layout algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
ViennaRNA/plot_structure.h
Various functions for plotting RNA secondary structures . . . . . . . . . . . . . . . . . . . . . 489
ViennaRNA/ProfileAln.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/profiledist.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
ViennaRNA/PS_dot.h
Various functions for plotting RNA secondary structures, dot-plots and other visualizations . . . 491
ViennaRNA/read_epars.h
Read and write energy parameter files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
ViennaRNA/ribo.h
Parse RiboSum Scoring Matrices for Covariance Scoring of Alignments . . . . . . . . . . . . 492
ViennaRNA/RNAstruct.h
Parsing and Coarse Graining of Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
ViennaRNA/snofold.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/snoop.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/special_const.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/string_utils.h
General utility- and helper-functions for RNA sequence and structure strings used throughout the
ViennaRNA Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
ViennaRNA/stringdist.h
Functions for String Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
ViennaRNA/structure_utils.h
Various utility- and helper-functions for secondary structure parsing, converting, etc . . . . . . 498
Generated by Doxygen
64 File Index
ViennaRNA/structured_domains.h
This module provides interfaces that deal with additional structured domains in the folding gram-
mar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
ViennaRNA/subopt.h
RNAsubopt and density of states declarations . . . . . . . . . . . . . . . . . . . . . . . . . . 501
ViennaRNA/svm_utils.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/treedist.h
Functions for Tree Edit Distances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
ViennaRNA/ugly_bt.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/units.h
Physical Units and Functions to convert them into each other . . . . . . . . . . . . . . . . . . 503
ViennaRNA/unstructured_domains.h
Functions to modify unstructured domains, e.g. to incorporate ligands binding to unpaired
stretches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
ViennaRNA/utils.h
General utility- and helper-functions used throughout the ViennaRNA Package . . . . . . . . . 506
ViennaRNA/vrna_config.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??
ViennaRNA/walk.h
Methods to generate particular paths such as gradient or random walks through the energy
landscape of an RNA sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
Generated by Doxygen
Chapter 15
Module Documentation
Modules
Files
file eval.h
Functions and variables related to energy evaluation of sequence/structure pairs.
Functions
Generated by Doxygen
15.1 Free energy evaluation 67
Variables
int cut_point
set to first pos of second seq for cofolding
int eos_debug
verbose info from energy_of_struct
This module covers the functions to evaluate the free energy of a secondary structure given its sequence.
Each base pair in a secondary structure closes a loop, thereby directly enclosing unpaired nucleotides, and/or
further base pairs. Our implementation distinguishes four basic types of loops:
hairpin loops
interior loops
multibranch loops
exterior loop
While the exterior loop is a special case without a closing pair, the other loops are determined by the number of
base pairs involved in the loop formation, i.e. hairpin loops are 1-loops, since only a single base pair delimits the
loop. interior loops are 2-loops due to their enclosing, and enclosed base pair. All loops where more than two base
pairs are involved, are termed multibranch loops.
C U C
5' 5'
3' 3'
G A G 5' 3'
A U
G C A U
enclosed base pair
closing base pair
Any secondary structure can be decomposed into its loops. Each of the loops then can be scored in terms of free
energy, and the free energy of an entire secondary structure is simply the sum of free energies of its loops.
Generated by Doxygen
68 Module Documentation
U UU
U U
A U A C
A C A 3.8
C C 5.4
C C C
C G U U U
U A GG C C G U U G -2.1 C -3.3
G
U C G A -1.0 G C 0.5 G
C G GA U -2.1
G C -3.3
G A
C G
U U U
2.5
U
GC G C
-2.4
CG C G
UA -2.4
U A
CG -2.1
C G
#include <ViennaRNA/eval.h>
This function allows for energy evaluation of a given pair of structure and sequence (alignment). Model details,
energy parameters, and possibly soft constraints are used as provided via the parameter 'vc'. The vrna_fold_-
compound_t does not need to contain any DP matrices, but requires all most basic init values as one would get
from a call like this:
Note
See also
Parameters
Returns
The free energy of the input structure given the input sequence in kcal/mol
SWIG Wrapper Notes This function is attached as method eval_structure() to objects of type fold_compound
Generated by Doxygen
15.1 Free energy evaluation 69
#include <ViennaRNA/eval.h>
Calculate the pseudo energy derived by the covariance scores of a set of aligned sequences.
Consensus structure prediction is driven by covariance scores of base pairs in rows of the provided alignment.
This function allows one to retrieve the total amount of this covariance pseudo energy scores. The vrna_fold_-
compound_t does not need to contain any DP matrices, but requires all most basic init values as one would get
from a call like this:
vc = vrna_fold_compound_comparative(alignment, NULL,
VRNA_OPTION_EVAL_ONLY);
Note
See also
vrna_fold_compound_comparative(), vrna_eval_structure()
Parameters
Returns
The covariance pseudo energy score of the input structure given the input sequence alignment in kcal/mol
SWIG Wrapper Notes This function is attached as method eval_covar_structure() to objects of type fold_-
compound
#include <ViennaRNA/eval.h>
This function allows for energy evaluation of a given sequence/structure pair. In contrast to vrna_eval_structure()
this function assumes default model details and default energy parameters in order to evaluate the free energy
of the secondary structure. Therefore, it serves as a simple interface function for energy evaluation for situations
where no changes on the energy model are required.
See also
Generated by Doxygen
70 Module Documentation
Parameters
string RNA sequence in uppercase letters
structure Secondary structure in dot-bracket notation
Returns
The free energy of the input structure given the input sequence in kcal/mol
15.1.2.4 float vrna_eval_structure_verbose ( vrna_fold_compound_t vc, const char structure, FILE file )
#include <ViennaRNA/eval.h>
Calculate the free energy of an already folded RNA and print contributions on a per-loop base.
This function is a simplyfied version of vrna_eval_structure_v() that uses the default verbosity level. (
See also
Parameters
Returns
The free energy of the input structure given the input sequence in kcal/mol
SWIG Wrapper Notes This function is attached as method eval_structure_verbose() to objects of type fold_-
compound
15.1.2.5 float vrna_eval_structure_v ( vrna_fold_compound_t vc, const char structure, int verbosity_level, FILE file
)
#include <ViennaRNA/eval.h>
Calculate the free energy of an already folded RNA and print contributions on a per-loop base.
This function allows for detailed energy evaluation of a given sequence/structure pair. In contrast to vrna_eval_-
structure() this function prints detailed energy contributions based on individual loops to a file handle. If NULL is
passed as file handle, this function defaults to print to stdout. Any positive verbosity_level activates potential
warning message of the energy evaluting functions, while values 1 allow for detailed control of what data is
printed. A negative parameter verbosity_level turns off printing all together.
Model details, energy parameters, and possibly soft constraints are used as provided via the parameter 'vc'. The
fold_compound does not need to contain any DP matrices, but all the most basic init values as one would get from
a call like this:
Generated by Doxygen
15.1 Free energy evaluation 71
See also
Parameters
Returns
The free energy of the input structure given the input sequence in kcal/mol
15.1.2.6 float vrna_eval_structure_simple_verbose ( const char string, const char structure, FILE file )
#include <ViennaRNA/eval.h>
Calculate the free energy of an already folded RNA and print contributions per loop.
This function is a simplyfied version of vrna_eval_structure_simple_v() that uses the default verbosity level.
See also
Parameters
string RNA sequence in uppercase letters
structure Secondary structure in dot-bracket notation
file A file handle where this function should print to (may be NULL).
Returns
The free energy of the input structure given the input sequence in kcal/mol
15.1.2.7 float vrna_eval_structure_simple_v ( const char string, const char structure, int verbosity_level, FILE file )
#include <ViennaRNA/eval.h>
Calculate the free energy of an already folded RNA and print contributions per loop.
This function allows for detailed energy evaluation of a given sequence/structure pair. In contrast to vrna_eval_-
structure() this function prints detailed energy contributions based on individual loops to a file handle. If NULL is
passed as file handle, this function defaults to print to stdout. Any positive verbosity_level activates potential
warning message of the energy evaluting functions, while values 1 allow for detailed control of what data is
printed. A negative parameter verbosity_level turns off printing all together.
In contrast to vrna_eval_structure_verbose() this function assumes default model details and default energy param-
eters in order to evaluate the free energy of the secondary structure. Threefore, it serves as a simple interface
function for energy evaluation for situations where no changes on the energy model are required.
Generated by Doxygen
72 Module Documentation
See also
Parameters
string RNA sequence in uppercase letters
structure Secondary structure in dot-bracket notation
verbosity_level The level of verbosity of this function
file A file handle where this function should print to (may be NULL).
Returns
The free energy of the input structure given the input sequence in kcal/mol
#include <ViennaRNA/eval.h>
This function allows for energy evaluation of a given sequence/structure pair where the structure is provided in
pair_table format as obtained from vrna_ptable(). Model details, energy parameters, and possibly soft constraints
are used as provided via the parameter 'vc'. The fold_compound does not need to contain any DP matrices, but all
the most basic init values as one would get from a call like this:
See also
Parameters
Returns
The free energy of the input structure given the input sequence in 10cal/mol
SWIG Wrapper Notes This function is attached as method eval_structure_pt() to objects of type fold_compound
#include <ViennaRNA/eval.h>
Generated by Doxygen
15.1 Free energy evaluation 73
In contrast to vrna_eval_structure_pt() this function assumes default model details and default energy parameters
in order to evaluate the free energy of the secondary structure. Threefore, it serves as a simple interface function
for energy evaluation for situations where no changes on the energy model are required.
See also
Parameters
string RNA sequence in uppercase letters
pt Secondary structure as pair_table
Returns
The free energy of the input structure given the input sequence in 10cal/mol
15.1.2.10 int vrna_eval_structure_pt_verbose ( vrna_fold_compound_t vc, const short pt, FILE file )
#include <ViennaRNA/eval.h>
This function is a simplyfied version of vrna_eval_structure_simple_v() that uses the default verbosity level.
See also
Parameters
Returns
The free energy of the input structure given the input sequence in 10cal/mol
SWIG Wrapper Notes This function is attached as method eval_structure_pt_verbose() to objects of type fold-
_compound
15.1.2.11 int vrna_eval_structure_pt_v ( vrna_fold_compound_t vc, const short pt, int verbosity_level, FILE file )
#include <ViennaRNA/eval.h>
Generated by Doxygen
74 Module Documentation
This function allows for energy evaluation of a given sequence/structure pair where the structure is provided in
pair_table format as obtained from vrna_ptable(). Model details, energy parameters, and possibly soft constraints
are used as provided via the parameter 'vc'. The fold_compound does not need to contain any DP matrices, but all
the most basic init values as one would get from a call like this:
In contrast to vrna_eval_structure_pt() this function prints detailed energy contributions based on individual loops to
a file handle. If NULL is passed as file handle, this function defaults to print to stdout. Any positive verbosity-
_level activates potential warning message of the energy evaluting functions, while values 1 allow for detailed
control of what data is printed. A negative parameter verbosity_level turns off printing all together.
See also
Parameters
Returns
The free energy of the input structure given the input sequence in 10cal/mol
15.1.2.12 int vrna_eval_structure_pt_simple_verbose ( const char string, const short pt, FILE file )
#include <ViennaRNA/eval.h>
This function is a simplyfied version of vrna_eval_structure_pt_simple_v() that uses the default verbosity level.
See also
Parameters
string RNA sequence in uppercase letters
pt Secondary structure as pair_table
file A file handle where this function should print to (may be NULL).
Generated by Doxygen
15.1 Free energy evaluation 75
Returns
The free energy of the input structure given the input sequence in 10cal/mol
15.1.2.13 int vrna_eval_structure_pt_simple_v ( const char string, const short pt, int verbosity_level, FILE file )
#include <ViennaRNA/eval.h>
This function allows for energy evaluation of a given sequence/structure pair where the structure is provided in
pair_table format as obtained from vrna_ptable(). Model details, energy parameters, and possibly soft constraints
are used as provided via the parameter 'vc'. The fold_compound does not need to contain any DP matrices, but all
the most basic init values as one would get from a call like this:
In contrast to vrna_eval_structure_pt_verbose() this function assumes default model details and default energy
parameters in order to evaluate the free energy of the secondary structure. Threefore, it serves as a simple interface
function for energy evaluation for situations where no changes on the energy model are required.
See also
Parameters
string RNA sequence in uppercase letters
pt Secondary structure as pair_table
verbosity_level The level of verbosity of this function
file A file handle where this function should print to (may be NULL).
Returns
The free energy of the input structure given the input sequence in 10cal/mol
#include <ViennaRNA/eval.h>
Parameters
Generated by Doxygen
76 Module Documentation
Returns
SWIG Wrapper Notes This function is attached as method eval_loop_pt() to objects of type fold_compound
15.1.2.15 float vrna_eval_move ( vrna_fold_compound_t vc, const char structure, int m1, int m2 )
#include <ViennaRNA/eval.h>
If the parameters m1 and m2 are negative, it is deletion (opening) of a base pair, otherwise it is insertion (opening).
See also
vrna_eval_move_pt()
Parameters
Returns
SWIG Wrapper Notes This function is attached as method eval_move() to objects of type fold_compound
15.1.2.16 int vrna_eval_move_pt ( vrna_fold_compound_t vc, short pt, int m1, int m2 )
#include <ViennaRNA/eval.h>
If the parameters m1 and m2 are negative, it is deletion (opening) of a base pair, otherwise it is insertion (opening).
See also
vrna_eval_move()
Parameters
Returns
SWIG Wrapper Notes This function is attached as method eval_move_pt() to objects of type fold_compound
15.1.2.17 float energy_of_structure ( const char string, const char structure, int verbosity_level )
#include <ViennaRNA/eval.h>
Calculate the free energy of an already folded RNA using global model detail settings.
If verbosity level is set to a value >0, energies of structure elements are printed to stdout
Note
OpenMP: This function relies on several global model settings variables and thus is not to be considered
threadsafe. See energy_of_struct_par() for a completely threadsafe implementation.
See also
vrna_eval_structure()
Parameters
string RNA sequence
structure secondary structure in dot-bracket notation
verbosity_level a flag to turn verbose output on/off
Returns
the free energy of the input structure given the input sequence in kcal/mol
15.1.2.18 float energy_of_struct_par ( const char string, const char structure, vrna_param_t parameters, int
verbosity_level )
#include <ViennaRNA/eval.h>
Calculate the free energy of an already folded RNA.
If verbosity level is set to a value >0, energies of structure elements are printed to stdout
See also
vrna_eval_structure()
Generated by Doxygen
78 Module Documentation
Parameters
string RNA sequence in uppercase letters
structure Secondary structure in dot-bracket notation
parameters A data structure containing the prescaled energy contributions and the model details.
verbosity_level A flag to turn verbose output on/off
Returns
The free energy of the input structure given the input sequence in kcal/mol
15.1.2.19 float energy_of_circ_structure ( const char string, const char structure, int verbosity_level )
#include <ViennaRNA/eval.h>
Note
OpenMP: This function relies on several global model settings variables and thus is not to be considered
threadsafe. See energy_of_circ_struct_par() for a completely threadsafe implementation.
If verbosity level is set to a value >0, energies of structure elements are printed to stdout
See also
vrna_eval_structure()
Parameters
string RNA sequence
structure Secondary structure in dot-bracket notation
verbosity_level A flag to turn verbose output on/off
Returns
The free energy of the input structure given the input sequence in kcal/mol
15.1.2.20 float energy_of_circ_struct_par ( const char string, const char structure, vrna_param_t parameters, int
verbosity_level )
#include <ViennaRNA/eval.h>
Calculate the free energy of an already folded circular RNA.
If verbosity level is set to a value >0, energies of structure elements are printed to stdout
Generated by Doxygen
15.1 Free energy evaluation 79
See also
vrna_eval_structure()
Parameters
string RNA sequence
structure Secondary structure in dot-bracket notation
parameters A data structure containing the prescaled energy contributions and the model details.
verbosity_level A flag to turn verbose output on/off
Returns
The free energy of the input structure given the input sequence in kcal/mol
15.1.2.21 int energy_of_structure_pt ( const char string, short ptable, short s, short s1, int verbosity_level )
#include <ViennaRNA/eval.h>
If verbosity level is set to a value >0, energies of structure elements are printed to stdout
Note
OpenMP: This function relies on several global model settings variables and thus is not to be considered
threadsafe. See energy_of_struct_pt_par() for a completely threadsafe implementation.
See also
vrna_eval_structure_pt()
Parameters
string RNA sequence
ptable the pair table of the secondary structure
s encoded RNA sequence
s1 encoded RNA sequence
verbosity_level a flag to turn verbose output on/off
Generated by Doxygen
80 Module Documentation
Returns
the free energy of the input structure given the input sequence in 10kcal/mol
15.1.2.22 int energy_of_struct_pt_par ( const char string, short ptable, short s, short s1, vrna_param_t
parameters, int verbosity_level )
#include <ViennaRNA/eval.h>
If verbosity level is set to a value >0, energies of structure elements are printed to stdout
See also
vrna_eval_structure_pt()
Parameters
string RNA sequence in uppercase letters
ptable The pair table of the secondary structure
s Encoded RNA sequence
s1 Encoded RNA sequence
parameters A data structure containing the prescaled energy contributions and the model details.
verbosity_level A flag to turn verbose output on/off
Returns
The free energy of the input structure given the input sequence in 10kcal/mol
15.1.2.23 float energy_of_move ( const char string, const char structure, int m1, int m2 )
#include <ViennaRNA/eval.h>
If the parameters m1 and m2 are negative, it is deletion (opening) of a base pair, otherwise it is insertion (opening).
See also
vrna_eval_move()
Generated by Doxygen
15.1 Free energy evaluation 81
Parameters
string RNA sequence
structure secondary structure in dot-bracket notation
m1 first coordinate of base pair
m2 second coordinate of base pair
Returns
15.1.2.24 int energy_of_move_pt ( short pt, short s, short s1, int m1, int m2 )
#include <ViennaRNA/eval.h>
If the parameters m1 and m2 are negative, it is deletion (opening) of a base pair, otherwise it is insertion (opening).
See also
vrna_eval_move_pt()
Parameters
Returns
#include <ViennaRNA/eval.h>
Calculate energy of a loop.
See also
vrna_eval_loop_pt()
Generated by Doxygen
82 Module Documentation
Parameters
Returns
#include <ViennaRNA/eval.h>
Note
This function is not entirely threadsafe! Depending on the state of the global variable eos_debug it prints
energy information to stdout or not...
Deprecated This function is deprecated and should not be used in future programs! Use energy_of_structure()
instead!
See also
Parameters
string RNA sequence
structure secondary structure in dot-bracket notation
Returns
the free energy of the input structure given the input sequence in kcal/mol
15.1.2.27 int energy_of_struct_pt ( const char string, short ptable, short s, short s1 )
#include <ViennaRNA/eval.h>
Generated by Doxygen
15.1 Free energy evaluation 83
Note
This function is not entirely threadsafe! Depending on the state of the global variable eos_debug it prints
energy information to stdout or not...
Deprecated This function is deprecated and should not be used in future programs! Use energy_of_structure_pt()
instead!
See also
make_pair_table(), energy_of_structure()
Parameters
string RNA sequence
ptable the pair table of the secondary structure
s encoded RNA sequence
s1 encoded RNA sequence
Returns
the free energy of the input structure given the input sequence in 10kcal/mol
#include <ViennaRNA/eval.h>
Note
This function is not entirely threadsafe! Depending on the state of the global variable eos_debug it prints
energy information to stdout or not...
Deprecated This function is deprecated and should not be used in future programs Use energy_of_circ_structure()
instead!
See also
Parameters
string RNA sequence
structure secondary structure in dot-bracket notation
Generated by Doxygen
84 Module Documentation
Returns
the free energy of the input structure given the input sequence in kcal/mol
Generated by Doxygen
15.2 Process and evaluate individual loops 85
Files
file exterior_loops.h
Energy evaluation of exterior loops for MFE and partition function calculations.
file hairpin_loops.h
Energy evaluation of hairpin loops for MFE and partition function calculations.
file interior_loops.h
Energy evaluation of interior loops for MFE and partition function calculations.
file loop_energies.h
Energy evaluation for MFE and partition function calculations.
file multibranch_loops.h
Energy evaluation of multibranch loops for MFE and partition function calculations.
Data Structures
struct vrna_mx_pf_aux_el_t
Auxiliary helper arrays for fast exterior loop computations. More...
struct vrna_mx_pf_aux_ml_t
Auxiliary helper arrays for fast exterior loop computations. More...
PRIVATE int E_Hairpin (int size, int type, int si1, int sj1, const char string, vrna_param_t P)
Compute the Energy of a hairpin-loop.
int vrna_eval_ext_hp_loop (vrna_fold_compound_t vc, int i, int j)
Evaluate free energy of an exterior hairpin loop.
int vrna_eval_hp_loop (vrna_fold_compound_t vc, int i, int j)
Evaluate free energy of a hairpin loop.
PRIVATE FLT_OR_DBL exp_E_Hairpin (int u, int type, short si1, short sj1, const char string, vrna_exp_-
param_t P)
Compute Boltzmann weight eG/kT of a hairpin loop.
int vrna_E_hp_loop (vrna_fold_compound_t vc, int i, int j)
Evaluate the free energy of a hairpin loop and consider hard constraints if they apply.
int vrna_E_ext_hp_loop (vrna_fold_compound_t vc, int i, int j)
Evaluate the free energy of an exterior hairpin loop and consider possible hard constraints.
FLT_OR_DBL vrna_exp_E_hp_loop (vrna_fold_compound_t vc, int i, int j)
High-Level function for hairpin loop energy evaluation (partition function variant)
Generated by Doxygen
86 Module Documentation
int vrna_BT_hp_loop (vrna_fold_compound_t vc, int i, int j, int en, vrna_bp_stack_t bp_stack, int stack-
_count)
Backtrack a hairpin loop closed by (i, j).
PRIVATE int E_IntLoop (int n1, int n2, int type, int type_2, int si1, int sj1, int sp1, int sq1, vrna_param_t P)
PRIVATE FLT_OR_DBL exp_E_IntLoop (int u1, int u2, int type, int type2, short si1, short sj1, short sp1, short
sq1, vrna_exp_param_t P)
int vrna_eval_int_loop (vrna_fold_compound_t vc, int i, int j, int k, int l)
int vrna_BT_stack (vrna_fold_compound_t vc, int i, int j, int en, vrna_bp_stack_t bp_stack, int stack-
_count)
Backtrack a stacked pair closed by (i, j).
int vrna_BT_int_loop (vrna_fold_compound_t vc, int i, int j, int en, vrna_bp_stack_t bp_stack, int
stack_count)
Backtrack an interior loop closed by (i, j).
See also
See also
15.2.3.1 PRIVATE int E_Hairpin ( int size, int type, int si1, int sj1, const char string, vrna_param_t P )
#include <ViennaRNA/hairpin_loops.h>
To evaluate the free energy of a hairpin-loop, several parameters have to be known. A general hairpin-loop has this
structure:
Generated by Doxygen
15.2 Process and evaluate individual loops 87
a3 a4
a2 a5
a1 a6
X - Y
| |
5 3
where X-Y marks the closing pair [e.g. a (G,C) pair]. The length of this loop is 6 as there are six unpaired
nucleotides (a1-a6) enclosed by (X,Y). The 5' mismatching nucleotide is a1 while the 3' mismatch is a6. The
nucleotide sequence of this loop is "a1.a2.a3.a4.a5.a6"
Note
The parameter sequence should contain the sequence of the loop in capital letters of the nucleic acid alphabet
if the loop size is below 7. This is useful for unusually stable tri-, tetra- and hexa-loops which are treated
differently (based on experimental data) if they are tabulated.
See also
scale_parameters()
vrna_param_t
Warning
Not (really) thread safe! A threadsafe implementation will replace this function in a future release!
Energy evaluation may change due to updates in global variable "tetra_loop"
Parameters
Returns
#include <ViennaRNA/hairpin_loops.h>
Note
Generated by Doxygen
88 Module Documentation
Parameters
Returns
SWIG Wrapper Notes This function is attached as method eval_hp_loop() to objects of type fold_compound
15.2.3.3 PRIVATE int E_IntLoop ( int n1, int n2, int type, int type_2, int si1, int sj1, int sp1, int sq1, vrna_param_t P )
#include <ViennaRNA/interior_loops.h>
This function computes the free energy G of an interior-loop with the following structure:
3 5
| |
U - V
a_n b_1
. .
. .
. .
a_1 b_m
X - Y
| |
5 3
This general structure depicts an interior-loop that is closed by the base pair (X,Y). The enclosed base pair is (V,U)
which leaves the unpaired bases a_1-a_n and b_1-b_n that constitute the loop. In this example, the length of the
interior-loop is (n + m) where n or m may be 0 resulting in a bulge-loop or base pair stack. The mismatching
nucleotides for the closing pair (X,Y) are:
5'-mismatch: a_1
3'-mismatch: b_m
and for the enclosed base pair (V,U):
5'-mismatch: b_1
3'-mismatch: a_n
Note
Base pairs are always denoted in 5'->3' direction. Thus the enclosed base pair must be 'turned arround' when
evaluating the free energy of the interior-loop
See also
scale_parameters()
vrna_param_t
Note
Generated by Doxygen
15.2 Process and evaluate individual loops 89
Parameters
Returns
15.2.3.4 PRIVATE FLT_OR_DBL exp_E_Hairpin ( int u, int type, short si1, short sj1, const char string,
vrna_exp_param_t P )
#include <ViennaRNA/hairpin_loops.h>
multiply by scale[u+2]
See also
get_scaled_pf_parameters()
vrna_exp_param_t
E_Hairpin()
Warning
Not (really) thread safe! A threadsafe implementation will replace this function in a future release!
Energy evaluation may change due to updates in global variable "tetra_loop"
Parameters
Generated by Doxygen
90 Module Documentation
Returns
#include <ViennaRNA/hairpin_loops.h>
Evaluate the free energy of a hairpin loop and consider hard constraints if they apply.
In case the base pair is not allowed due to a constraint conflict, this function returns INF.
Note
Parameters
Returns
#include <ViennaRNA/hairpin_loops.h>
Evaluate the free energy of an exterior hairpin loop and consider possible hard constraints.
Note
#include <ViennaRNA/hairpin_loops.h>
High-Level function for hairpin loop energy evaluation (partition function variant)
See also
Note
Generated by Doxygen
15.2 Process and evaluate individual loops 91
15.2.3.8 int vrna_BT_hp_loop ( vrna_fold_compound_t vc, int i, int j, int en, vrna_bp_stack_t bp_stack, int
stack_count )
#include <ViennaRNA/hairpin_loops.h>
Note
15.2.3.9 PRIVATE FLT_OR_DBL exp_E_IntLoop ( int u1, int u2, int type, int type2, short si1, short sj1, short sp1, short
sq1, vrna_exp_param_t P )
#include <ViennaRNA/interior_loops.h>
See also
get_scaled_pf_parameters()
vrna_exp_param_t
E_IntLoop()
Note
Parameters
Returns
Generated by Doxygen
92 Module Documentation
#include <ViennaRNA/interior_loops.h>
SWIG Wrapper Notes This function is attached as method eval_int_loop() to objects of type fold_compound
Generated by Doxygen
15.3 The RNA folding grammar 93
Fine-tuning of the
implemented models
Energy parameters
Modules
Files
file grammar.h
Implementations for the RNA folding grammar.
Generated by Doxygen
94 Module Documentation
This module is split into different aspects of how to modify and manipulate the underlying RNA folding grammar.
F F C F
= |
i j i i+1 j i k k+1 j
hairpin interior multi 1
C C M M
=
| |
i j i j i k l j i i+1 u u+1 j-1 j
M = M M
C C
| |
i 1 j i uu+1 j i uu+1 j i j-1 j
M 1
M
= C
i j i j i j-1 j
Generated by Doxygen
15.4 Fine-tuning of the implemented models 95
Functions and data structures to fine-tune the implemented secondary structure evaluation model.
Fine-tuning of the
The RNA folding grammar
implemented models
Files
file model.h
The model details data structure and its corresponding modifiers.
Generated by Doxygen
96 Module Documentation
Generated by Doxygen
15.4 Fine-tuning of the implemented models 97
Generated by Doxygen
98 Module Documentation
Generated by Doxygen
15.4 Fine-tuning of the implemented models 99
Set the default scaling factor used to avoid under-/overflows in partition function computation.
double vrna_md_defaults_sfact_get (void)
Get the default scaling factor used to avoid under-/overflows in partition function computation.
void set_model_details (vrna_md_t md)
Set default model details.
Functions and data structures to fine-tune the implemented secondary structure evaluation model.
#include <ViennaRNA/model.h>
See also
#include <ViennaRNA/model.h>
See also
#include <ViennaRNA/model.h>
See also
Generated by Doxygen
100 Module Documentation
#include <ViennaRNA/model.h>
See also
#include <ViennaRNA/model.h>
Default model behavior for lookup of special tri-, tetra-, and hexa-loops.
See also
#include <ViennaRNA/model.h>
See also
#include <ViennaRNA/model.h>
See also
#include <ViennaRNA/model.h>
See also
Generated by Doxygen
15.4 Fine-tuning of the implemented models 101
#include <ViennaRNA/model.h>
See also
#include <ViennaRNA/model.h>
See also
#include <ViennaRNA/model.h>
See also
#include <ViennaRNA/model.h>
See also
#include <ViennaRNA/model.h>
See also
Generated by Doxygen
102 Module Documentation
#include <ViennaRNA/model.h>
See also
#include <ViennaRNA/model.h>
See also
#include <ViennaRNA/model.h>
Default model behavior for the allowed maximum base pair span.
See also
#include <ViennaRNA/model.h>
See also
#include <ViennaRNA/model.h>
Default model behavior on how to evaluate the energy contribution of multi-branch loops.
See also
Generated by Doxygen
15.4 Fine-tuning of the implemented models 103
#include <ViennaRNA/model.h>
See also
#include <ViennaRNA/model.h>
See also
#include <ViennaRNA/model.h>
Default model behavior for weighting the co-variance score in consensus structure prediction.
See also
#include <ViennaRNA/model.h>
Default model behavior for weighting the nucleotide conservation? in consensus structure prediction.
See also
#include <ViennaRNA/model.h>
Use this function to initialize a vrna_md_t data structure with its default values
Generated by Doxygen
104 Module Documentation
Parameters
md A pointer to the data structure that is about to be initialized
#include <ViennaRNA/model.h>
This function should be called after changing the vrna_md_t.energy_set attribute since it re-initializes base pairing
related arrays within the vrna_md_t data structure. In particular, vrna_md_t.pair, vrna_md_t.alias, and vrna_md_-
t.rtype are set to the values that correspond to the specified vrna_md_t.energy_set option
See also
#include <ViennaRNA/model.h>
Use this function to clone a given model either inplace (target container md_to given) or create a copy by cloning
the source model and returning it (md_to == NULL).
Parameters
Returns
#include <ViennaRNA/model.h>
Note
Generated by Doxygen
15.4 Fine-tuning of the implemented models 105
#include <ViennaRNA/model.h>
Reset the global default model details to a specific set of parameters, or their initial values.
This function resets the global default model details to their initial values, i.e. as specified by the ViennaRNA
Package release, upon passing NULL as argument. Alternatively it resets them according to a set of provided
parameters.
Note
The global default parameters affect all function calls of RNAlib where model details are not explicitly provided.
Hence, any change of them is not considered threadsafe
Warning
This function first resets the global default settings to factory defaults, and only then applies user provided
settings (if any). User settings that do not meet specifications are skipped.
See also
vrna_md_set_default(), vrna_md_t
Parameters
md- A set of model details to use as global default (if NULL is passed, factory defaults are restored)
_p
#include <ViennaRNA/model.h>
See also
Parameters
T Temperature in centigrade
#include <ViennaRNA/model.h>
Get default temperature for energy evaluation of loops.
Generated by Doxygen
106 Module Documentation
See also
Returns
#include <ViennaRNA/model.h>
See also
Parameters
#include <ViennaRNA/model.h>
See also
Returns
#include <ViennaRNA/model.h>
See also
Generated by Doxygen
15.4 Fine-tuning of the implemented models 107
Parameters
d The dangle model
#include <ViennaRNA/model.h>
See also
Returns
#include <ViennaRNA/model.h>
Set default behavior for lookup of tabulated free energies for special hairpin loops, such as Tri-, Tetra-, or Hexa-loops.
See also
Parameters
#include <ViennaRNA/model.h>
Get default behavior for lookup of tabulated free energies for special hairpin loops, such as Tri-, Tetra-, or Hexa-
loops.
See also
Returns
The global default settings for the treatment of special hairpin loops
Generated by Doxygen
108 Module Documentation
#include <ViennaRNA/model.h>
See also
Parameters
#include <ViennaRNA/model.h>
See also
Returns
#include <ViennaRNA/model.h>
See also
Parameters
#include <ViennaRNA/model.h>
Generated by Doxygen
15.4 Fine-tuning of the implemented models 109
See also
Returns
#include <ViennaRNA/model.h>
Set default behavior for G-U pairs as closing pair for loops.
See also
Parameters
#include <ViennaRNA/model.h>
Get default behavior for G-U pairs as closing pair for loops.
See also
Returns
The global default settings for treatment of G-U pairs closing a loop
#include <ViennaRNA/model.h>
Set default behavior recomputing free energies of multi-branch loops using a logarithmic model.
See also
Generated by Doxygen
110 Module Documentation
Parameters
#include <ViennaRNA/model.h>
Get default behavior recomputing free energies of multi-branch loops using a logarithmic model.
See also
Returns
The global default settings for logarithmic model in multi-branch loop free energy evaluation
#include <ViennaRNA/model.h>
See also
Parameters
#include <ViennaRNA/model.h>
See also
Returns
Generated by Doxygen
15.4 Fine-tuning of the implemented models 111
#include <ViennaRNA/model.h>
See also
Parameters
#include <ViennaRNA/model.h>
See also
Returns
#include <ViennaRNA/model.h>
Set default behavior for creating additional matrix for unique multi-branch loop prediction.
Note
See also
Parameters
Generated by Doxygen
112 Module Documentation
#include <ViennaRNA/model.h>
Get default behavior for creating additional matrix for unique multi-branch loop prediction.
See also
Returns
The global default settings for creating additional matrices for unique multi-branch loop prediction
#include <ViennaRNA/model.h>
See also
Parameters
#include <ViennaRNA/model.h>
See also
Returns
Generated by Doxygen
15.4 Fine-tuning of the implemented models 113
#include <ViennaRNA/model.h>
See also
Generated by Doxygen
114 Module Documentation
Parameters
#include <ViennaRNA/model.h>
See also
Returns
#include <ViennaRNA/model.h>
See also
Parameters
#include <ViennaRNA/model.h>
Get default backtrack type, i.e. which DP matrix is used.
See also
Returns
The global default settings that specify which DP matrix is used for backtracking
Generated by Doxygen
15.4 Fine-tuning of the implemented models 115
#include <ViennaRNA/model.h>
Set the default behavior for whether to compute base pair probabilities after partition function computation.
See also
Parameters
#include <ViennaRNA/model.h>
Get the default behavior for whether to compute base pair probabilities after partition function computation.
See also
Returns
The global default settings that specify whether base pair probabilities are computed together with partition
function
#include <ViennaRNA/model.h>
See also
Parameters
span Maximal base pair span
Generated by Doxygen
116 Module Documentation
#include <ViennaRNA/model.h>
See also
Returns
#include <ViennaRNA/model.h>
See also
Parameters
size Minimal size, i.e. number of unpaired nucleotides for a hairpin loop
#include <ViennaRNA/model.h>
Get default minimal loop size.
See also
Returns
#include <ViennaRNA/model.h>
Set default window size for sliding window structure prediction approaches.
See also
Generated by Doxygen
15.4 Fine-tuning of the implemented models 117
Parameters
#include <ViennaRNA/model.h>
Get default window size for sliding window structure prediction approaches.
See also
Returns
The global default settings for the size of the sliding window
#include <ViennaRNA/model.h>
Set default behavior for whether to use old energy model for comparative structure prediction.
Note
This option is outdated. Activating the old energy model usually results in worse consensus structure predic-
tions.
See also
Parameters
#include <ViennaRNA/model.h>
Get default behavior for whether to use old energy model for comparative structure prediction.
Generated by Doxygen
118 Module Documentation
See also
Returns
The global default settings for using old energy model for comparative structure prediction
#include <ViennaRNA/model.h>
Set default behavior for whether to use Ribosum Scoring in comparative structure prediction.
See also
Parameters
#include <ViennaRNA/model.h>
Get default behavior for whether to use Ribosum Scoring in comparative structure prediction.
See also
Returns
The global default settings for using Ribosum scoring in comparative structure prediction
#include <ViennaRNA/model.h>
Set the default co-variance scaling factor used in comparative structure prediction.
See also
Generated by Doxygen
15.4 Fine-tuning of the implemented models 119
Parameters
#include <ViennaRNA/model.h>
Get the default co-variance scaling factor used in comparative structure prediction.
See also
Returns
#include <ViennaRNA/model.h>
See also
Parameters
factor
#include <ViennaRNA/model.h>
See also
Returns
Generated by Doxygen
120 Module Documentation
#include <ViennaRNA/model.h>
Set the default scaling factor used to avoid under-/overflows in partition function computation.
See also
Parameters
#include <ViennaRNA/model.h>
Get the default scaling factor used to avoid under-/overflows in partition function computation.
See also
Returns
#include <ViennaRNA/model.h>
Use this function if you wish to initialize a vrna_md_t data structure with its default values, i.e. the global model
settings as provided by the deprecated global variables.
Deprecated This function will vanish as soon as backward compatibility of RNAlib is dropped (expected in version
3). Use vrna_md_set_default() instead!
Parameters
md A pointer to the data structure that is about to be initialized
Generated by Doxygen
15.4 Fine-tuning of the implemented models 121
#include <ViennaRNA/model.h>
Default is 37C. You have to call the update_..._params() functions after changing this parameter.
See also
#include <ViennaRNA/model.h>
Should be set to approximately exp((F/kT )/length), where F is an estimate for the ensemble free energy, for
example the minimum free energy. You must call update_pf_params() after changing this parameter.
If pf_scale is -1 (the default) , an estimate will be provided automatically when computing partition functions, e.g.
pf_fold() The automatic estimate is usually insufficient for sequences more than a few hundred bases long.
#include <ViennaRNA/model.h>
If set to 0 no stabilizing energies are assigned to bases adjacent to helices in free ends and multiloops (so called
dangling ends). Normally (dangles = 1) dangling end energies are assigned only to unpaired bases and a base
cannot participate simultaneously in two dangling ends. In the partition function algorithm pf_fold() these checks
are neglected. If dangles is set to 2, all folding routines will follow this convention. This treatment of dangling ends
gives more favorable energies to helices directly adjacent to one another, which can be beneficial since such helices
often do engage in stabilizing interactions through co-axial stacking.
If dangles = 3 co-axial stacking is explicitly included for adjacent helices in multiloops. The option affects only
mfe folding and energy evaluation (fold() and energy_of_structure()), as well as suboptimal folding (subopt()) via
re-evaluation of energies. Co-axial stacking with one intervening mismatch is not considered so far.
Default is 2 in most algorithms, partition function algorithms can only handle 0 and 2
#include <ViennaRNA/model.h>
Include special stabilizing energies for some tri-, tetra- and hexa-loops;.
default is 1.
Generated by Doxygen
122 Module Documentation
#include <ViennaRNA/model.h>
Global switch to avoid/allow helices of length 1.
Disallow all pairs which can only occur as lonely pairs (i.e. as helix of length 1). This avoids lonely base pairs in the
predicted structures in most cases.
#include <ViennaRNA/model.h>
Do not use this variable, it will eventually be removed in one of the next versions
#include <ViennaRNA/model.h>
0 = BP; 1=any with GC; 2=any with AU-parameter
If set to 1 or 2: fold sequences from an artificial alphabet ABCD..., where A pairs B, C pairs D, etc. using either GC
(1) or AU parameters (2); default is 0, you probably don't want to change it.
#include <ViennaRNA/model.h>
do backtracking, i.e. compute secondary structures or base pair probabilities
If 0, do not calculate pair probabilities in pf_fold(); this is about twice as fast. Default is 1.
#include <ViennaRNA/model.h>
A backtrack array marker for inverse_fold()
If set to 'C': force (1,N) to be paired, 'M' fold as if the sequence were inside a multiloop. Otherwise ('F') the usual
mfe structure is computed.
#include <ViennaRNA/model.h>
contains allowed non standard base pairs
Lists additional base pairs that will be allowed to form in addition to GC, CG, AU, UA, GU and UG. Nonstandard
base pairs are given a stacking energy of 0.
#include <ViennaRNA/model.h>
Maximum allowed base pair span.
Generated by Doxygen
15.5 Energy parameters 123
All relevant functions to retrieve and copy pre-calculated energy parameter sets as well as reading/writing the energy
parameter set from/to file(s).
Reading/Writing Energy
The RNA folding grammar Energy parameters
Parameter Sets from/to File
Modules
Files
file convert_epars.h
Functions and definitions for energy parameter file format conversion.
file energy_const.h
Energy parameter constants.
file params.h
Functions to deal with sets of energy parameters.
file read_epars.h
Read and write energy parameter files.
Data Structures
struct vrna_param_s
The datastructure that contains temperature scaled energy parameters. More...
struct vrna_exp_param_s
The data structure that contains temperature scaled Boltzmann weights of the energy parameters. More...
Typedefs
Generated by Doxygen
124 Module Documentation
Functions
All relevant functions to retrieve and copy pre-calculated energy parameter sets as well as reading/writing the energy
parameter set from/to file(s).
This module covers all relevant functions for pre-calculation of the energy parameters necessary for the folding
routines provided by RNAlib. Furthermore, the energy parameter set in the RNAlib can be easily exchanged by a
user-defined one. It is also possible to write the current energy parameter set into a text file.
Generated by Doxygen
15.5 Energy parameters 125
vrna_md_s
model_details
vrna_param_s
Data Fields
double temperature
Temperature used for loop contribution scaling.
vrna_md_t model_details
Model details to be used in the recursions.
The data structure that contains temperature scaled Boltzmann weights of the energy parameters.
vrna_md_s
model_details
vrna_exp_param_s
Generated by Doxygen
126 Module Documentation
Data Fields
int id
An identifier for the data structure.
double pf_scale
Scaling factor to avoid over-/underflows.
double temperature
Temperature used for loop contribution scaling.
double alpha
Scaling factor for the thermodynamic temperature.
vrna_md_t model_details
Model details to be used in the recursions.
#include <ViennaRNA/params.h>
Old typename of vrna_param_s.
#include <ViennaRNA/params.h>
Old typename of vrna_exp_param_s.
#include <ViennaRNA/params.h>
Get a data structure containing prescaled free energy parameters.
If a NULL pointer is passed for the model details parameter, the default model parameters are stored within the
requested vrna_param_t structure.
See also
Generated by Doxygen
15.5 Energy parameters 127
Parameters
md A pointer to the model details to store inside the structure (Maybe NULL)
Returns
A pointer to the memory location where the requested parameters are stored
#include <ViennaRNA/params.h>
If NULL is passed as parameter, a default set of energy parameters is created and returned.
See also
vrna_params(), vrna_param_t
Parameters
par The free energy parameters that are to be copied (Maybe NULL)
Returns
#include <ViennaRNA/params.h>
Get a data structure containing prescaled free energy parameters already transformed to Boltzmann factors.
This function returns a data structure that contains all necessary precomputed energy contributions for each type
of loop.
In contrast to vrna_params(), the free energies within this data structure are stored as their Boltzmann factors, i.e.
exp(E/kT )
If a NULL pointer is passed for the model details parameter, the default model parameters are stored within the
requested vrna_exp_param_t structure.
See also
Generated by Doxygen
128 Module Documentation
Parameters
md A pointer to the model details to store inside the structure (Maybe NULL)
Returns
A pointer to the memory location where the requested parameters are stored
#include <ViennaRNA/params.h>
Get a data structure containing prescaled free energy parameters already transformed to Boltzmann factors (alifold
version)
If a NULL pointer is passed for the model details parameter, the default model parameters are stored within the
requested vrna_exp_param_t structure.
See also
Parameters
Returns
A pointer to the memory location where the requested parameters are stored
#include <ViennaRNA/params.h>
Get a copy of the provided free energy parameters (provided as Boltzmann factors)
If NULL is passed as parameter, a default set of energy parameters is created and returned.
See also
vrna_exp_params(), vrna_exp_param_t
Parameters
par The free energy parameters that are to be copied (Maybe NULL)
Generated by Doxygen
15.5 Energy parameters 129
Returns
#include <ViennaRNA/params.h>
Passing NULL as second argument leads to a reset of the energy parameters within vc to their default values.
Otherwise, the energy parameters provided will be copied over into vc.
See also
Parameters
SWIG Wrapper Notes This function is attached to vrna_fc_s objects as params_subst() method.
#include <ViennaRNA/params.h>
This function can be used to properly assign new energy parameters for partition function computations to a vrna-
_fold_compound_t. For this purpose, the data of the provided pointer params will be copied into vc and a re-
computation of the partition function scaling factor is issued, if the pf_scale attribute of params is less than
1.0.
Passing NULL as second argument leads to a reset of the energy parameters within vc to their default values
See also
Parameters
Generated by Doxygen
130 Module Documentation
#include <ViennaRNA/params.h>
This function may be used to (automatically) rescale the Boltzmann factors used in partition function computations.
Since partition functions over subsequences can easily become extremely large, the RNAlib internally rescales
them to avoid numerical over- and/or underflow. Therefore, a proper scaling factor s needs to be chosen that in turn
is then used to normalize the corresponding partition functions q[i, j] = q[i, j]/s(ji+1) .
This function provides two ways to automatically adjust the scaling factor.
1. Automatic guess
Passing NULL as second parameter activates the automatic guess mode. Here, the scaling factor is recomputed
according to a mean free energy of 184.3length cal for random sequences.
Note
This recomputation only takes place if the pf_scale attribute of the exp_params data structure contained
in vc has a value below 1.0.
On the other hand, if the MFE for a sequence is known, it can be used to recompute a more robust scaling factor,
since it represents the lowest free energy of the entire ensemble of structures, i.e. the highest Boltzmann factor.
To activate this second mode of automatic adjustment according to MFE, a pointer to the MFE value needs to
be passed as second argument. This value is then taken to compute the scaling factor as s = exp((sf act
M F E)/kT /length), where sfact is an additional scaling weight located in the vrna_md_t data structure of exp-
_params in vc.
The computed scaling factor s will be stored as pf_scale attribute of the exp_params data structure in vc.
See also
Parameters
SWIG Wrapper Notes This function is attached to vrna_fc_s objects as overloaded exp_params_rescale()
method.
When no parameter is passed to this method, the resulting action is the same as passing
NULL as second parameter to vrna_exp_params_rescale(), i.e. default scaling of the parti-
tion function. Passing an energy in kcal/mol, e.g. as retrieved by a previous call to the mfe()
method, instructs all subsequent calls to scale the partition function accordingly.
Generated by Doxygen
15.5 Energy parameters 131
#include <ViennaRNA/params.h>
Reset free energy parameters within a vrna_fold_compound_t according to provided, or default model details.
This function allows one to rescale free energy parameters for subsequent structure prediction or evaluation ac-
cording to a set of model details, e.g. temperature values. To do so, the caller provides either a pointer to a set of
model details to be used for rescaling, or NULL if global default setting should be used.
See also
vrna_exp_params_reset(), vrna_params_subs()
Parameters
SWIG Wrapper Notes This function is attached to vrna_fc_s objects as overloaded params_reset() method.
When no parameter is passed to this method, the resulting action is the same as passing
NULL as second parameter to vrna_params_reset(), i.e. global default model settings are
used. Passing an object of type vrna_md_s resets the fold compound according to the
specifications stored within the vrna_md_s object.
#include <ViennaRNA/params.h>
Reset Boltzmann factors for partition function computations within a vrna_fold_compound_t according to provided,
or default model details.
This function allows one to rescale Boltzmann factors for subsequent partition function computations according to a
set of model details, e.g. temperature values. To do so, the caller provides either a pointer to a set of model details
to be used for rescaling, or NULL if global default setting should be used.
See also
Parameters
SWIG Wrapper Notes This function is attached to vrna_fc_s objects as overloaded exp_params_reset() method.
Generated by Doxygen
132 Module Documentation
When no parameter is passed to this method, the resulting action is the same as passing
NULL as second parameter to vrna_exp_params_reset(), i.e. global default model settings
are used. Passing an object of type vrna_md_s resets the fold compound according to the
specifications stored within the vrna_md_s object.
#include <ViennaRNA/params.h>
get a data structure of type vrna_exp_param_t which contains the Boltzmann weights of several energy parameters
scaled according to the current temperature
Returns
The data structure containing Boltzmann weights for use in partition function calculations
15.5.4.12 vrna_exp_param_t get_boltzmann_factors ( double temperature, double betaScale, vrna_md_t md, double
pf_scale )
#include <ViennaRNA/params.h>
Get precomputed Boltzmann factors of the loop type dependent energy contributions with independent thermody-
namic temperature.
This function returns a data structure that contains all necessary precalculated Boltzmann factors for each loop type
contribution.
In contrast to get_scaled_pf_parameters(), this function enables setting of independent temperatures for both, the
individual energy contributions as well as the thermodynamic temperature used in exp(G/kT )
See also
get_scaled_pf_parameters(), get_boltzmann_factor_copy()
Parameters
temperature The temperature in degrees Celcius used for (re-)scaling the energy contributions
betaScale A scaling value that is used as a multiplication factor for the absolute temperature of the system
md The model details to be used
pf_scale The scaling factor for the Boltzmann factors
Generated by Doxygen
15.5 Energy parameters 133
Returns
#include <ViennaRNA/params.h>
See also
get_boltzmann_factors(), get_scaled_pf_parameters()
Parameters
parameters The input data structure that shall be copied
Returns
#include <ViennaRNA/params.h>
Get precomputed Boltzmann factors of the loop type dependent energy contributions (alifold variant)
15.5.4.15 vrna_exp_param_t get_boltzmann_factors_ali ( unsigned int n_seq, double temperature, double betaScale,
vrna_md_t md, double pf_scale )
#include <ViennaRNA/params.h>
Get precomputed Boltzmann factors of the loop type dependent energy contributions (alifold variant) with indepen-
dent thermodynamic temperature.
Generated by Doxygen
134 Module Documentation
#include <ViennaRNA/params.h>
Get precomputed energy contributions for all the known loop types.
Note
OpenMP: This function relies on several global model settings variables and thus is not to be considered
threadsafe. See get_scaled_parameters() for a completely threadsafe implementation.
Returns
#include <ViennaRNA/params.h>
Get precomputed energy contributions for all the known loop types.
Call this function to retrieve precomputed energy contributions, i.e. scaled according to the temperature passed.
Furthermore, this function assumes a data structure that contains the model details as well, such that subsequent
folding recursions are able to retrieve the correct model settings
See also
vrna_md_t, set_model_details()
Parameters
Returns
Generated by Doxygen
15.6 Extending the folding grammar with additional domains 135
This module covers simple and straight-forward extensions to the RNA folding grammar.
Collaboration diagram for Extending the folding grammar with additional domains:
Structured domains
Extending the folding
The RNA folding grammar grammar with additional
domains
Unstructured domains
Modules
Unstructured domains
Add and modify unstructured domains to the RNA folding grammar.
Structured domains
Add and modify structured domains to the RNA folding grammar.
This module covers simple and straight-forward extensions to the RNA folding grammar.
Some applications of RNA secondary structure prediction require an extension of the regular RNA folding grammar.
For instance one would like to include proteins and other ligands binding to unpaired loop regions while competing
with conventional base pairing. Another application could be that one may want to include the formation of self-
emclosed structural modules, such as G-quadruplexes. For such applications, we provide a pair of additional
domains that extend the regular RNA folding grammar, Structured domains and Unstructured domains.
F F C F F F
= | | motif | structure
i j i i+1 j i k k+1 j i k k+1 j i k k+1 j
hairpin interior multi interior multi
1
C U U C U M M U S M S
=
| | | |
i j i j i k l j i i+1 u u+1 j-1 j i u u+1 j-1 j i i+1 u u+1 j-1 j
M = U M M M U M
C C
| | | motif | structure | structure
i j i j i j-1 j i u u+1 j
U U U
= | motif
i j i j-1 j i u u+1 j
Generated by Doxygen
136 Module Documentation
While unstructured domains are usually determined by a more or less precise sequence motif, e.g. the binding site
for a protein, structured domains are considered self-enclosed modules with a more or less complex pairing pattern.
Our extension with these two domains introduces two production rules to fill additional dynamic processing matrices
S and U where we store the pre-computed constributions of structured domains (S), and unstructured domains (U).
For the sake of flexibility, each of the domains is associated with a specific data structure serving as an abstract
interface to the extension. The interface uses callback functions to (i) pre-compute arbitrary data, e.g. filling up
additional dynamic programming matrices, and (ii) evaluate the contribution of a paired or unpaired structural feature
of the RNA. Implementations of these callbacks are separate for regular free energy evaluation, e.g. MFE prediction,
and partition function applications. A data structure holding arbitrary data required for the callback functions can be
associated to the domain as well. While RNAlib comes with a default implementation for structured and unstructured
domains, the system is entirely user-costomizable.
Generated by Doxygen
15.7 Unstructured domains 137
Files
file unstructured_domains.h
Functions to modify unstructured domains, e.g. to incorporate ligands binding to unpaired stretches.
Data Structures
struct vrna_unstructured_domain_s
Data structure to store all functionality for ligand binding. More...
Macros
#define VRNA_UNSTRUCTURED_DOMAIN_EXT_LOOP 1U
Flag to indicate ligand bound to unpiared stretch in the exterior loop.
#define VRNA_UNSTRUCTURED_DOMAIN_HP_LOOP 2U
Flag to indicate ligand bound to unpaired stretch in a hairpin loop.
#define VRNA_UNSTRUCTURED_DOMAIN_INT_LOOP 4U
Flag to indicate ligand bound to unpiared stretch in an interior loop.
#define VRNA_UNSTRUCTURED_DOMAIN_MB_LOOP 8U
Flag to indicate ligand bound to unpiared stretch in a multibranch loop.
#define VRNA_UNSTRUCTURED_DOMAIN_MOTIF 16U
Flag to indicate ligand binding without additional unbound nucleotides (motif-only)
#define VRNA_UNSTRUCTURED_DOMAIN_ALL_LOOPS (VRNA_UNSTRUCTURED_DOMAIN_EXT_L-
OOP | VRNA_UNSTRUCTURED_DOMAIN_HP_LOOP | VRNA_UNSTRUCTURED_DOMAIN_INT_LOOP |
VRNA_UNSTRUCTURED_DOMAIN_MB_LOOP)
Flag to indicate ligand bound to unpiared stretch in any loop (convenience macro)
Generated by Doxygen
138 Module Documentation
Typedefs
Functions
void vrna_ud_add_motif (vrna_fold_compound_t vc, const char motif, double motif_en, unsigned int loop-
_type)
Add an unstructured domain motif, e.g. for ligand binding.
void vrna_ud_remove (vrna_fold_compound_t vc)
Remove ligand binding to unpaired stretches.
void vrna_ud_set_data (vrna_fold_compound_t vc, void data, vrna_callback_free_auxdata free_cb)
Attach an auxiliary data structure.
void vrna_ud_set_prod_rule_cb (vrna_fold_compound_t vc, vrna_callback_ud_production pre_cb, vrna-
_callback_ud_energy e_cb)
Attach production rule callbacks for free energies computations.
void vrna_ud_set_exp_prod_rule_cb (vrna_fold_compound_t vc, vrna_callback_ud_exp_production pre-
_cb, vrna_callback_ud_exp_energy exp_e_cb)
Attach production rule for partition function.
This module provides the tools to add and modify unstructured domains to the production rules of the RNA folding
grammar. Usually this functionality is utilized for incorporating ligand binding to unpaired stretches of an RNA.
Unstructured domains appear in the production rules of the RNA folding grammar whereever new unpaired nu-
cleotides are attached to a growing substructure (see also [12]):
Generated by Doxygen
15.7 Unstructured domains 139
F F C F F
= | | motif
i j i i+1 j i k k+1 j i k k+1 j
hairpin interior multi 1
C
=
U U C U M M
| |
i j i j i k l j i i+1 u u+1 j-1 j
M = U M M M
C C
| | | motif
i j i j-1 j i u u+1 j
The white boxes represent the stretch of RNA bound to the ligand and represented by a more or less specific
sequence motif. The motif itself is considered unable to form basepairs. The additional production rule U is used
to precompute the contribution of unpaired stretches possibly bound by one or more ligands. The auxiliary DP
matrix for this production rule is filled right before processing the other (regular) production rules of the RNA folding
grammar.
F F C F F F
= | | motif | structure
i j i i+1 j i k k+1 j i k k+1 j i k k+1 j
hairpin interior multi interior multi
1
C U U C U M M U S M S
=
| | | |
i j i j i k l j i i+1 u u+1 j-1 j i u u+1 j-1 j i i+1 u u+1 j-1 j
M = U M M M U M
C C
| | | motif | structure | structure
i j i j i j-1 j i u u+1 j
U U U
= | motif
i j i j-1 j i u u+1 j
Bug Although the additional production rule(s) for unstructured domains in the descriptions of this feature are
always treated as 'segments possibly bound to one or more ligands', the current implementation requires that
at least one ligand is bound. The default implementation already takes care of the required changes, however,
upon using callback functions other than the default ones, one has to take care of this fact. Please also note,
that this behavior might change in one of the next releases, such that the decomposition schemes as shown
above comply with the actual implementation.
A default implementation allows one to readily use this feature by simply adding sequence motifs and corresponding
binding free energies with the function vrna_ud_add_motif() (see also Ligands binding to unstructured domains).
Generated by Doxygen
140 Module Documentation
evaluates the binding free energy of a ligand to its target sequence segment (white boxes in the figures
above), or
returns the free energy of an unpaired stretch possibly bound by a ligand, stored in the additional U DP matrix.
The callback is passed the segment positions, the loop context, and which of the two above mentioned evaluations
are required. A second callback implements the pre-processing step that prepares the U DP matrix by evaluating all
possible cases of the additional production rule. Both callbacks have a default implementation in RNAlib, but may
be over-written by a user-implementation, making it fully user-customizable.
For equilibrium probability computations, two additional callbacks exist. One to store/add and one to retrieve the
probability of unstructured domains at particular positions. Our implementation already takes care of computing
the probabilities, but users of the unstructured domain feature are required to provide a mechanism to efficiently
store/add the corresponding values into some external data structure.
Data Fields
int uniq_motif_count
The unique number of motifs of different lengths.
unsigned int uniq_motif_size
An array storing a unique list of motif lengths.
int motif_count
Total number of distinguished motifs.
char motif
Motif sequences.
unsigned int motif_size
Motif lengths.
double motif_en
Ligand binding free energy contribution.
unsigned int motif_type
Type of motif, i.e. loop type the ligand binds to.
vrna_callback_ud_production prod_cb
Callback to ligand binding production rule, i.e. create/fill DP free energy matrices.
vrna_callback_ud_exp_production exp_prod_cb
Callback to ligand binding production rule, i.e. create/fill DP partition function matrices.
vrna_callback_ud_energy energy_cb
Callback to evaluate free energy of ligand binding to a particular unpaired stretch.
vrna_callback_ud_exp_energy exp_energy_cb
Callback to evaluate Boltzmann factor of ligand binding to a particular unpaired stretch.
void data
Auxiliary data structure passed to energy evaluation callbacks.
vrna_callback_free_auxdata free_data
Callback to free auxiliary data structure.
vrna_callback_ud_probs_add probs_add
Callback to store/add outside partition function.
vrna_callback_ud_probs_get probs_get
Callback to retrieve outside partition function.
Generated by Doxygen
15.7 Unstructured domains 141
Callback to ligand binding production rule, i.e. create/fill DP free energy matrices.
This callback will be executed right before the actual secondary structure decompositions, and, therefore, any
implementation must not interleave with the regular DP matrices.
15.7.3.1 void vrna_ud_add_motif ( vrna_fold_compound_t vc, const char motif, double motif_en, unsigned int
loop_type )
#include <ViennaRNA/unstructured_domains.h>
This function adds a ligand binding motif and the associated binding free energy to the vrna_ud_t attribute of a
vrna_fold_compound_t. The motif data will then be used in subsequent secondary structure predictions. Multiple
calls to this function with different motifs append all additional data to a list of ligands, which all will be evaluated.
Ligand motif data can be removed from the vrna_fold_compound_t again using the vrna_ud_remove() function. The
loop type parameter allows one to limit the ligand binding to particular loop type, such as the exterior loop, hairpin
loops, interior loops, or multibranch loops.
See also
Parameters
SWIG Wrapper Notes This function is attached as method ud_add_motif() to objects of type fold_compound
#include <ViennaRNA/unstructured_domains.h>
This function removes all ligand motifs that were bound to a vrna_fold_compound_t using the vrna_ud_add_motif()
function.
Generated by Doxygen
142 Module Documentation
Parameters
vc The vrna_fold_compound_t data structure the ligand motif data should be removed from
SWIG Wrapper Notes This function is attached as method ud_remove() to objects of type fold_compound
#include <ViennaRNA/unstructured_domains.h>
This function binds an arbitrary, auxiliary data structure for user-implemented ligand binding. The optional callback
free will be passed the bound data structure whenever the vrna_fold_compound_t is removed from memory to
avoid memory leaks.
See also
Parameters
vc The vrna_fold_compound_t data structure the auxiliary data structure should be bound to
data A pointer to the auxiliary data structure
free_cb A pointer to a callback function that free's memory occupied by data
SWIG Wrapper Notes This function is attached as method ud_set_data() to objects of type fold_compound
#include <ViennaRNA/unstructured_domains.h>
Use this function to bind a user-implemented grammar extension for unstructured domains.
The callback e_cb needs to evaluate the free energy contribution f (i, j) of the unpaired segment [i, j]. It will be
executed in each of the regular secondary structure production rules. Whenever the callback is passed the V-
RNA_UNSTRUCTURED_DOMAIN_MOTIF flag via its loop_type parameter the contribution of any ligand that
consecutively binds from position i to j (the white box) is requested. Otherwise, the callback usually performs a
lookup in the precomputed B matrices. Which B matrix is addressed will be indicated by the flags VRNA_UNST-
RUCTURED_DOMAIN_EXT_LOOP, VRNA_UNSTRUCTURED_DOMAIN_HP_LOOP VRNA_UNSTRUCTURE-
D_DOMAIN_INT_LOOP, and VRNA_UNSTRUCTURED_DOMAIN_MB_LOOP. As their names already imply, they
specify exterior loops (F production rule), hairpin loops and interior loops (C production rule), and multibranch loops
(M and M1 production rule).
Generated by Doxygen
15.7 Unstructured domains 143
B
f(i,j) = |
i j i j
The pre_cb callback will be executed as a pre-processing step right before the regular secondary structure rules.
Usually one would use this callback to fill the dynamic programming matrices U and preparations of the auxiliary
data structure vrna_unstructured_domain_s.data
B B B
= |
i j i j-1 j i u u+1 j
Parameters
SWIG Wrapper Notes This function is attached as method ud_set_prod_rule_cb() to objects of type fold_-
compound
#include <ViennaRNA/unstructured_domains.h>
Use it to bind callbacks to (i) fill the U production rule dynamic programming matrices and/or prepare the vrna_-
unstructured_domain_s.data, and (ii) provide a callback to retrieve partition functions for subsegments [i, j].
B B B
= |
i j i j-1 j i u u+1 j
Generated by Doxygen
144 Module Documentation
B
f(i,j) = |
i j i j
See also
vrna_ud_set_prod_rule_cb()
Parameters
SWIG Wrapper Notes This function is attached as method ud_set_exp_prod_rule_cb() to objects of type fold-
_compound
Generated by Doxygen
15.8 Structured domains 145
Files
file structured_domains.h
This module provides interfaces that deal with additional structured domains in the folding grammar.
This module provides the tools to add and modify structured domains to the production rules of the RNA folding
grammar. Usually this functionality is utilized for incorporating self-enclosed structural modules that exhibit a more
or less complex base pairing pattern.
Generated by Doxygen
146 Module Documentation
This module provides general functions that allow for an easy control of constrained secondary structure prediction
and evaluation.
Soft constraints
Constraining the RNA
The RNA folding grammar
folding grammar
Hard constraints
Modules
Hard constraints
This module covers all functionality for hard constraints in secondary structure prediction.
Soft constraints
Functions and data structures for secondary structure soft constraints.
Files
file constraints.h
Functions and data structures for constraining secondary structure predictions and evaluation.
Macros
#define VRNA_CONSTRAINT_FILE 0
Flag for vrna_constraints_add() to indicate that constraints are present in a text file.
#define VRNA_CONSTRAINT_SOFT_MFE 0
Indicate generation of constraints for MFE folding.
#define VRNA_CONSTRAINT_SOFT_PF VRNA_OPTION_PF
Indicate generation of constraints for partition function computation.
#define VRNA_DECOMP_PAIR_HP 1
Flag passed to generic softt constraints callback to indicate hairpin loop decomposition step.
#define VRNA_DECOMP_PAIR_IL 2
Indicator for interior loop decomposition step.
#define VRNA_DECOMP_PAIR_ML 3
Indicator for multibranch loop decomposition step.
#define VRNA_DECOMP_ML_ML_ML 5
Indicator for decomposition of multibranch loop part.
#define VRNA_DECOMP_ML_STEM 4
Indicator for decomposition of multibranch loop part.
#define VRNA_DECOMP_ML_ML 6
Indicator for decomposition of multibranch loop part.
#define VRNA_DECOMP_ML_UP 11
Generated by Doxygen
15.9 Constraining the RNA folding grammar 147
Functions
void vrna_constraints_add (vrna_fold_compound_t vc, const char constraint, unsigned int options)
Add constraints to a vrna_fold_compound_t data structure.
void vrna_message_constraint_options (unsigned int option)
Print a help message for pseudo dot-bracket structure constraint characters to stdout. (constraint support is specified
by option parameter)
void vrna_message_constraint_options_all (void)
Print structure constraint characters to stdout (full constraint support)
This module provides general functions that allow for an easy control of constrained secondary structure prediction
and evaluation.
Soft constraints.
While Hard-Constraints directly influence the production rules used in the folding recursions by allowing, disal-
lowing, or enforcing certain decomposition steps, Soft-constraints on the other hand are used to change position
specific contributions in the recursions by adding bonuses/penalties in form of pseudo free energies to certain loop
configurations.
Secondary structure constraints are always applied at decomposition level, i.e. in each step of the recursive struc-
ture decomposition, for instance during MFE prediction. Below is a visualization of the decomposition scheme
Generated by Doxygen
148 Module Documentation
F F C F
= |
i j i i+1 j i k k+1 j
hairpin interior multi 1
C C M M
=
| |
i j i j i k l j i i+1 u u+1 j-1 j
M = M M
C C
| |
i 1 j i uu+1 j i uu+1 j i j-1 j
M 1
M
= C
i j i j i j-1 j
For Hard constraints the following option flags may be used to constrain the pairing behavior of single, or pairs of
nucleotides:
However, for Soft constraints we do not allow for simple loop type dependent constraining. But soft constraints
are equipped with generic constraint support. This enables the user to pass arbitrary callback functions that return
auxiliary energy contributions for evaluation the avaluation of any decomposition.
The callback will then always be notified about the type of decomposition that is happening, and the corresponding
delimiting sequence positions. The following decomposition steps are distinguished, and should be captured by the
user's implementation of the callback:
VRNA_DECOMP_PAIR_HP - Flag passed to generic softt constraints callback to indicate hairpin loop de-
composition step.
Generated by Doxygen
15.9 Constraining the RNA folding grammar 149
Simplified interfaces to the soft constraints framework can be obtained by the implementations in the submodules
ligands.
An implementation that generates soft constraints for unpaired nucleotides by minimizing the discrepancy between
their predicted and expected pairing probability is available in submodule Generate soft constraints from data.
#include <ViennaRNA/constraints.h>
Flag for vrna_constraints_add() to indicate that constraints are present in a text file.
See also
vrna_constraints_add()
#include <ViennaRNA/constraints.h>
Deprecated This flag has no meaning anymore, since constraints are now always stored!
Generated by Doxygen
150 Module Documentation
#include <ViennaRNA/constraints.h>
#include <ViennaRNA/constraints.h>
Flag passed to generic softt constraints callback to indicate hairpin loop decomposition step.
This flag notifies the soft or hard constraint callback function that the current decomposition step evaluates a hairpin
loop enclosed by the base pair (i, j).
#include <ViennaRNA/constraints.h>
This flag notifies the soft or hard constraint callback function that the current decomposition step evaluates an
interior loop enclosed by the base pair (i, j), and enclosing the base pair (k, l).
Generated by Doxygen
15.9 Constraining the RNA folding grammar 151
#include <ViennaRNA/constraints.h>
This flag notifies the soft or hard constraint callback function that the current decomposition step evaluates a multi-
branch loop enclosed by the base pair (i, j), and consisting of some enclosed multi loop content from k to l.
Generated by Doxygen
152 Module Documentation
#include <ViennaRNA/constraints.h>
This flag notifies the soft or hard constraint callback function that the current decomposition step evaluates a multi-
branch loop part in the interval [i : j], which will be decomposed into two multibranch loop parts [i : k], and
[l : j].
#include <ViennaRNA/constraints.h>
This flag notifies the soft or hard constraint callback function that the current decomposition step evaluates a multi-
branch loop part in the interval [i : j], which will be considered a single stem branching off with base pair (k, l).
Generated by Doxygen
15.9 Constraining the RNA folding grammar 153
#include <ViennaRNA/constraints.h>
This flag notifies the soft or hard constraint callback function that the current decomposition step evaluates a multi-
branch loop part in the interval [i : j], which will be decomposed into a (usually) smaller multibranch loop part
[k : l].
#include <ViennaRNA/constraints.h>
This flag notifies the soft or hard constraint callback function that the current decomposition step evaluates a multi-
branch loop part in the interval [i : j], which will be considered a multibranch loop part that only consists of unpaired
nucleotides.
Generated by Doxygen
154 Module Documentation
#include <ViennaRNA/constraints.h>
This flag notifies the soft or hard constraint callback function that the current decomposition step evaluates a multi-
branch loop part in the interval [i : j], which will decomposed into a multibranch loop part [i : k], and a stem with
enclosing base pair (l, j).
#include <ViennaRNA/constraints.h>
This flag notifies the soft or hard constraint callback function that the current decomposition step evaluates a multi-
branch loop part in the interval [i : j], where two stems with enclosing pairs (i, k) and (l, j) are coaxially stacking
onto each other.
Generated by Doxygen
15.9 Constraining the RNA folding grammar 155
#include <ViennaRNA/constraints.h>
Indicator for decomposition of multibranch loop part.
This flag notifies the soft or hard constraint callback function that the current decomposition step evaluates a multi-
branch loop part in the interval [i : j], where two stems with enclosing pairs (i, k) and (l, j) are coaxially stacking
onto each other.
#include <ViennaRNA/constraints.h>
Indicator for decomposition of exterior loop part.
This flag notifies the soft or hard constraint callback function that the current decomposition step evaluates an
exterior loop part in the interval [i : j], which will be decomposed into a (usually) smaller exterior loop part [k : l].
#include <ViennaRNA/constraints.h>
Indicator for decomposition of exterior loop part.
This flag notifies the soft or hard constraint callback function that the current decomposition step evaluates an
exterior loop part in the interval [i : j], which will be considered as an exterior loop component consisting of only
unpaired nucleotides.
Generated by Doxygen
156 Module Documentation
#include <ViennaRNA/constraints.h>
Indicator for decomposition of exterior loop part.
This flag notifies the soft or hard constraint callback function that the current decomposition step evaluates an
exterior loop part in the interval [i : j], which will be considered a stem with enclosing pair (k, l).
#include <ViennaRNA/constraints.h>
Indicator for decomposition of exterior loop part.
This flag notifies the soft or hard constraint callback function that the current decomposition step evaluates an
exterior loop part in the interval [i : j], which will be decomposed into two exterior loop parts [i : k] and [l : j].
#include <ViennaRNA/constraints.h>
Indicator for decomposition of exterior loop part.
This flag notifies the soft or hard constraint callback function that the current decomposition step evaluates an
exterior loop part in the interval [i : j], which will be decomposed into a stem branching off with base pair (i, k),
and an exterior loop part [l : j].
Generated by Doxygen
15.9 Constraining the RNA folding grammar 157
#include <ViennaRNA/constraints.h>
This flag notifies the soft or hard constraint callback function that the current decomposition step evaluates an
exterior loop part in the interval [i : j], which will be decomposed into an exterior loop part [i : k], and a stem
branching off with base pair (l, j).
#include <ViennaRNA/constraints.h>
This flag notifies the soft or hard constraint callback function that the current decomposition step evaluates an
exterior loop part in the interval [i : j], which will be decomposed into an exterior loop part [i : k], and a stem
branching off with base pair (l, j 1).
15.9.3.1 void vrna_constraints_add ( vrna_fold_compound_t vc, const char constraint, unsigned int options )
#include <ViennaRNA/constraints.h>
Use this function to add/update the hard/soft constraints The function allows for passing a string 'constraint' that can
either be a filename that points to a constraints definition file or it may be a pseudo dot-bracket notation indicating
hard constraints. For the latter, the user has to pass the VRNA_CONSTRAINT_DB option. Also, the user has to
specify, which characters are allowed to be interpreted as constraints by passing the corresponding options via the
third parameter.
Generated by Doxygen
158 Module Documentation
See also
The following is an example for adding hard constraints given in pseudo dot-bracket notation. Here, vc is the
vrna_fold_compound_t object, structure is a char array with the hard constraint in dot-bracket notation, and
enforceConstraints is a flag indicating whether or not constraints for base pairs should be enforced instead
of just doing a removal of base pair that conflict with the constraint.
vrna_constraints_add(vc, constraints_file,
VRNA_OPTION_MFE | ((pf) ? VRNA_OPTION_PF : 0));
See also
Parameters
#include <ViennaRNA/constraints_hard.h>
Print a help message for pseudo dot-bracket structure constraint characters to stdout. (constraint support is speci-
fied by option parameter)
Generated by Doxygen
15.9 Constraining the RNA folding grammar 159
See also
Parameters
option Option switch that tells which constraint help will be printed
#include <ViennaRNA/constraints_hard.h>
See also
Generated by Doxygen
160 Module Documentation
This module covers all functionality for hard constraints in secondary structure prediction.
Files
file constraints_hard.h
Functions and data structures for handling of secondary structure hard constraints.
Data Structures
struct vrna_hc_s
The hard constraints data structure. More...
struct vrna_hc_up_s
A single hard constraint for a single nucleotide. More...
Macros
Generated by Doxygen
15.10 Hard constraints 161
Typedefs
Functions
This module covers all functionality for hard constraints in secondary structure prediction.
Generated by Doxygen
162 Module Documentation
The content of this data structure determines the decomposition pattern used in the folding recursions. Attribute
'matrix' is used as source for the branching pattern of the decompositions during all folding recursions. Any entry in
matrix[i,j] consists of the 6 LSB that allows one to distinguish the following types of base pairs:
The four linear arrays 'up_xxx' provide the number of available unpaired nucleotides (including position i) 3' of each
position in the sequence.
See also
Data Fields
char matrix
Upper triangular matrix that encodes where a base pair or unpaired nucleotide is allowed.
int up_ext
A linear array that holds the number of allowed unpaired nucleotides in an exterior loop.
int up_hp
A linear array that holds the number of allowed unpaired nucleotides in a hairpin loop.
int up_int
A linear array that holds the number of allowed unpaired nucleotides in an interior loop.
int up_ml
A linear array that holds the number of allowed unpaired nucleotides in a multi branched loop.
vrna_callback_hc_evaluate f
A function pointer that returns whether or not a certain decomposition may be evaluated.
void data
A pointer to some structure where the user may store necessary data to evaluate its generic hard constraint function.
vrna_callback_free_auxdata free_data
A pointer to a function to free memory occupied by auxiliary data.
Generated by Doxygen
15.10 Hard constraints 163
The function this pointer is pointing to will be called upon destruction of the vrna_hc_s, and provided with the vrna-
_hc_s.data pointer that may hold auxiliary data. Hence, to avoid leaking memory, the user may use this pointer to
free memory occupied by auxiliary data.
Data Fields
int position
The sequence position (1-based)
char options
The hard constraint option.
#include <ViennaRNA/constraints_hard.h>
Flag for vrna_constraints_add() to indicate that constraint is passed in pseudo dot-bracket notation.
See also
#include <ViennaRNA/constraints_hard.h>
This flag should be used to really enforce base pairs given in dot-bracket constraint rather than just weakly-enforcing
them.
See also
Generated by Doxygen
164 Module Documentation
#include <ViennaRNA/constraints_hard.h>
Flag that is used to indicate the pipe '|' sign in pseudo dot-bracket notation of hard constraints.
Use this definition to indicate the pipe sign '|' (paired with another base)
See also
#include <ViennaRNA/constraints_hard.h>
See also
#include <ViennaRNA/constraints_hard.h>
See also
#include <ViennaRNA/constraints_hard.h>
round brackets '(',')' switch for structure constraint (base i pairs base j)
See also
Generated by Doxygen
15.10 Hard constraints 165
#include <ViennaRNA/constraints_hard.h>
Flag that is used to indicate the character 'l' in pseudo dot-bracket notation of hard constraints.
Use this definition to indicate the usage of 'l' character (intramolecular pairs only)
See also
#include <ViennaRNA/constraints_hard.h>
Flag that is used to indicate the character 'e' in pseudo dot-bracket notation of hard constraints.
Use this definition to indicate the usage of 'e' character (intermolecular pairs only)
See also
#include <ViennaRNA/constraints_hard.h>
See also
Warning
Generated by Doxygen
166 Module Documentation
#include <ViennaRNA/constraints_hard.h>
Value:
( VRNA_CONSTRAINT_DB \
| VRNA_CONSTRAINT_DB_PIPE \
| VRNA_CONSTRAINT_DB_DOT \
| VRNA_CONSTRAINT_DB_X \
| VRNA_CONSTRAINT_DB_ANG_BRACK \
| VRNA_CONSTRAINT_DB_RND_BRACK \
| VRNA_CONSTRAINT_DB_INTRAMOL \
| VRNA_CONSTRAINT_DB_INTERMOL \
| VRNA_CONSTRAINT_DB_GQUAD \
)
This flag conveniently combines all possible symbols in dot-bracket notation for hard constraints and VRNA_CO-
NSTRAINT_DB
See also
15.10.4.1 typedef char( vrna_callback_hc_evaluate) (int i, int j, int k, int l, char d, void data)
#include <ViennaRNA/constraints_hard.h>
Callback to evaluate whether or not a particular decomposition step is contributing to the solution space.
This is the prototype for callback functions used by the folding recursions to evaluate generic hard constraints. The
first four parameters passed indicate the delimiting nucleotide positions of the decomposition, and the parameter
denotes the decomposition step. The last parameter data is the auxiliary data structure associated to the hard
constraints via vrna_hc_add_data(), or NULL if no auxiliary data was added.
See also
Parameters
Returns
#include <ViennaRNA/constraints_hard.h>
This function resets the hard constraints to their default values, i.e. all positions may be unpaired in all contexts,
and base pairs are allowed in all contexts, if they resemble canonical pairs. Previously set hard constraints will be
removed vefore initialization.
See also
Parameters
SWIG Wrapper Notes This function is attached as method hc_init() to objects of type fold_compound
#include <ViennaRNA/constraints_hard.h>
See also
Parameters
SWIG Wrapper Notes This function is attached as method hc_add_up() to objects of type fold_compound
Generated by Doxygen
168 Module Documentation
#include <ViennaRNA/constraints_hard.h>
Parameters
#include <ViennaRNA/constraints_hard.h>
See also
Parameters
SWIG Wrapper Notes This function is attached as method hc_add_bp() to objects of type fold_compound
#include <ViennaRNA/constraints_hard.h>
See also
Generated by Doxygen
15.10 Hard constraints 169
Parameters
SWIG Wrapper Notes This function is attached as method hc_add_bp_nonspecific() to objects of type fold_-
compound
#include <ViennaRNA/constraints_hard.h>
Use this function to free all memory that was allocated for a data structure of type vrna_hc_t .
See also
get_hard_constraints(), vrna_hc_t
15.10.5.7 int vrna_hc_add_from_db ( vrna_fold_compound_t vc, const char constraint, unsigned int options )
#include <ViennaRNA/constraints_hard.h>
This function allows one to apply hard constraints from a pseudo dot-bracket notation. The options parameter
controls, which characters are recognized by the parser. Use the VRNA_CONSTRAINT_DB_DEFAULT conve-
nience macro, if you want to allow all known characters
See also
Parameters
SWIG Wrapper Notes This function is attached as method hc_add_from_db() to objects of type fold_compound
Generated by Doxygen
170 Module Documentation
Files
file constraints_soft.h
Functions and data structures for secondary structure soft constraints.
Data Structures
struct vrna_sc_s
The soft constraints data structure. More...
Typedefs
Functions
Generated by Doxygen
15.11 Soft constraints 171
Soft-constraints are used to change position specific contributions in the recursions by adding bonuses/penalties in
form of pseudo free energies to certain loop configurations.
Data Fields
int energy_up
Energy contribution for stretches of unpaired nucleotides.
int energy_bp
Energy contribution for base pairs.
FLT_OR_DBL exp_energy_up
Boltzmann Factors of the energy contributions for unpaired sequence stretches.
FLT_OR_DBL exp_energy_bp
Boltzmann Factors of the energy contribution for base pairs.
int energy_stack
Pseudo Energy contribution per base pair involved in a stack.
FLT_OR_DBL exp_energy_stack
Boltzmann weighted pseudo energy contribution per nucleotide involved in a stack.
vrna_callback_sc_energy f
A function pointer used for pseudo energy contribution in MFE calculations.
vrna_callback_sc_backtrack bt
A function pointer used to obtain backtraced base pairs in loop regions that were altered by soft constrained pseudo
energy contributions.
vrna_callback_sc_exp_energy exp_f
A function pointer used for pseudo energy contribution boltzmann factors in PF calculations.
void data
A pointer to the data object provided for for pseudo energy contribution functions of the generic soft constraints
feature.
Generated by Doxygen
172 Module Documentation
See also
vrna_sc_add_f()
A function pointer used to obtain backtraced base pairs in loop regions that were altered by soft constrained pseudo
energy contributions.
See also
vrna_sc_add_bt()
A function pointer used for pseudo energy contribution boltzmann factors in PF calculations.
See also
vrna_sc_add_exp_f()
15.11.3.1 typedef int( vrna_callback_sc_energy) (int i, int j, int k, int l, char d, void data)
#include <ViennaRNA/constraints_soft.h>
This is the prototype for callback functions used by the folding recursions to evaluate generic soft constraints. The
first four parameters passed indicate the delimiting nucleotide positions of the decomposition, and the parameter
denotes the decomposition step. The last parameter data is the auxiliary data structure associated to the hard
constraints via vrna_sc_add_data(), or NULL if no auxiliary data was added.
See also
Generated by Doxygen
15.11 Soft constraints 173
Parameters
Returns
15.11.3.2 typedef FLT_OR_DBL( vrna_callback_sc_exp_energy) (int i, int j, int k, int l, char d, void data)
#include <ViennaRNA/constraints_soft.h>
Callback to retrieve pseudo energy contribution as Boltzmann Factors for soft constraint feature.
This is the prototype for callback functions used by the partition function recursions to evaluate generic soft con-
straints. The first four parameters passed indicate the delimiting nucleotide positions of the decomposition, and the
parameter denotes the decomposition step. The last parameter data is the auxiliary data structure associated
to the hard constraints via vrna_sc_add_data(), or NULL if no auxiliary data was added.
See also
Parameters
Returns
15.11.3.3 typedef vrna_basepair_t( vrna_callback_sc_backtrack) (int i, int j, int k, int l, char d, void data)
#include <ViennaRNA/constraints_soft.h>
Generated by Doxygen
174 Module Documentation
See also
Parameters
Returns
#include <ViennaRNA/constraints_soft.h>
This function adds a proper soft constraints data structure to the vrna_fold_compound_t data structure. If soft
constraints already exist within the fold compound, they are removed.
Note
See also
Parameters
SWIG Wrapper Notes This function is attached as method sc_init() to objects of type fold_compound
Generated by Doxygen
15.11 Soft constraints 175
15.11.4.2 void vrna_sc_set_bp ( vrna_fold_compound_t vc, const FLT_OR_DBL constraints, unsigned int
options )
#include <ViennaRNA/constraints_soft.h>
Note
This function replaces any pre-exisitng soft constraints with the ones supplied in constraints.
See also
Parameters
SWIG Wrapper Notes This function is attached as method sc_set_bp() to objects of type fold_compound
15.11.4.3 void vrna_sc_add_bp ( vrna_fold_compound_t vc, int i, int j, FLT_OR_DBL energy, unsigned int options )
#include <ViennaRNA/constraints_soft.h>
See also
Parameters
SWIG Wrapper Notes This function is attached as an overloaded method sc_add_bp() to objects of type fold-
_compound. The method either takes arguments for a single base pair (i,j) with the corre-
sponding energy value:
Generated by Doxygen
176 Module Documentation
or an entire 2-dimensional matrix with dimensions n x n that stores free energy contributions
for any base pair (i,j) with 1 i < j n:
15.11.4.4 void vrna_sc_set_up ( vrna_fold_compound_t vc, const FLT_OR_DBL constraints, unsigned int options
)
#include <ViennaRNA/constraints_soft.h>
Note
This function replaces any pre-exisitng soft constraints with the ones supplied in constraints.
See also
Parameters
SWIG Wrapper Notes This function is attached as method sc_set_up() to objects of type fold_compound
15.11.4.5 void vrna_sc_add_up ( vrna_fold_compound_t vc, int i, FLT_OR_DBL energy, unsigned int options )
#include <ViennaRNA/constraints_soft.h>
See also
Parameters
Generated by Doxygen
15.11 Soft constraints 177
SWIG Wrapper Notes This function is attached as an overloaded method sc_add_up() to objects of type fold-
_compound. The method either takes arguments for a single nucleotide i with the corre-
sponding energy value:
or an entire vector that stores free energy contributions for each nucleotide i with 1 i
n:
#include <ViennaRNA/constraints_soft.h>
Note
Parameters
SWIG Wrapper Notes This function is attached as method sc_remove() to objects of type fold_compound
#include <ViennaRNA/constraints_soft.h>
Parameters
#include <ViennaRNA/constraints_soft.h>
Add an auxiliary data structure for the generic soft constraints callback function.
Generated by Doxygen
178 Module Documentation
See also
Parameters
vc The fold compound the generic soft constraint function should be bound to
data A pointer to the data structure that holds required data for function 'f'
free_data A pointer to a function that free's the memory occupied by data (Maybe NULL)
SWIG Wrapper Notes This function is attached as method sc_add_data() to objects of type fold_compound
#include <ViennaRNA/constraints_soft.h>
Bind a function pointer for generic soft constraint feature (MFE version)
This function allows one to easily bind a function pointer and corresponding data structure to the soft constraint part
vrna_sc_t of the vrna_fold_compound_t. The function for evaluating the generic soft constraint feature has to return
a pseudo free energy E in dacal/mol, where 1dacal/mol = 10cal/mol.
See also
Parameters
vc The fold compound the generic soft constraint function should be bound to
f A pointer to the function that evaluates the generic soft constraint feature
SWIG Wrapper Notes This function is attached as method sc_add_f() to objects of type fold_compound
#include <ViennaRNA/constraints_soft.h>
This function allows one to easily bind a function pointer to the soft constraint part vrna_sc_t of the vrna_fold_-
compound_t. The provided function should be used for backtracking purposes in loop regions that were altered
via the generic soft constraint feature. It has to return an array of vrna_basepair_t data structures, were the last
element in the list is indicated by a value of -1 in it's i position.
See also
Generated by Doxygen
15.11 Soft constraints 179
Parameters
vc The fold compound the generic soft constraint function should be bound to
f A pointer to the function that returns additional base pairs
SWIG Wrapper Notes This function is attached as method sc_add_bt() to objects of type fold_compound
#include <ViennaRNA/constraints_soft.h>
Bind a function pointer for generic soft constraint feature (PF version)
This function allows one to easily bind a function pointer and corresponding data structure to the soft constraint part
vrna_sc_t of the vrna_fold_compound_t. The function for evaluating the generic soft constraint feature has to return
a pseudo free energy E as Boltzmann factor, i.e. exp(E/kT ). The required unit for E is cal/mol.
See also
Parameters
vc The fold compound the generic soft constraint function should be bound to
exp- A pointer to the function that evaluates the generic soft constraint feature
_f
SWIG Wrapper Notes This function is attached as method sc_add_exp_f() to objects of type fold_compound
Generated by Doxygen
180 Module Documentation
Neighborhood relation
and move sets for secondary
structures
The RNA secondary structure
landscape
Refolding paths of
secondary structures
Modules
Generated by Doxygen
15.13 Minimum Free Energy (MFE) algorithms 181
Compute Minimum Free energy (MFE) and backtrace corresponding secondary structures from RNA sequence
data.
Modules
Files
file fold.h
MFE calculations for single RNA sequences.
Generated by Doxygen
182 Module Documentation
Functions
Compute Minimum Free energy (MFE) and backtrace corresponding secondary structures from RNA sequence
data.
The library provides a fast dynamic programming minimum free energy folding algorithm as described in [24]. All
relevant parts that directly implement the "Zuker & Stiegler" algorithm for single sequences are described in this
section.
Folding of circular RNA sequences is handled as a post-processing step of the forward recursions. See [9] for
further details.
Nevertheless, the RNAlib also provides interfaces for the prediction of consensus MFE structures of sequence
alignments, MFE structure for two hybridized sequences, local optimal structures and many more. For those more
specialized variants of MFE folding routines, please consult the appropriate subsections (Modules) as listed above.
#include <ViennaRNA/mfe.h>
Compute minimum free energy and an appropriate secondary structure of an RNA sequence, or RNA sequence
alignment.
Depending on the type of the provided vrna_fold_compound_t, this function predicts the MFE for a single sequence,
or a corresponding averaged MFE for a sequence alignment. If backtracking is activated, it also constructs the
corresponding secondary structure, or consensus structure. Therefore, the second parameter, structure, has to
point to an allocated block of memory with a size of at least strlen(sequence) + 1 to store the backtracked MFE
structure. (For consensus structures, this is the length of the alignment + 1. If NULL is passed, no backtracking will
be performed.
Note
See also
Parameters
vc fold compound
structure A pointer to the character array where the secondary structure in dot-bracket notation will be written
to (Maybe NULL)
Generated by Doxygen
15.13 Minimum Free Energy (MFE) algorithms 183
Returns
SWIG Wrapper Notes This function is attached as method mfe() to objects of type fold_compound
Generated by Doxygen
184 Module Documentation
Compuate the partition function and various equilibrium properties derived from it.
Collaboration diagram for Partition function and equilibrium properties:
Partition Function
and Base Pair Probabilities
for Sequence Alignment(s)
Partition Function
for two hybridized
Sequences as a stepwise
Process
Calculate Partition
Functions of a Distance
Based Partitioning
part_func_co.h
Partition function part_func_up.h
and equilibrium properties RNA-RNA interaction
Partition Function
and Equilibrium Probabilities
for Locally Stable Secondary
Structures
Modules
Partition Function and Base Pair Probabilities for Sequence Alignment(s)
Calculate Partition Functions of a Distance Based Partitioning
Compute the partition function and stochastically sample secondary structures for a partitioning of the secondary
structure space according to the base pair distance to two fixed reference structures.
Partition Function for two hybridized Sequences
Partition Function Cofolding.
Partition Function for two hybridized Sequences as a stepwise Process
RNA-RNA interaction as a stepwise process.
Partition Function and Equilibrium Probabilities for Locally Stable Secondary Structures
Files
file equilibrium_probs.h
Equilibrium Probability implementations.
file part_func.h
Partition function implementations.
file part_func_co.h
Partition function for two RNA sequences.
file part_func_up.h
Implementations for accessibility and RNA-RNA interaction as a stepwise process.
Generated by Doxygen
15.14 Partition function and equilibrium properties 185
Functions
Compuate the partition function and various equilibrium properties derived from it.
Instead of the minimum free energy structure the partition function of all possible structures and from that the pairing
probability for every possible pair can be calculated, using a dynamic programming algorithm as described in [15].
Generated by Doxygen
186 Module Documentation
#include <ViennaRNA/equilibrium_probs.h>
Get the mean base pair distance in the thermodynamic ensemble from a probability matrix.
P
< d >= a,b pa pb d(Sa , Sb )
this can be
Pcomputed from the pair probs pi j as
< d >= ij pij (1 pij )
Parameters
Returns
#include <ViennaRNA/equilibrium_probs.h>
Parameters
Returns
SWIG Wrapper Notes This function is attached as method mean_bp_distance() to objects of type fold_compound
#include <ViennaRNA/equilibrium_probs.h>
For each possible base pair (i, j), compute the probability of a stack (i, j), (i + 1, j 1).
Generated by Doxygen
15.14 Partition function and equilibrium properties 187
Parameters
vc The fold compound data structure with precomputed base pair probabilities
cutoff A cutoff value that limits the output to stacks with p > cutoff.
Returns
#include <ViennaRNA/part_func.h>
Compute the partition function Q for a given RNA sequence, or sequence alignment.
If structure is not a NULL pointer on input, it contains on return a string consisting of the letters " . , | { } ( ) "
denoting bases that are essentially unpaired, weakly paired, strongly paired without preference, weakly upstream
(downstream) paired, or strongly up- (down-)stream paired bases, respectively. If the parameter calculate_bppm is
set to 0 base pairing probabilities will not be computed (saving CPU time), otherwise after calculations took place
pr will contain the probability that bases i and j pair.
Note
See also
Parameters
Returns
SWIG Wrapper Notes This function is attached as method pf() to objects of type fold_compound
#include <ViennaRNA/part_func.h>
Generated by Doxygen
188 Module Documentation
Compute Partition function Q (and base pair probabilities) for an RNA sequence using a comparative method.
This simplified interface to vrna_pf() computes the partition function and, if required, base pair probabilities for an
RNA sequence using default options. Memory required for dynamic programming (DP) matrices will be allocated
and free'd on-the-fly. Hence, after return of this function, the recursively filled matrices are not available any more
for any post-processing.
Note
In case you want to use the filled DP matrices for any subsequent post-processing step, or you require other
conditions than specified by the default model details, use vrna_pf(), and the data structure vrna_fold_-
compound_t instead.
See also
Parameters
sequence RNA sequence
structure A pointer to the character array where position-wise pairing propensity will be stored. (Maybe NULL)
pl A pointer to a list of vrna_plist_t to store pairing probabilities (Maybe NULL)
Returns
#include <ViennaRNA/part_func.h>
Compute Partition function Q (and base pair probabilities) for a circular RNA sequences using a comparative
method.
This simplified interface to vrna_pf() computes the partition function and, if required, base pair probabilities for a
circular RNA sequence using default options. Memory required for dynamic programming (DP) matrices will be
allocated and free'd on-the-fly. Hence, after return of this function, the recursively filled matrices are not available
any more for any post-processing.
Note
In case you want to use the filled DP matrices for any subsequent post-processing step, or you require other
conditions than specified by the default model details, use vrna_pf(), and the data structure vrna_fold_-
compound_t instead.
Folding of circular RNA sequences is handled as a post-processing step of the forward recursions. See [9] for
further details.
See also
Generated by Doxygen
15.14 Partition function and equilibrium properties 189
Parameters
sequence A circular RNA sequence
structure A pointer to the character array where position-wise pairing propensity will be stored. (Maybe NULL)
pl A pointer to a list of vrna_plist_t to store pairing probabilities (Maybe NULL)
Returns
15.14.2.7 float pf_fold_par ( const char sequence, char structure, vrna_exp_param_t parameters, int
calculate_bppm, int is_constrained, int is_circular )
#include <ViennaRNA/part_func.h>
If structure is not a NULL pointer on input, it contains on return a string consisting of the letters " . , | { } ( ) "
denoting bases that are essentially unpaired, weakly paired, strongly paired without preference, weakly upstream
(downstream) paired, or strongly up- (down-)stream paired bases, respectively. If fold_constrained is not 0, the
structure string is interpreted on input as a list of constraints for the folding. The character "x" marks bases that
must be unpaired, matching brackets " ( ) " denote base pairs, all other characters are ignored. Any pairs conflicting
with the constraint will be forbidden. This is usually sufficient to ensure the constraints are honored. If the param-
eter calculate_bppm is set to 0 base pairing probabilities will not be computed (saving CPU time), otherwise after
calculations took place pr will contain the probability that bases i and j pair.
Note
The global array pr is deprecated and the user who wants the calculated base pair probabilities for further
computations is advised to use the function export_bppm()
Postcondition
After successful run the hidden folding matrices are filled with the appropriate Boltzmann factors. Depending
on whether the global variable do_backtrack was set the base pair probabilities are already computed and
may be accessed for further usage via the export_bppm() function. A call of free_pf_arrays() will free all
memory allocated by this function. Successive calls will first free previously allocated memory before starting
the computation.
See also
Parameters
in sequence The RNA sequence input
in,out structure A pointer to a char array where a base pair probability information can be stored
in a pseudo-dot-bracket notation (may be NULL, too)
in parameters
Generated by Doxygen
Data structure containing the precalculated Boltzmann factors
in calculate_bppm Switch to Base pair probability calculations on/off (0==off)
in is_constrained Switch to indicate that a structure contraint is passed via the structure argument
(0==off)
190 Module Documentation
Returns
#include <ViennaRNA/part_func.h>
If structure is not a NULL pointer on input, it contains on return a string consisting of the letters " . , | { } ( ) "
denoting bases that are essentially unpaired, weakly paired, strongly paired without preference, weakly upstream
(downstream) paired, or strongly up- (down-)stream paired bases, respectively. If fold_constrained is not 0, the
structure string is interpreted on input as a list of constraints for the folding. The character "x" marks bases that
must be unpaired, matching brackets " ( ) " denote base pairs, all other characters are ignored. Any pairs conflicting
with the constraint will be forbidden. This is usually sufficient to ensure the constraints are honored. If do_backtrack
has been set to 0 base pairing probabilities will not be computed (saving CPU time), otherwise pr will contain the
probability that bases i and j pair.
Note
The global array pr is deprecated and the user who wants the calculated base pair probabilities for further
computations is advised to use the function export_bppm().
OpenMP: This function is not entirely threadsafe. While the recursions are working on their own copies of data
the model details for the recursions are determined from the global settings just before entering the recursions.
Consider using pf_fold_par() for a really threadsafe implementation.
Precondition
This function takes its model details from the global variables provided in RNAlib
Postcondition
After successful run the hidden folding matrices are filled with the appropriate Boltzmann factors. Depending
on whether the global variable do_backtrack was set the base pair probabilities are already computed and
may be accessed for further usage via the export_bppm() function. A call of free_pf_arrays() will free all
memory allocated by this function. Successive calls will first free previously allocated memory before starting
the computation.
See also
Parameters
sequence The RNA sequence input
structure A pointer to a char array where a base pair probability information can be stored in a
pseudo-dot-bracket notation (may be NULL, too)
Generated by Doxygen
15.14 Partition function and equilibrium properties 191
Returns
#include <ViennaRNA/part_func.h>
Note
The global array pr is deprecated and the user who wants the calculated base pair probabilities for further
computations is advised to use the function export_bppm().
OpenMP: This function is not entirely threadsafe. While the recursions are working on their own copies of data
the model details for the recursions are determined from the global settings just before entering the recursions.
Consider using pf_fold_par() for a really threadsafe implementation.
Precondition
This function takes its model details from the global variables provided in RNAlib
Postcondition
After successful run the hidden folding matrices are filled with the appropriate Boltzmann factors. Depending
on whether the global variable do_backtrack was set the base pair probabilities are already computed and
may be accessed for further usage via the export_bppm() function. A call of free_pf_arrays() will free all
memory allocated by this function. Successive calls will first free previously allocated memory before starting
the computation.
See also
vrna_pf()
Parameters
in sequence The RNA sequence input
in,out structure A pointer to a char array where a base pair probability information can be stored in a
pseudo-dot-bracket notation (may be NULL, too)
Returns
#include <ViennaRNA/part_func.h>
Generated by Doxygen
192 Module Documentation
Call this function if you want to free all allocated memory associated with the partition function forward recursion.
Note
Successive calls of pf_fold(), pf_circ_fold() already check if they should free any memory from a previous run.
OpenMP notice:
This function should be called before leaving a thread in order to avoid leaking memory
Deprecated See vrna_fold_compound_t and its related functions for how to free memory occupied by the dynamic
programming matrices
Postcondition
See also
#include <ViennaRNA/part_func.h>
Call this function to recalculate the pair matrix and energy parameters after a change in folding parameters like
temperature
#include <ViennaRNA/part_func.h>
Generated by Doxygen
15.14 Partition function and equilibrium properties 193
#include <ViennaRNA/part_func.h>
Accessing the base pair probabilities for a pair (i,j) is achieved by.
Precondition
Call pf_fold_par(), pf_fold() or pf_circ_fold() first to fill the base pair probability array
See also
Returns
15.14.2.14 int get_pf_arrays ( short S_p, short S1_p, char ptype_p, FLT_OR_DBL qb_p, FLT_OR_DBL
qm_p, FLT_OR_DBL q1k_p, FLT_OR_DBL qln_p )
#include <ViennaRNA/part_func.h>
Get the pointers to (almost) all relavant computation arrays used in partition function computation.
Precondition
In order to assign meaningful pointers, you have to call pf_fold_par() or pf_fold() first!
See also
Parameters
Generated by Doxygen
194 Module Documentation
Returns
#include <ViennaRNA/part_func.h>
Get the mean base pair distance of the last partition function computation.
See also
vrna_mean_bp_distance(), vrna_mean_bp_distance_pr()
Parameters
length
Returns
#include <ViennaRNA/part_func.h>
Parameters
Returns
Generated by Doxygen
15.14 Partition function and equilibrium properties 195
#include <ViennaRNA/structure_utils.h>
The probability matrix provided via the vrna_fold_compound_t is parsed and all pair probabilities above the given
threshold are used to create an entry in the plist
The end of the plist is marked by sequence positions i as well as j equal to 0. This condition should be used to stop
looping over its entries
Parameters
Returns
15.14.2.18 void assign_plist_from_pr ( vrna_plist_t pl, FLT_OR_DBL probs, int length, double cutoff )
#include <ViennaRNA/structure_utils.h>
The probability matrix given is parsed and all pair probabilities above the given threshold are used to create an entry
in the plist
The end of the plist is marked by sequence positions i as well as j equal to 0. This condition should be used to stop
looping over its entries
Note
Parameters
out pl A pointer to the vrna_plist_t that is to be created
in probs The probability matrix used for creating the plist
in length The length of the RNA sequence
in cutoff The cutoff value
Generated by Doxygen
196 Module Documentation
Sample and enumerate suboptimal secondary structures from RNA sequence data.
Collaboration diagram for Suboptimals and representative structures:
Suboptimal structures
sensu Stiegler et al.
1984 / Zuker et al. 1989
Suboptimal structures
within an energy band
arround the MFE
Modules
Suboptimal structures sensu Stiegler et al. 1984 / Zuker et al. 1989
Suboptimal structures within an energy band arround the MFE
Structure sampling from the ensemble
Compute the structure with maximum expected accuracy (MEA)
Compute the centroid structure
Files
file boltzmann_sampling.h
Boltzmann Sampling of secondary structures from the ensemble.
file centroid.h
Centroid structure computation.
file MEA.h
Computes a MEA (maximum expected accuracy) structure.
file mm.h
Several Maximum Matching implementations.
file subopt.h
RNAsubopt and density of states declarations.
Sample and enumerate suboptimal secondary structures from RNA sequence data.
Generated by Doxygen
15.16 Suboptimal structures sensu Stiegler et al. 1984 / Zuker et al. 1989 197
15.16 Suboptimal structures sensu Stiegler et al. 1984 / Zuker et al. 1989
Collaboration diagram for Suboptimal structures sensu Stiegler et al. 1984 / Zuker et al. 1989:
Suboptimal structures
Suboptimals and representative
sensu Stiegler et al.
structures
1984 / Zuker et al. 1989
Functions
#include <ViennaRNA/subopt.h>
Compute Suboptimal structures according to M. Zuker [23] , i.e. for every possible base pair the minimum energy
structure containing the resp. base pair. Returns a list of these structures and their energies.
Note
This function internally uses the cofold implementation to compute the suboptimal structures. For that purpose,
the function doubles the sequence and enlarges the DP matrices, which in fact will grow by a factor of 4 during
the computation! At the end of the structure prediction, everything will be re-set to its original requriements,
i.e. normal sequence, normal (empty) DP matrices.
See also
Generated by Doxygen
198 Module Documentation
Parameters
vc fold compound
Returns
SWIG Wrapper Notes This function is attached as method subopt_zuker() to objects of type fold_compound
#include <ViennaRNA/subopt.h>
Compute Suboptimal structures according to M. Zuker, i.e. for every possible base pair the minimum energy struc-
ture containing the resp. base pair. Returns a list of these structures and their energies.
Parameters
string RNA sequence
Returns
#include <ViennaRNA/subopt.h>
Generated by Doxygen
15.17 Suboptimal structures within an energy band arround the MFE 199
Collaboration diagram for Suboptimal structures within an energy band arround the MFE:
Suboptimal structures
Suboptimals and representative
within an energy band
structures
arround the MFE
Typedefs
typedef void( vrna_subopt_callback) (const char stucture, float energy, void data)
Callback for vrna_subopt_cb()
Functions
vrna_subopt_solution_t vrna_subopt (vrna_fold_compound_t vc, int delta, int sorted, FILE fp)
Returns list of subopt structures or writes to fp.
void vrna_subopt_cb (vrna_fold_compound_t vc, int delta, vrna_subopt_callback cb, void data)
Generate suboptimal structures within an energy band arround the MFE.
SOLUTION subopt (char seq, char structure, int delta, FILE fp)
Returns list of subopt structures or writes to fp.
SOLUTION subopt_par (char seq, char structure, vrna_param_t parameters, int delta, int is_-
constrained, int is_circular, FILE fp)
Returns list of subopt structures or writes to fp.
SOLUTION subopt_circ (char seq, char sequence, int delta, FILE fp)
Returns list of circular subopt structures or writes to fp.
Variables
double print_energy
printing threshold for use with logML
int subopt_sorted
Sort output by energy.
Generated by Doxygen
200 Module Documentation
15.17.2.1 vrna_subopt_solution_t vrna_subopt ( vrna_fold_compound_t vc, int delta, int sorted, FILE fp )
#include <ViennaRNA/subopt.h>
This function produces all suboptimal secondary structures within 'delta' 0.01 kcal/mol of the optimum, see [21].
The results are either directly written to a 'fp' (if 'fp' is not NULL), or (fp==NULL) returned in a vrna_subopt_-
solution_t list terminated by an entry were the 'structure' member is NULL.
Note
This function requires all multibranch loop DP matrices for unique multibranch loop backtracing. Therefore, the
supplied vrna_fold_compound_t vc (argument 1) must be initialized with vrna_md_t.uniq_ML = 1, for instance
like this:
See also
vrna_subopt_cb(), vrna_subopt_zuker()
Parameters
vc
delta
sorted Sort results by energy in ascending order
fp
Returns
SWIG Wrapper Notes This function is attached as method subopt() to objects of type fold_compound
15.17.2.2 void vrna_subopt_cb ( vrna_fold_compound_t vc, int delta, vrna_subopt_callback cb, void data )
#include <ViennaRNA/subopt.h>
Generate suboptimal structures within an energy band arround the MFE.
This is the most generic implementation of the suboptimal structure generator according to Wuchty et al. 1999 [21].
Identical to vrna_subopt(), it computes all secondary structures within an energy band delta arround the MFE.
However, this function does not print the resulting structures and their corresponding free energies to a file pointer,
or returns them as a list. Instead, it calls a user-provided callback function which it passes the structure in dot-
bracket format, the corresponding free energy in kcal/mol, and a user-provided data structure each time a structure
was backtracked successfully. This function indicates the final output, i.e. the end of the backtracking procedure by
passing NULL instead of an actual dot-bracket string to the callback.
Generated by Doxygen
15.17 Suboptimal structures within an energy band arround the MFE 201
Note
This function requires all multibranch loop DP matrices for unique multibranch loop backtracing. Therefore, the
supplied vrna_fold_compound_t vc (argument 1) must be initialized with vrna_md_t.uniq_ML = 1, for instance
like this:
00001 vrna_md_t md;
00002 vrna_md_set_default(&md);
00003 md.uniq_ML = 1;
00004
00005 vrna_fold_compound_t *vc=vrna_fold_compound("GGGGGGAAAAAACCCCCC", &md, VRNA_OPTION_DEFAULT);
See also
Parameters
SWIG Wrapper Notes This function is attached as method subopt_cb() to objects of type fold_compound
15.17.2.3 SOLUTION subopt ( char seq, char structure, int delta, FILE fp )
#include <ViennaRNA/subopt.h>
This function produces all suboptimal secondary structures within 'delta' 0.01 kcal/mol of the optimum. The results
are either directly written to a 'fp' (if 'fp' is not NULL), or (fp==NULL) returned in a SOLUTION list terminated by
an entry were the 'structure' pointer is NULL.
Parameters
seq
structure
delta
fp
Returns
15.17.2.4 SOLUTION subopt_circ ( char seq, char sequence, int delta, FILE fp )
#include <ViennaRNA/subopt.h>
Generated by Doxygen
202 Module Documentation
This function is similar to subopt() but calculates secondary structures assuming the RNA sequence to be circular
instead of linear
Parameters
seq
sequence
delta
fp
Returns
Generated by Doxygen
15.18 Structure sampling from the ensemble 203
Stochastic Backtracking
of Structures from Distance
Based Partitioning
Suboptimals and representative Structure sampling
structures from the ensemble
Stochastic Backtracking
of Consensus Structures
from Sequence Alignment(s)
Modules
Stochastic Backtracking of Consensus Structures from Sequence Alignment(s)
Stochastic Backtracking of Structures from Distance Based Partitioning
Contains functions related to stochastic backtracking from a specified distance class.
Functions
char vrna_pbacktrack5 (vrna_fold_compound_t vc, int length)
Sample a secondary structure of a subsequence from the Boltzmann ensemble according its probability.
char vrna_pbacktrack (vrna_fold_compound_t vc)
Sample a secondary structure (consensus structure) from the Boltzmann ensemble according its probability.
char pbacktrack (char sequence)
Sample a secondary structure from the Boltzmann ensemble according its probability.
char pbacktrack_circ (char sequence)
Sample a secondary structure of a circular RNA from the Boltzmann ensemble according its probability.
Variables
int st_back
Flag indicating that auxilary arrays are needed throughout the computations. This is essential for stochastic back-
tracking.
#include <ViennaRNA/boltzmann_sampling.h>
Sample a secondary structure of a subsequence from the Boltzmann ensemble according its probability.
Precondition
The fold compound has to be obtained using the VRNA_OPTION_HYBRID option in vrna_fold_compound()
vrna_pf() has to be called first to fill the partition function matrices
Generated by Doxygen
204 Module Documentation
Parameters
Returns
#include <ViennaRNA/boltzmann_sampling.h>
Sample a secondary structure (consensus structure) from the Boltzmann ensemble according its probability.
Precondition
The dynamic programming (DP) matrices have to allow for unique multibranch loop decomposition, i.e. the
vrna_md_t.uniq_ML flag has to be non-zero before calling vrna_fold_compound()
vrna_pf() has to be called first to fill the partition function matrices
Note
Parameters
Returns
#include <ViennaRNA/part_func.h>
Sample a secondary structure from the Boltzmann ensemble according its probability.
Precondition
Generated by Doxygen
15.18 Structure sampling from the ensemble 205
Parameters
sequence The RNA sequence
Returns
#include <ViennaRNA/part_func.h>
Sample a secondary structure of a circular RNA from the Boltzmann ensemble according its probability.
This function does the same as pbacktrack() but assumes the RNA molecule to be circular
Precondition
Parameters
sequence The RNA sequence
Returns
#include <ViennaRNA/part_func.h>
Flag indicating that auxilary arrays are needed throughout the computations. This is essential for stochastic back-
tracking.
Set this variable to 1 prior to a call of pf_fold() to ensure that all matrices needed for stochastic backtracking are
filled in the forward recursions
See also
pbacktrack(), pbacktrack_circ
Generated by Doxygen
206 Module Documentation
Collaboration diagram for Compute the structure with maximum expected accuracy (MEA):
Functions
#include <ViennaRNA/MEA.h>
Higher values of result in more base pairs of lower probability and thus higher sensitivity. Low values of result
in structures containing only highly likely pairs (high specificity). The code of the MEA function also demonstrates
the use of sparse dynamic programming scheme to reduce the time and memory complexity of folding.
Generated by Doxygen
15.20 Compute the centroid structure 207
Functions
#include <ViennaRNA/centroid.h>
The centroid is the structure with the minimal average distance to all other structures
P P
< d(S) >= (i,j)S (1 pij ) + (i,j)S
/ pij
Thus, the centroid is simply the structure containing all pairs with pi j > 0.5 The distance of the centroid to the
ensemble is written to the memory adressed by dist.
Parameters
Returns
Generated by Doxygen
208 Module Documentation
#include <ViennaRNA/centroid.h>
The centroid P
is the structure with the
Pminimal average distance to all other structures
< d(S) >= (i,j)S (1 pij ) + (i,j)S
/ pij
Thus, the centroid is simply the structure containing all pairs with pi j > 0.5 The distance of the centroid to the
ensemble is written to the memory adressed by dist.
Parameters
Returns
#include <ViennaRNA/centroid.h>
This function is a threadsafe replacement for centroid() with a probability array input
The centroid is the structure with the minimal average distance to all other structures
P P
< d(S) >= (i,j)S (1 pij ) + (i,j)S
/ pij
Thus, the centroid is simply the structure containing all pairs with pi j > 0.5 The distance of the centroid to the
ensemble is written to the memory adressed by dist.
Parameters
Returns
Generated by Doxygen
15.21 RNA-RNA interaction 209
Partition Function
for two hybridized
Sequences as a stepwise
Process
Partition function
part_func_co.h
and equilibrium properties
part_func_up.h
Modules
Files
file cofold.h
MFE implementations for RNA-RNA interaction.
file duplex.h
Functions for simple RNA-RNA duplex interactions.
file part_func_co.h
Partition function for two RNA sequences.
file part_func_up.h
Implementations for accessibility and RNA-RNA interaction as a stepwise process.
Generated by Doxygen
210 Module Documentation
The function of an RNA molecule often depends on its interaction with other RNAs. The following routines therefore
allows one to predict structures formed by two RNA molecules upon hybridization.
One approach to co-folding two RNAs consists of concatenating the two sequences and keeping track of the con-
catenation point in all energy evaluations. Correspondingly, many of the cofold() and co_pf_fold() routines below
take one sequence string as argument and use the the global variable cut_point to mark the concatenation point.
Note that while the RNAcofold program uses the '&' character to mark the chain break in its input, you should not
use an '&' when using the library routines (set cut_point instead).
In a second approach to co-folding two RNAs, cofolding is seen as a stepwise process. In the first step the proba-
bility of an unpaired region is calculated and in a second step this probability of an unpaired region is multiplied with
the probability of an interaction between the two RNAs. This approach is implemented for the interaction between
a long target sequence and a short ligand RNA. Function pf_unstru() calculates the partition function over all un-
paired regions in the input sequence. Function pf_interact(), which calculates the partition function over all possible
interactions between two sequences, needs both sequence as separate strings as input.
Generated by Doxygen
15.22 Locally stable structures 211
Partition Function
and Equilibrium Probabilities
for Locally Stable Secondary
Structures
Modules
Files
file Lfold.h
Functions for locally optimal MFE structure prediction.
file LPfold.h
Partition function implementation for the Lfold algorithm.
Generated by Doxygen
212 Module Documentation
compute various properties (consensus MFE structures, partition function, Boltzmann distributed stochastic sam-
ples, ...) for RNA sequence alignments
Partition Function
and Base Pair Probabilities
for Sequence Alignment(s)
Modules
Files
file alifold.h
Functions for comparative structure prediction using RNA sequence alignments.
Functions
float energy_of_alistruct (const char sequences, const char structure, int n_seq, float energy)
Calculate the free energy of a consensus structure given a set of aligned sequences.
int get_alipf_arrays (short S_p, short S5_p, short S3_p, unsigned short a2s_p, char Ss-
_p, FLT_OR_DBL qb_p, FLT_OR_DBL qm_p, FLT_OR_DBL q1k_p, FLT_OR_DBL qln_p, short
pscore)
Get pointers to (almost) all relavant arrays used in alifold's partition function computation.
void update_alifold_params (void)
Update the energy parameters for alifold function.
Generated by Doxygen
15.23 Comparative structure prediction 213
Variables
double cv_fact
This variable controls the weight of the covariance term in the energy function of alignment folding algorithms.
double nc_fact
This variable controls the magnitude of the penalty for non-compatible sequences in the covariance term of alignment
folding algorithms.
compute various properties (consensus MFE structures, partition function, Boltzmann distributed stochastic sam-
ples, ...) for RNA sequence alignments
Consensus structures can be predicted by a modified version of the fold() algorithm that takes a set of aligned
sequences instead of a single sequence. The energy function consists of the mean energy averaged over the
sequences, plus a covariance term that favors pairs with consistent and compensatory mutations and penalizes
pairs that cannot be formed by all structures. For details see [7] and [1].
15.23.2.1 float energy_of_alistruct ( const char sequences, const char structure, int n_seq, float energy )
#include <ViennaRNA/alifold.h>
Calculate the free energy of a consensus structure given a set of aligned sequences.
Generated by Doxygen
214 Module Documentation
Parameters
Returns
15.23.2.2 int get_alipf_arrays ( short S_p, short S5_p, short S3_p, unsigned short a2s_p, char Ss_p,
FLT_OR_DBL qb_p, FLT_OR_DBL qm_p, FLT_OR_DBL q1k_p, FLT_OR_DBL qln_p, short
pscore )
#include <ViennaRNA/alifold.h>
Get pointers to (almost) all relavant arrays used in alifold's partition function computation.
Note
See also
pf_alifold(), alipf_circ_fold()
Deprecated It is discouraged to use this function! The new vrna_fold_compound_t allows direct access to all
necessary consensus structure prediction related variables!
See also
Parameters
Returns
#include <ViennaRNA/alifold.h>
Call this to recalculate the pair matrix and energy parameters after a change in folding parameters like temperature
Deprecated Usage of this function is discouraged! The new API uses vrna_fold_compound_t to lump all folding
related necessities together, including the energy parameters. Use vrna_update_fold_params() to
update the energy parameters within a vrna_fold_compound_t.
#include <ViennaRNA/aln_util.h>
Parameters
alignment Aligned sequences
Returns
15.23.2.5 int get_mpi ( char Alseq[ ], int n_seq, int length, int mini )
#include <ViennaRNA/aln_util.h>
Parameters
Alseq
n_seq The number of sequences in the alignment
length The length of the alignment
mini
Generated by Doxygen
216 Module Documentation
Returns
15.23.2.6 void encode_ali_sequence ( const char sequence, short S, short s5, short s3, char ss, unsigned short
as, int circ )
#include <ViennaRNA/aln_util.h>
this function assumes that in S, S5, s3, ss and as enough space is already allocated (size must be at least sequence
length+2)
Parameters
15.23.2.7 void alloc_sequence_arrays ( const char sequences, short S, short S5, short S3, unsigned short
a2s, char Ss, int circ )
#include <ViennaRNA/aln_util.h>
Allocate memory for sequence array used to deal with aligned sequences.
Note that these arrays will also be initialized according to the sequence alignment given
See also
free_sequence_arrays()
Parameters
sequences The aligned sequences
S A pointer to the array of encoded sequences
S5 A pointer to the array that contains the next 5' nucleotide of a sequence position
S3 A pointer to the array that contains the next 3' nucleotide of a sequence position
a2s A pointer to the array that contains the alignment to sequence position mapping
Ss A pointer to the array that contains the ungapped sequence
circ assume the molecules to be circular instead of linear (circ=0)
Generated by Doxygen
15.23 Comparative structure prediction 217
15.23.2.8 void free_sequence_arrays ( unsigned int n_seq, short S, short S5, short S3, unsigned short
a2s, char Ss )
#include <ViennaRNA/aln_util.h>
Free the memory of the sequence arrays used to deal with aligned sequences.
See also
alloc_sequence_arrays()
Parameters
#include <ViennaRNA/alifold.h>
This variable controls the weight of the covariance term in the energy function of alignment folding algorithms.
Default is 1.
#include <ViennaRNA/alifold.h>
This variable controls the magnitude of the penalty for non-compatible sequences in the covariance term of align-
ment folding algorithms.
Default is 1.
Generated by Doxygen
218 Module Documentation
Comparative structure
prediction
MFE Consensus Structures
for Sequence Alignment(s)
Minimum Free Energy
(MFE) algorithms
Functions
#include <ViennaRNA/alifold.h>
Compute Minimum Free Energy (MFE), and a corresponding consensus secondary structure for an RNA sequence
alignment using a comparative method.
This simplified interface to vrna_mfe() computes the MFE and, if required, a consensus secondary structure for an
RNA sequence alignment using default options. Memory required for dynamic programming (DP) matrices will be
allocated and free'd on-the-fly. Hence, after return of this function, the recursively filled matrices are not available
any more for any post-processing, e.g. suboptimal backtracking, etc.
Generated by Doxygen
15.24 MFE Consensus Structures for Sequence Alignment(s) 219
Note
In case you want to use the filled DP matrices for any subsequent post-processing step, or you require other
conditions than specified by the default model details, use vrna_mfe(), and the data structure vrna_fold_-
compound_t instead.
See also
Parameters
sequences RNA sequence alignment
structure A pointer to the character array where the secondary structure in dot-bracket notation will be
written to
Returns
#include <ViennaRNA/alifold.h>
Compute Minimum Free Energy (MFE), and a corresponding consensus secondary structure for a sequence align-
ment of circular RNAs using a comparative method.
This simplified interface to vrna_mfe() computes the MFE and, if required, a consensus secondary structure for an
RNA sequence alignment using default options. Memory required for dynamic programming (DP) matrices will be
allocated and free'd on-the-fly. Hence, after return of this function, the recursively filled matrices are not available
any more for any post-processing, e.g. suboptimal backtracking, etc.
Folding of circular RNA sequences is handled as a post-processing step of the forward recursions. See [9] for
further details.
Note
In case you want to use the filled DP matrices for any subsequent post-processing step, or you require other
conditions than specified by the default model details, use vrna_mfe(), and the data structure vrna_fold_-
compound_t instead.
See also
Parameters
Generated by Doxygen
220 Module Documentation
Returns
#include <ViennaRNA/alifold.h>
This function predicts the consensus structure for the aligned 'sequences' and returns the minimum free energy; the
mfe structure in bracket notation is returned in 'structure'.
See also
vrna_alifold(), vrna_mfe()
Parameters
Returns
#include <ViennaRNA/alifold.h>
Compute MFE and according structure of an alignment of sequences assuming the sequences are circular instead
of linear.
Deprecated Usage of this function is discouraged! Use vrna_alicircfold(), and vrna_mfe() instead!
See also
Parameters
Returns
#include <ViennaRNA/alifold.h>
Deprecated Usage of this function is discouraged! It only affects memory being free'd that was allocated by an old
API function before. Release of memory occupied by the newly introduced vrna_fold_compound_t is
handled by vrna_vrna_fold_compound_free()
See also
vrna_vrna_fold_compound_free()
Generated by Doxygen
222 Module Documentation
15.25 Partition Function and Base Pair Probabilities for Sequence Alignment(s)
Collaboration diagram for Partition Function and Base Pair Probabilities for Sequence Alignment(s):
Comparative structure
prediction
Partition Function
and Base Pair Probabilities
for Sequence Alignment(s)
Partition function
and equilibrium properties
Functions
#include <ViennaRNA/alifold.h>
Compute Partition function Q (and base pair probabilities) for an RNA sequence alignment using a comparative
method.
This simplified interface to vrna_pf() computes the partition function and, if required, base pair probabilities for an
RNA sequence alignment using default options. Memory required for dynamic programming (DP) matrices will be
allocated and free'd on-the-fly. Hence, after return of this function, the recursively filled matrices are not available
any more for any post-processing.
Generated by Doxygen
15.25 Partition Function and Base Pair Probabilities for Sequence Alignment(s) 223
Note
In case you want to use the filled DP matrices for any subsequent post-processing step, or you require other
conditions than specified by the default model details, use vrna_pf(), and the data structure vrna_fold_-
compound_t instead.
See also
Parameters
sequences RNA sequence alignment
structure A pointer to the character array where position-wise pairing propensity will be stored. (Maybe NULL)
pl A pointer to a list of vrna_plist_t to store pairing probabilities (Maybe NULL)
Returns
#include <ViennaRNA/alifold.h>
Compute Partition function Q (and base pair probabilities) for an alignment of circular RNA sequences using a
comparative method.
This simplified interface to vrna_pf() computes the partition function and, if required, base pair probabilities for an
RNA sequence alignment using default options. Memory required for dynamic programming (DP) matrices will be
allocated and free'd on-the-fly. Hence, after return of this function, the recursively filled matrices are not available
any more for any post-processing.
Note
In case you want to use the filled DP matrices for any subsequent post-processing step, or you require other
conditions than specified by the default model details, use vrna_pf(), and the data structure vrna_fold_-
compound_t instead.
Folding of circular RNA sequences is handled as a post-processing step of the forward recursions. See [9] for
further details.
See also
Parameters
Generated by Doxygen
224 Module Documentation
Returns
15.25.2.3 float alipf_fold_par ( const char sequences, char structure, vrna_plist_t pl, vrna_exp_param_t
parameters, int calculate_bppm, int is_constrained, int is_circular )
#include <ViennaRNA/alifold.h>
Parameters
sequences
structure
pl
parameters
calculate_bppm
is_constrained
is_circular
Returns
#include <ViennaRNA/alifold.h>
The partition function version of alifold() works in analogy to pf_fold(). Pair probabilities and information about
sequence covariations are returned via the 'pi' variable as a list of vrna_pinfo_t structs. The list is terminated by the
first entry with pi.i = 0.
Parameters
sequences
structure
pl
Returns
Generated by Doxygen
15.25 Partition Function and Base Pair Probabilities for Sequence Alignment(s) 225
#include <ViennaRNA/alifold.h>
Parameters
sequences
structure
pl
Returns
#include <ViennaRNA/alifold.h>
Deprecated Usage of this function is discouraged! The new vrna_fold_compound_t allows direct access to the
folding matrices, including the pair probabilities! The pair probability array returned here reflects the
one of the latest call to vrna_pf(), or any of the old API calls for consensus structure partition function
folding.
See also
Returns
#include <ViennaRNA/alifold.h>
Free the memory occupied by folding matrices allocated by alipf_fold, alipf_circ_fold, etc.
Deprecated Usage of this function is discouraged! This function only free's memory allocated by old API function
calls. Memory allocated by any of the new API calls (starting with vrna_) will be not affected!
See also
vrna_fold_compound_t, vrna_vrna_fold_compound_free()
Generated by Doxygen
226 Module Documentation
Collaboration diagram for Stochastic Backtracking of Consensus Structures from Sequence Alignment(s):
Comparative structure
prediction
Stochastic Backtracking
of Consensus Structures
from Sequence Alignment(s)
Structure sampling
from the ensemble
Functions
#include <ViennaRNA/alifold.h>
Sample a consensus secondary structure from the Boltzmann ensemble according its probability.
Parameters
Returns
Generated by Doxygen
15.27 Classified Dynamic Programming variants 227
Modules
Generated by Doxygen
228 Module Documentation
Compute Thermodynamic properties for a Distance Class Partitioning of the Secondary Structure Space.
Collaboration diagram for Distance based partitioning of the Secondary Structure Space:
Stochastic Backtracking
of Structures from Distance
Based Partitioning
Calculate Partition
Classified Dynamic Distance based partitioning
Functions of a Distance
Programming variants of the Secondary Structure Space
Based Partitioning
Modules
Files
file 2Dfold.h
MFE structures for base pair distance classes.
file 2Dpfold.h
Partition function implementations for base pair distance classes.
Compute Thermodynamic properties for a Distance Class Partitioning of the Secondary Structure Space.
All functions related to this group implement the basic recursions for MFE folding, partition function computation and
stochastic backtracking with a classified dynamic programming approach. The secondary structure space is divided
into partitions according to the base pair distance to two given reference structures and all relevant properties are
calculated for each of the resulting partitions
See also
Generated by Doxygen
15.29 Calculating MFE representatives of a Distance Based Partitioning 229
Compute the minimum free energy (MFE) and secondary structures for a partitioning of the secondary structure
space according to the base pair distance to two fixed reference structures basepair distance to two fixed reference
structures.
Data Structures
struct vrna_sol_TwoD_t
Solution element returned from vrna_mfe_TwoD() More...
struct TwoDfold_vars
Variables compound for 2Dfold MFE folding. More...
Typedefs
Functions
Generated by Doxygen
230 Module Documentation
Compute the minimum free energy (MFE) and secondary structures for a partitioning of the secondary structure
space according to the base pair distance to two fixed reference structures basepair distance to two fixed reference
structures.
See also
This element contains free energy and structure for the appropriate kappa (k), lambda (l) neighborhood The datas-
tructure contains two integer attributes 'k' and 'l' as well as an attribute 'en' of type float representing the free energy
in kcal/mol and an attribute 's' of type char containg the secondary structure representative,
See also
vrna_mfe_TwoD()
Data Fields
int k
Distance to first reference.
int l
Distance to second reference.
float en
Free energy in kcal/mol.
char s
MFE representative structure in dot-bracket notation.
Deprecated This data structure will be removed from the library soon! Use vrna_fold_compound_t and the corre-
sponding functions vrna_fold_compound_TwoD(), vrna_mfe_TwoD(), and vrna_fold_compound_free()
instead!
Generated by Doxygen
15.29 Calculating MFE representatives of a Distance Based Partitioning 231
P
vrna_param_s params
model_details
TwoDfold_vars
vrna_md_s sc
model_details vrna_sc_s
scs
compatibility
vrna_exp_param_s
exp_params
vrna_structured_domains_s domains_struc
vrna_fc_s
hc
vrna_hc_s
domains_up
vrna_unstructured_domain_s matrices
vrna_mx_mfe_s aux_grammar
vrna_gr_aux_s
exp_matrices
vrna_mx_pf_s
Data Fields
vrna_param_t P
Precomputed energy parameters and model details.
int do_backtrack
Flag whether to do backtracing of the structure(s) or not.
char ptype
Precomputed array of pair types.
char sequence
The input sequence.
short S1
The input sequences in numeric form.
unsigned int maxD1
Maximum allowed base pair distance to first reference.
unsigned int maxD2
Maximum allowed base pair distance to second reference.
unsigned int mm1
Maximum matching matrix, reference struct 1 disallowed.
unsigned int mm2
Maximum matching matrix, reference struct 2 disallowed.
int my_iindx
Index for moving in quadratic distancy dimensions.
unsigned int referenceBPs1
Matrix containing number of basepairs of reference structure1 in interval [i,j].
unsigned int referenceBPs2
Matrix containing number of basepairs of reference structure2 in interval [i,j].
unsigned int bpdist
Matrix containing base pair distance of reference structure 1 and 2 on interval [i,j].
Generated by Doxygen
232 Module Documentation
#include <ViennaRNA/2Dfold.h>
This element contains free energy and structure for the appropriate kappa (k), lambda (l) neighborhood The datas-
tructure contains two integer attributes 'k' and 'l' as well as an attribute 'en' of type float representing the free energy
in kcal/mol and an attribute 's' of type char containg the secondary structure representative,
See also
vrna_mfe_TwoD()
#include <ViennaRNA/2Dfold.h>
Deprecated This data structure will be removed from the library soon! Use vrna_fold_compound_t and the corre-
sponding functions vrna_fold_compound_TwoD(), vrna_mfe_TwoD(), and vrna_fold_compound_free()
instead!
#include <ViennaRNA/2Dfold.h>
This function computes the minimum free energies and a representative secondary structure for each distance class
according to the two references specified in the datastructure 'vars'. The maximum basepair distance to each of
both references may be set by the arguments 'distance1' and 'distance2', respectively. If both distance arguments
are set to '-1', no restriction is assumed and the calculation is performed for each distance class possible.
The returned list contains an entry for each distance class. If a maximum basepair distance to either of the ref-
erences was passed, an entry with k=l=-1 will be appended in the list, denoting the class where all structures
exceeding the maximum will be thrown into. The end of the list is denoted by an attribute value of INF in the
k-attribute of the list entry.
See also
Generated by Doxygen
15.29 Calculating MFE representatives of a Distance Based Partitioning 233
Parameters
Returns
A list of minimum free energies (and corresponding structures) for each distance class
#include <ViennaRNA/2Dfold.h>
Backtrack a minimum free energy structure from a 5' section of specified length.
This function allows one to backtrack a secondary structure beginning at the 5' end, a specified length and residing in
a specific distance class. If the argument 'k' gets a value of -1, the structure that is backtracked is assumed to reside
in the distance class where all structures exceeding the maximum basepair distance specified in vrna_mfe_TwoD()
belong to.
Note
The argument 'vars' must contain precalculated energy values in the energy matrices, i.e. a call to vrna_-
mfe_TwoD() preceding this function is mandatory!
See also
vrna_mfe_TwoD()
Parameters
15.29.4.3 TwoDfold_vars get_TwoDfold_variables ( const char seq, const char structure1, const char structure2, int
circ )
#include <ViennaRNA/2Dfold.h>
This function returns a datastructure of type TwoDfold_vars. The data fields inside the TwoDfold_vars are prefilled
by global settings and all memory allocations necessary to start a computation are already done for the convenience
of the user
Generated by Doxygen
234 Module Documentation
Note
Make sure that the reference structures are compatible with the sequence according to Watson-Crick- and
Wobble-base pairing
Deprecated Use the new API that relies on vrna_fold_compound_t and the corresponding functions vrna_fold_-
compound_TwoD(), vrna_mfe_TwoD(), and vrna_fold_compound_free() instead!
Parameters
seq The RNA sequence
structure1 The first reference structure in dot-bracket notation
structure2 The second reference structure in dot-bracket notation
circ A switch to indicate the assumption to fold a circular instead of linear RNA (0=OFF, 1=ON)
Returns
#include <ViennaRNA/2Dfold.h>
This function free's all allocated memory that depends on the datastructure given.
Deprecated Use the new API that relies on vrna_fold_compound_t and the corresponding functions vrna_fold_-
compound_TwoD(), vrna_mfe_TwoD(), and vrna_fold_compound_free() instead!
Parameters
our_variables A pointer to the datastructure to be destroyed
#include <ViennaRNA/2Dfold.h>
This function computes the minimum free energies and a representative secondary structure for each distance class
according to the two references specified in the datastructure 'vars'. The maximum basepair distance to each of
both references may be set by the arguments 'distance1' and 'distance2', respectively. If both distance arguments
are set to '-1', no restriction is assumed and the calculation is performed for each distance class possible.
The returned list contains an entry for each distance class. If a maximum basepair distance to either of the ref-
erences was passed, an entry with k=l=-1 will be appended in the list, denoting the class where all structures
exceeding the maximum will be thrown into. The end of the list is denoted by an attribute value of INF in the
k-attribute of the list entry.
Generated by Doxygen
15.29 Calculating MFE representatives of a Distance Based Partitioning 235
Deprecated Use the new API that relies on vrna_fold_compound_t and the corresponding functions vrna_fold_-
compound_TwoD(), vrna_mfe_TwoD(), and vrna_fold_compound_free() instead!
Parameters
#include <ViennaRNA/2Dfold.h>
Backtrack a minimum free energy structure from a 5' section of specified length.
This function allows one to backtrack a secondary structure beginning at the 5' end, a specified length and residing
in a specific distance class. If the argument 'k' gets a value of -1, the structure that is backtracked is assumed to
reside in the distance class where all structures exceeding the maximum basepair distance specified in TwoDfold()
belong to.
Note
The argument 'vars' must contain precalculated energy values in the energy matrices, i.e. a call to TwoDfold()
preceding this function is mandatory!
Deprecated Use the new API that relies on vrna_fold_compound_t and the corresponding functions vrna_fold_-
compound_TwoD(), vrna_mfe_TwoD(), vrna_backtrack5_TwoD(), and vrna_fold_compound_free() in-
stead!
Parameters
Generated by Doxygen
236 Module Documentation
Compute the partition function and stochastically sample secondary structures for a partitioning of the secondary
structure space according to the base pair distance to two fixed reference structures.
Data Structures
struct vrna_sol_TwoD_pf_t
Solution element returned from vrna_pf_TwoD() More...
Typedefs
typedef struct vrna_sol_TwoD_pf_t vrna_sol_TwoD_pf_t
Solution element returned from vrna_pf_TwoD()
Functions
vrna_sol_TwoD_pf_t vrna_pf_TwoD (vrna_fold_compound_t vc, int maxDistance1, int maxDistance2)
Compute the partition function for all distance classes.
Compute the partition function and stochastically sample secondary structures for a partitioning of the secondary
structure space according to the base pair distance to two fixed reference structures.
This element contains the partition function for the appropriate kappa (k), lambda (l) neighborhood The datastructure
contains two integer attributes 'k' and 'l' as well as an attribute 'q' of type FLT_OR_DBL
See also
vrna_pf_TwoD()
Generated by Doxygen
15.30 Calculate Partition Functions of a Distance Based Partitioning 237
Data Fields
int k
Distance to first reference.
int l
Distance to second reference.
FLT_OR_DBL q
partition function
#include <ViennaRNA/2Dpfold.h>
This element contains the partition function for the appropriate kappa (k), lambda (l) neighborhood The datastructure
contains two integer attributes 'k' and 'l' as well as an attribute 'q' of type FLT_OR_DBL
See also
vrna_pf_TwoD()
#include <ViennaRNA/2Dpfold.h>
This function computes the partition functions for all distance classes according the two reference structures speci-
fied in the datastructure 'vars'. Similar to vrna_mfe_TwoD() the arguments maxDistance1 and maxDistance2 specify
the maximum distance to both reference structures. A value of '-1' in either of them makes the appropriate distance
restrictionless, i.e. all basepair distancies to the reference are taken into account during computation. In case there
is a restriction, the returned solution contains an entry where the attribute k=l=-1 contains the partition function for
all structures exceeding the restriction. A value of INF in the attribute 'k' of the returned list denotes the end of the
list
See also
Parameters
Generated by Doxygen
238 Module Documentation
Returns
Generated by Doxygen
15.31 Stochastic Backtracking of Structures from Distance Based Partitioning 239
Collaboration diagram for Stochastic Backtracking of Structures from Distance Based Partitioning:
Functions
#include <ViennaRNA/2Dpfold.h>
Sample secondary structure representatives from a set of distance classes according to their Boltzmann probability.
If the argument 'd1' is set to '-1', the structure will be backtracked in the distance class where all structures exceeding
the maximum basepair distance to either of the references reside.
Precondition
The argument 'vars' must contain precalculated partition function matrices, i.e. a call to vrna_pf_TwoD()
preceding this function is mandatory!
See also
vrna_pf_TwoD()
Generated by Doxygen
240 Module Documentation
Parameters
in,out vc The vrna_fold_compound_t datastructure containing all necessary folding attributes and matrices
in d1 The distance to reference1 (may be -1)
in d2 The distance to reference2
Returns
15.31.2.2 char vrna_pbacktrack5_TwoD ( vrna_fold_compound_t vc, int d1, int d2, unsigned int length )
#include <ViennaRNA/2Dpfold.h>
Sample secondary structure representatives with a specified length from a set of distance classes according to their
Boltzmann probability.
This function does essentially the same as vrna_pbacktrack_TwoD() with the only difference that partial structures,
i.e. structures beginning from the 5' end with a specified length of the sequence, are backtracked
Note
This function does not work (since it makes no sense) for circular RNA sequences!
Precondition
The argument 'vars' must contain precalculated partition function matrices, i.e. a call to vrna_pf_TwoD()
preceding this function is mandatory!
See also
vrna_pbacktrack_TwoD(), vrna_pf_TwoD()
Parameters
in,out vc The vrna_fold_compound_t datastructure containing all necessary folding attributes and
matrices
in d1 The distance to reference1 (may be -1)
in d2 The distance to reference2
in length The length of the structure beginning from the 5' end
Returns
Generated by Doxygen
15.32 Compute the Density of States 241
Variables
#include <ViennaRNA/subopt.h>
This array contains the density of states for an RNA sequences after a call to subopt_par(), subopt() or subopt_circ().
Precondition
Call one of the functions subopt_par(), subopt() or subopt_circ() prior accessing the contents of this array
See also
Generated by Doxygen
242 Module Documentation
Files
file inverse.h
Inverse folding routines.
Functions
Variables
char symbolset
This global variable points to the allowed bases, initially "AUGC". It can be used to design sequences from reduced
alphabets.
float final_cost
int give_up
int inv_verbose
#include <ViennaRNA/inverse.h>
This function searches for a sequence with minimum free energy structure provided in the parameter 'target', starting
with sequence 'start'. It returns 0 if the search was successful, otherwise a structure distance in terms of the energy
difference between the search result and the actual target 'target' is returned. The found sequence is returned in
'start'. If give_up is set to 1, the function will return as soon as it is clear that the search will be unsuccessful, this
speeds up the algorithm if you are only interested in exact solutions.
Parameters
start The start sequence
target The target secondary structure in dot-bracket notation
Generated by Doxygen
15.33 Inverse Folding (Design) 243
Returns
#include <ViennaRNA/inverse.h>
This function searches for a sequence with maximum probability to fold into the provided structure 'target' using the
partition function algorithm. It returns kT log(p) where p is the frequency of 'target' in the ensemble of possible
structures. This is usually much slower than inverse_fold().
Parameters
start The start sequence
target The target secondary structure in dot-bracket notation
Returns
#include <ViennaRNA/inverse.h>
#include <ViennaRNA/inverse.h>
default 0: try to minimize structure distance even if no exact solution can be found
#include <ViennaRNA/inverse.h>
Generated by Doxygen
244 Module Documentation
Different functions to generate structural neighbors of a secondary structure according to a particular Move Set.
Collaboration diagram for Neighborhood relation and move sets for secondary structures:
Neighborhood relation
The RNA secondary structure
and move sets for secondary
landscape
structures
Files
file neighbor.h
Methods to compute the neighbors of an RNA secondary structure.
Data Structures
struct vrna_move_s
An atomic representation of the transition / move from one structure to its neighbor. More...
Macros
#define VRNA_MOVESET_INSERTION 4
Option flag indicating insertion move.
#define VRNA_MOVESET_DELETION 8
Option flag indicating deletion move.
#define VRNA_MOVESET_SHIFT 16
Option flag indicating shift move.
#define VRNA_MOVESET_DEFAULT (VRNA_MOVESET_INSERTION | VRNA_MOVESET_DELETION)
Option flag indicating default move set, i.e. insertions/deletion of a base pair.
Functions
Generated by Doxygen
15.34 Neighborhood relation and move sets for secondary structures 245
Different functions to generate structural neighbors of a secondary structure according to a particular Move Set.
This module contains methods to compute the neighbors of an RNA secondary structure. Neighbors of a given
structure are all structures that differ in exactly one base pair. That means one can insert an delete base pairs in
the given structure. These insertions and deletions of base pairs are usually called moves. A third move which
is considered in these methods is a shift move. A shifted base pair has one stable position and one position that
changes. These moves are encoded as follows:
Example:
We have given a sequence and a structure.
Sequence AAGGAAACC
Structure ..(.....)
Indices 123456789
The given base pair is (3,9) and the neighbors are the insertion (4, 8), the deletion (-3,-9), the
shift (3,-8)
and the shift (-4, 9).
This leads to the neighbored structures:
...(....)
.........
...(...).
....(...)
A simple method to construct all insertions is to iterate over the positions of a sequence twice. The first iteration has
the index i in [1, sequence length], the second iteration has the index j in [i+1, sequence length]. All pairs (i,j) with
compatible letters and which are non-crossing with present base pairs are valid neighbored insertion moves. Valid
deletion moves are all present base pairs with negative sign. Valid shift moves are constructed by taking all paired
positions as fix position of a shift move and iterating over all positions of the sequence. If the letters of a position
are compatible and if it the move is non-crossing with existing base pairs, we have a valid shift move. The method
of generating shift moves can be accelerated by skipping neighbored base pairs.
If we need to construct all neighbors several times for subsequent moves, we can speed up the task by using the
move set of the previous structure. The previous move set has to be filtered, such that all moves that would cross
the next selected move are non-crossing. Next, the selected move has to be removed. Then one has to only to
generate all moves that were not possible before. One move is the inverted selected move (if it was an insertion,
simply make the indices negative). The generation of all other new moves is different and depends on the selected
move. It is easy for an insertion move, because we have only to include all non-crossing shift moves, that are
possible with the new base pair. For that we can either iterate over the sequence or we can select all crossing shift
moves in the filter procedure and convert them into shifts.
The generation of new moves given a deletion is a little bit more complex, because we can create more moves. At
first we can insert the deleted pair as insertion move. Then we generate all insertions that would have crossed the
deleted base pair. Finally we construct all crossing shift moves.
If the given move is a shift, we can save much time by specifying the intervals for the generation of new moves. The
interval which was enclosed by the positive position of the shift move and the previous paired position is the freed
interval after applying the move. This freed interval includes all positions and base pairs that we need to construct
new insertions and shifts. All these new moves have one position in the freed interval and the other position in the
environment of the freed interval. The environment are all position which are outside the freed interval, but within
the same enclosing loop of the shift move. The environment for valid base pairs can be divided into one or more
intervals, depending on the shift move. The following examples describe a few scenarios to specify the intervals of
the environment.
Generated by Doxygen
246 Module Documentation
increase interval
x xx
A A A A G A C A A G A A A C A A A A G A G A A A C A A C A A A C A
xx x x xx
A G A A A C A A A C A A A A A A A A C A A A C A A A G A A C A A A C A A C A A A G A G A A
xx x
A A C A A A G A A C A G A A A A
decrease interval
xA A A A G A C A A G A A A C A A A A G A G
x
A A A C A A C A A A C A A G A A A C A A A C
x x
A A A A A A A A C A A A C A A A G A A C A A A C A A
x
C A A A G A G A A A A C A A A G A A C A G
x
A A A A
switch interval
x x
A A A A G A C A A G A A A C A A A A G A G A A A C A A C A A A C A A G A A A C A A A C
x x
A A A A A A A A C A A A C A A A G A A C A A A C A A C A A A G A G A A A A
x x C A A A G A A C A G A A A A
freed interval
environment for new non-crossing moves
x intervals that would produce crossing pairs
new shift moves from pairs in one interval to positions in the other interval
points to the new position of the shift move
Given the intervals of the environment and the freed interval, the new shift moves can be constructed quickly. One
has to take all positions of pairs from the environment in order to create valid pairs with positions in the freed interval.
The same procedure can be applied for the other direction. This is taking all paired positions within the freed interval
in order to look for pairs with valid positions in the intervals of the environment.
An atomic representation of the transition / move from one structure to its neighbor.
An atomic transition / move may be (a) the insertion of a base pair (both fields are positive), (b) the deletion of a
base pair (both fields are negative), or (c) a base pair shift where one position stays constant while the other is
allowed to shift along the same loop it resides in (one field position and the other negative, where the positive field
indicates the constant position and the absolute value of the negative field is the new position of the pairing partner).
A value of 0 is either field is typically used to indicate the lists last element.
Data Fields
int pos_5
int pos_3
Generated by Doxygen
15.34 Neighborhood relation and move sets for secondary structures 247
#include <ViennaRNA/neighbor.h>
See also
#include <ViennaRNA/neighbor.h>
See also
#include <ViennaRNA/neighbor.h>
See also
#include <ViennaRNA/neighbor.h>
Option flag indicating default move set, i.e. insertions/deletion of a base pair.
See also
#include <ViennaRNA/neighbor.h>
Generated by Doxygen
248 Module Documentation
Parameters
15.34.4.2 void vrna_loopidx_update ( int loopidx, const short pt, int length, const vrna_move_t m )
#include <ViennaRNA/neighbor.h>
The loopIndex of the current move will be inserted. The correctness of the input will not be checked because the
speed should be optimized.
Parameters
in,out loopidx The loop index data structure that needs an update
in pt A pair table on which the move will be executed
length The length of the structure
in m The move that is applied to the current structure
15.34.4.3 vrna_move_t vrna_neighbors ( vrna_fold_compound_t vc, const short pt, unsigned int options )
#include <ViennaRNA/neighbor.h>
This function allows one to generate all structural neighbors (according to a particular move set) of an RNA sec-
ondary structure. The neighborhood is then returned as a list of transitions / moves required to transform the current
structure into the actual neighbor.
See also
Parameters
Returns
Neighbors as a list of moves / transitions (the last element in the list has both of its fields set to 0)
Generated by Doxygen
15.34 Neighborhood relation and move sets for secondary structures 249
#include <ViennaRNA/neighbor.h>
This function implements a fast way to generate all neighbors of a secondary structure that results from successive
applications of individual moves. The speed-up results from updating an already known list of valid neighbors before
the individual move towards the current structure took place. In essence, this function removes neighbors that are
not accessible anymore and inserts neighbors emerging after a move took place.
See also
Parameters
Returns
Neighbors as a list of moves / transitions (the last element in the list has both of its fields set to 0)
Generated by Doxygen
250 Module Documentation
Modules
Files
file findpath.h
A breadth-first search heuristic for optimal direct folding paths.
file walk.h
Methods to generate particular paths such as gradient or random walks through the energy landscape of an RNA
sequence.
Macros
Functions
vrna_move_t vrna_path (vrna_fold_compound_t vc, short pt, unsigned int steps, unsigned int options)
Compute a path, store the final structure, and return a list of transition moves from the start to the final structure.
vrna_move_t vrna_path_gradient (vrna_fold_compound_t vc, short pt, unsigned int options)
Compute a steepest descent / gradient path, store the final structure, and return a list of transition moves from the
start to the final structure.
vrna_move_t vrna_path_random (vrna_fold_compound_t vc, short pt, unsigned int steps, unsigned int
options)
Generate a random walk / path of a given length, store the final structure, and return a list of transition moves from
the start to the final structure.
Generated by Doxygen
15.35 Refolding paths of secondary structures 251
#include <ViennaRNA/walk.h>
See also
vrna_path()
#include <ViennaRNA/walk.h>
See also
vrna_path()
#include <ViennaRNA/walk.h>
See also
#include <ViennaRNA/walk.h>
See also
Generated by Doxygen
252 Module Documentation
15.35.3.1 vrna_move_t vrna_path ( vrna_fold_compound_t vc, short pt, unsigned int steps, unsigned int options
)
#include <ViennaRNA/walk.h>
Compute a path, store the final structure, and return a list of transition moves from the start to the final structure.
This function computes, given a start structure in pair table format, a transition path, updates the pair table to the
final structure of the path. Finally, if not requested otherwise by using the VRNA_PATH_NO_TRANSITION_OUT-
PUT flag in the options field, this function returns a list of individual transitions that lead from the start to the final
structure if requested.
Note
Since the result is written to the input structure you may want to use vrna_ptable_copy() before calling this
function to keep the initial structure
See also
Parameters
Returns
15.35.3.2 vrna_move_t vrna_path_gradient ( vrna_fold_compound_t vc, short pt, unsigned int options )
#include <ViennaRNA/walk.h>
Compute a steepest descent / gradient path, store the final structure, and return a list of transition moves from the
start to the final structure.
Generated by Doxygen
15.35 Refolding paths of secondary structures 253
This function computes, given a start structure in pair table format, a steepest descent path, updates the pair table
to the final structure of the path. Finally, if not requested otherwise by using the VRNA_PATH_NO_TRANSITIO-
N_OUTPUT flag in the options field, this function returns a list of individual transitions that lead from the start to
the final structure if requested.
Note
Since the result is written to the input structure you may want to use vrna_ptable_copy() before calling this
function to keep the initial structure
See also
Parameters
Returns
15.35.3.3 vrna_move_t vrna_path_random ( vrna_fold_compound_t vc, short pt, unsigned int steps, unsigned int
options )
#include <ViennaRNA/walk.h>
Generate a random walk / path of a given length, store the final structure, and return a list of transition moves from
the start to the final structure.
This function generates, given a start structure in pair table format, a random walk / path, updates the pair table to
the final structure of the path. Finally, if not requested otherwise by using the VRNA_PATH_NO_TRANSITION_-
OUTPUT flag in the options field, this function returns a list of individual transitions that lead from the start to the
final structure if requested.
Note
Since the result is written to the input structure you may want to use vrna_ptable_copy() before calling this
function to keep the initial structure
See also
Generated by Doxygen
254 Module Documentation
Parameters
Returns
Generated by Doxygen
15.36 Experimental structure probing data 255
Modules
Generated by Doxygen
256 Module Documentation
Incorporate SHAPE reactivity structure probing data into the folding recursions by means of soft constraints.
Experimental structure
SHAPE reactivity data
probing data
Files
file constraints_SHAPE.h
This module provides function to incorporate SHAPE reactivity data into the folding recursions by means of soft
constraints.
Functions
Incorporate SHAPE reactivity structure probing data into the folding recursions by means of soft constraints.
Details for our implementation to incorporate SHAPE reactivity data to guide secondary structure prediction can be
found in [13]
Generated by Doxygen
15.37 SHAPE reactivity data 257
15.37.2.1 int vrna_sc_add_SHAPE_deigan ( vrna_fold_compound_t vc, const double reactivities, double m, double b,
unsigned int options )
#include <ViennaRNA/constraints_SHAPE.h>
This approach of SHAPE directed RNA folding uses the simple linear ansatz
to convert SHAPE reactivity values to pseudo energies whenever a nucleotide i contributes to a stacked pair. A
positive slope m penalizes high reactivities in paired regions, while a negative intercept b results in a confirmatory
bonus'' free energy for correctly predicted base pairs. Since the energy evaluation of a base pair stack involves two
pairs, the pseudo energies are added for all four contributing nucleotides. Consequently, the energy term is applied
twice for pairs inside a helix and only once for pairs adjacent to other structures. For all other loop types the energy
model remains unchanged even when the experimental data highly disagrees with a certain motif.
See also
Parameters
Returns
SWIG Wrapper Notes This function is attached as method sc_add_SHAPE_deigan() to objects of type fold_-
compound
15.37.2.2 int vrna_sc_add_SHAPE_deigan_ali ( vrna_fold_compound_t vc, const char shape_files, const int
shape_file_association, double m, double b, unsigned int options )
#include <ViennaRNA/constraints_SHAPE.h>
Add SHAPE reactivity data from files as soft constraints for consensus structure prediction (Deigan et al. method)
Parameters
Returns
SWIG Wrapper Notes This function is attached as method sc_add_SHAPE_deigan_ali() to objects of type fold-
_compound
#include <ViennaRNA/constraints_SHAPE.h>
This method first converts the observed SHAPE reactivity of nucleotide i into a probability qi that position i is
unpaired by means of a non-linear map. Then pseudo-energies of the form
are computed, where xi = 0 if position i is unpaired and xi = 1 if i is paired in a given secondary structure.
The parameter serves as scaling factor. The magnitude of discrepancy between prediction and experimental
observation is represented by |xi qi |.
See also
Parameters
Returns
SWIG Wrapper Notes This function is attached as method sc_add_SHAPE_zarringhalam() to objects of type
fold_compound
15.37.2.4 int vrna_sc_SHAPE_to_pr ( const char shape_conversion, double values, int length, double default_value )
#include <ViennaRNA/constraints_SHAPE.h>
Convert SHAPE reactivity values to probabilities for being unpaired.
This function parses the informations from a given file and stores the result in the preallocated string sequence and
the FLT_OR_DBL array values.
Generated by Doxygen
15.37 SHAPE reactivity data 259
See also
vrna_file_SHAPE_read()
Parameters
shape_conversion String definining the method used for the conversion process
values Pointer to an array of SHAPE reactivities
length Length of the array of SHAPE reactivities
default_value Result used for position with invalid/missing reactivity values
Generated by Doxygen
260 Module Documentation
Find a vector of perturbation energies that minimizes the discripancies between predicted and observed pairing
probabilities and the amount of neccessary adjustments.
Files
file perturbation_fold.h
Find a vector of perturbation energies that minimizes the discripancies between predicted and observed pairing
probabilities and the amount of neccessary adjustments.
Macros
#define VRNA_OBJECTIVE_FUNCTION_QUADRATIC 0
Use the sum of squared aberrations as objective function.
#define VRNA_OBJECTIVE_FUNCTION_ABSOLUTE 1
Use the sum of absolute aberrations as objective function.
#define VRNA_MINIMIZER_DEFAULT 0
Use a custom implementation of the gradient descent algorithm to minimize the objective function.
#define VRNA_MINIMIZER_CONJUGATE_FR 1
Use the GNU Scientific Library implementation of the Fletcher-Reeves conjugate gradient algorithm to minimize the
objective function.
#define VRNA_MINIMIZER_CONJUGATE_PR 2
Use the GNU Scientific Library implementation of the Polak-Ribiere conjugate gradient algorithm to minimize the
objective function.
#define VRNA_MINIMIZER_VECTOR_BFGS 3
Use the GNU Scientific Library implementation of the vector Broyden-Fletcher-Goldfarb-Shanno algorithm to minimize
the objective function.
#define VRNA_MINIMIZER_VECTOR_BFGS2 4
Use the GNU Scientific Library implementation of the vector Broyden-Fletcher-Goldfarb-Shanno algorithm to minimize
the objective function.
#define VRNA_MINIMIZER_STEEPEST_DESCENT 5
Use the GNU Scientific Library implementation of the steepest descent algorithm to minimize the objective function.
Typedefs
Generated by Doxygen
15.38 Generate soft constraints from data 261
Functions
Find a vector of perturbation energies that minimizes the discripancies between predicted and observed pairing
probabilities and the amount of neccessary adjustments.
#include <ViennaRNA/perturbation_fold.h>
Pn 2i Pn )qi )2
(pi (~
F (~) = i=1 2 + i=1 2 min
#include <ViennaRNA/perturbation_fold.h>
#include <ViennaRNA/perturbation_fold.h>
Use the GNU Scientific Library implementation of the Fletcher-Reeves conjugate gradient algorithm to minimize the
objective function.
Please note that this algorithm can only be used when the GNU Scientific Library is available on your system
#include <ViennaRNA/perturbation_fold.h>
Use the GNU Scientific Library implementation of the Polak-Ribiere conjugate gradient algorithm to minimize the
objective function.
Please note that this algorithm can only be used when the GNU Scientific Library is available on your system
Generated by Doxygen
262 Module Documentation
#include <ViennaRNA/perturbation_fold.h>
Use the GNU Scientific Library implementation of the vector Broyden-Fletcher-Goldfarb-Shanno algorithm to mini-
mize the objective function.
Please note that this algorithm can only be used when the GNU Scientific Library is available on your system
#include <ViennaRNA/perturbation_fold.h>
Use the GNU Scientific Library implementation of the vector Broyden-Fletcher-Goldfarb-Shanno algorithm to mini-
mize the objective function.
Please note that this algorithm can only be used when the GNU Scientific Library is available on your system
#include <ViennaRNA/perturbation_fold.h>
Use the GNU Scientific Library implementation of the steepest descent algorithm to minimize the objective function.
Please note that this algorithm can only be used when the GNU Scientific Library is available on your system
15.38.3.1 typedef void( progress_callback) (int iteration, double score, double epsilon)
#include <ViennaRNA/perturbation_fold.h>
Parameters
#include <ViennaRNA/perturbation_fold.h>
Generated by Doxygen
15.38 Generate soft constraints from data 263
Find a vector of perturbation energies that minimizes the discripancies between predicted and observed pairing
probabilities and the amount of neccessary adjustments.
Use an iterative minimization algorithm to find a vector of perturbation energies whose incorporation as soft con-
straints shifts the predicted pairing probabilities closer to the experimentally observed probabilities. The algorithm
aims to minimize an objective function that penalizes discripancies between predicted and observed pairing proba-
bilities and energy model adjustments, i.e. an appropriate vector of perturbation energies satisfies
X 2 X n
(pi (~) qi )2
F (~) = 2
+ min .
i=1
2
An initialized fold compound and an array containing the observed probability for each nucleotide to be unbound
are required as input data. The parameters objective_function, sigma_squared and tau_squared are responsible
for adjusting the aim of the objective function. Dependend on which type of objective function is selected, either
squared or absolute aberrations are contributing to the objective function. The ratio of the parameters sigma_-
squared and tau_squared can be used to adjust the algorithm to find a solution either close to the thermodynamic
prediction (sigma_squared >> tau_squared) or close to the experimental data (tau_squared >> sigma_squared).
The minimization can be performed by makeing use of a custom gradient descent implementation or using one
of the minimizing algorithms provided by the GNU Scientific Library. All algorithms require the evaluation of the
gradient of the objective function, which includes the evaluation of conditional pairing probabilites. Since an exact
evaluation is expensive, the probabilities can also be estimated from sampling by setting an appropriate sample
size. The found vector of perturbation energies will be stored in the array epsilon. The progress of the minimization
process can be tracked by implementing and passing a callback function.
See also
Parameters
Generated by Doxygen
264 Module Documentation
Incorporating ligands
binding to specific
sequence/structure motifs
using soft constraints
Ligands binding to
RNA structures
Ligands binding to
unstructured domains
Modules
Files
file constraints_ligand.h
Functions for incorporation of ligands binding to hairpin and interior loop motifs using the soft constraints framework.
Generated by Doxygen
15.40 Ligands binding to unstructured domains 265
Add ligand binding to loop regions using the Unstructured domains feature.
Add ligand binding to loop regions using the Unstructured domains feature.
Sometime, certain ligands, like single strand binding (SSB) proteins, compete with intramolecular base pairing of
the RNA. In situations, where the dissociation constant of the ligand is known and the ligand binds to a consecutive
stretch of single-stranded nucleotides we can use the Unstructured domains functionality to extend the RNA folding
grammar. This module provides a convenience default implementation that covers most of the application scenarios.
The function vrna_ud_add_motif() attaches a ligands sequence motif and corresponding binding free energy to the
list of known ligand motifs within a vrna_fold_compound_t.domains_up attribute. The first call to this function ini-
tializes the Unstructured domains feature with our default implementation. Subsequent calls of secondary structure
predciction algorithms with the modified vrna_fold_compound_t then directly include the competition of the ligand
with regules base pairing. Since we utilize the unstructured domain extension, The ligand binding model can be
removed again using the vrna_ud_remove() function.
Generated by Doxygen
266 Module Documentation
15.41 Incorporating ligands binding to specific sequence/structure motifs using soft con-
straints
Ligand binding to specific hairpin/interior loop like motifs using the Soft constraints feature.
Collaboration diagram for Incorporating ligands binding to specific sequence/structure motifs using soft constraints:
Incorporating ligands
Ligands binding to binding to specific
RNA structures sequence/structure motifs
using soft constraints
Functions
int vrna_sc_add_hi_motif (vrna_fold_compound_t vc, const char seq, const char structure, FLT_OR_DBL
energy, unsigned int options)
Ligand binding to specific hairpin/interior loop like motifs using the Soft constraints feature.
Here is an example that adds a theophylline binding motif. Free energy contribution is derived from kd =
0.32mol/l, taken from Jenison et al. 1994
Generated by Doxygen
15.41 Incorporating ligands binding to specific sequence/structure motifs using soft constraints 267
vrna_sc_add_hi_motif( vc,
"GAUACCAG&CCCUUGGCAGC",
"(...((((&)...)))...)",
-9.22, VRNA_OPTION_DEFAULT);
15.41.2.1 int vrna_sc_add_hi_motif ( vrna_fold_compound_t vc, const char seq, const char structure,
FLT_OR_DBL energy, unsigned int options )
#include <ViennaRNA/constraints_ligand.h>
Parameters
Generated by Doxygen
268 Module Documentation
Returns
non-zero value if application of the motif using soft constraints was successful
SWIG Wrapper Notes This function is attached as method sc_add_hi_motif() to objects of type fold_compound
Generated by Doxygen
15.42 Complex structured modules 269
Complex structured
G-quadruplexes
modules
Modules
G-quadruplexes
Various functions related to G-quadruplex computations.
Files
file gquad.h
G-quadruplexes.
Generated by Doxygen
270 Module Documentation
15.43 G-quadruplexes
Complex structured
G-quadruplexes
modules
Functions
#include <ViennaRNA/gquad.h>
Get a triangular matrix prefilled with minimum free energy contributions of G-quadruplexes.
At each position ij in the matrix, the minimum free energy of any G-quadruplex delimited by i and j is stored. If
no G-quadruplex formation is possible, the matrix element is set to INF. Access the elements in the matrix via
matrix[indx[j]+i]. To get the integer array indx see get_jindx().
See also
get_jindx(), encode_sequence()
Generated by Doxygen
15.43 G-quadruplexes 271
Parameters
Returns
#include <ViennaRNA/gquad.h>
given a dot-bracket structure (possibly) containing gquads encoded by '+' signs, find first gquad, return end position
or 0 if none found Upon return L and l[] contain the number of stacked layers, as well as the lengths of the linker
regions. To parse a string with many gquads, call parse_gquad repeatedly e.g. end1 = parse_gquad(struc, &L, l); ...
; end2 = parse_gquad(struc+end1, &L, l); end2+=end1; ... ; end3 = parse_gquad(struc+end2, &L, l); end3+=end2;
... ;
15.43.2.3 PRIVATE int backtrack_GQuad_IntLoop ( int c, int i, int j, int type, short S, int ggg, int index, int p, int q,
vrna_param_t P )
#include <ViennaRNA/gquad.h>
backtrack an interior loop like enclosed g-quadruplex with closing pair (i,j)
Parameters
c The total contribution the loop should resemble
i position i of enclosing pair
j position j of enclosing pair
type base pair type of enclosing pair (must be reverse type)
S integer encoded sequence
ggg triangular matrix containing g-quadruplex contributions
index the index for accessing the triangular matrix
p here the 5' position of the gquad is stored
q here the 3' position of the gquad is stored
P the datastructure containing the precalculated contibutions
Returns
15.43.2.4 PRIVATE int backtrack_GQuad_IntLoop_L ( int c, int i, int j, int type, short S, int ggg, int maxdist, int p, int
q, vrna_param_t P )
#include <ViennaRNA/gquad.h>
backtrack an interior loop like enclosed g-quadruplex with closing pair (i,j) with underlying Lfold matrix
Generated by Doxygen
272 Module Documentation
Parameters
c The total contribution the loop should resemble
i position i of enclosing pair
j position j of enclosing pair
type base pair type of enclosing pair (must be reverse type)
S integer encoded sequence
ggg triangular matrix containing g-quadruplex contributions
p here the 5' position of the gquad is stored
q here the 3' position of the gquad is stored
P the datastructure containing the precalculated contibutions
Returns
Generated by Doxygen
15.44 Data Structures and Preprocessor Macros 273
All datastructures and typedefs shared among the Vienna RNA Package can be found here.
Modules
Files
file data_structures.h
Various data structures and pre-processor macros.
file dp_matrices.h
Functions to deal with standard dynamic programming (DP) matrices.
Data Structures
struct vrna_basepair_s
Base pair data structure used in subopt.c. More...
struct vrna_plist_s
this datastructure is used as input parameter in functions of PS_dot.h and others More...
struct vrna_cpair_s
this datastructure is used as input parameter in functions of PS_dot.c More...
struct vrna_color_s
struct vrna_data_linear_s
struct vrna_sect_s
Stack of partial structures for backtracking. More...
struct vrna_bp_stack_s
Base pair stack element. More...
struct pu_contrib
Generated by Doxygen
274 Module Documentation
Typedefs
typedef struct vrna_basepair_s vrna_basepair_t
Typename for the base pair repesenting data structure vrna_basepair_s.
typedef struct vrna_plist_s vrna_plist_t
Typename for the base pair list repesenting data structure vrna_plist_s.
typedef struct vrna_bp_stack_s vrna_bp_stack_t
Typename for the base pair stack repesenting data structure vrna_bp_stack_s.
typedef struct vrna_cpair_s vrna_cpair_t
Typename for data structure vrna_cpair_s.
typedef struct vrna_sect_s vrna_sect_t
Typename for stack of partial structures vrna_sect_s.
typedef double FLT_OR_DBL
Typename for floating point number in partition function computations.
typedef struct vrna_basepair_s PAIR
Old typename of vrna_basepair_s.
typedef struct vrna_plist_s plist
Old typename of vrna_plist_s.
typedef struct vrna_cpair_s cpair
Old typename of vrna_cpair_s.
typedef struct vrna_sect_s sect
Old typename of vrna_sect_s.
typedef struct vrna_bp_stack_s bondT
Old typename of vrna_bp_stack_s.
typedef struct pu_contrib pu_contrib
contributions to p_u
typedef struct interact interact
interaction data structure for RNAup
typedef struct pu_out pu_out
Collection of all free_energy of beeing unpaired values for output.
typedef struct constrain constrain
constraints for cofolding
typedef struct node folden
Data structure for RNAsnoop (fold energy list)
typedef struct dupVar dupVar
Data structure used in RNApkplex.
Generated by Doxygen
15.44 Data Structures and Preprocessor Macros 275
Functions
All datastructures and typedefs shared among the Vienna RNA Package can be found here.
vrna_color_s
color
vrna_data_linear_s
Generated by Doxygen
276 Module Documentation
contributions to p_u
Data Fields
double H
hairpin loops
double I
interior loops
double M
multi loops
double E
exterior loop
int length
length of the input sequence
int w
longest unpaired region
Data Fields
double Pi
probabilities of interaction
double Gi
free energies of interaction
double Gikjl
full free energy for interaction between [k,i] k<i in longer seq and [j,l] j<l in shorter seq
double Gikjl_wo
Gikjl without contributions for prob_unpaired.
int i
k<i in longer seq
int k
k<i in longer seq
int j
j<l in shorter seq
int l
j<l in shorter seq
int length
length of longer sequence
Generated by Doxygen
15.44 Data Structures and Preprocessor Macros 277
Data Fields
int len
sequence length
int u_vals
number of different -u values
int contribs
[-c "SHIME"]
char header
header line
double u_values
(the -u values [-c "SHIME"]) seq len
node next
Generated by Doxygen
278 Module Documentation
#include <ViennaRNA/data_structures.h>
#include <ViennaRNA/data_structures.h>
#include <ViennaRNA/data_structures.h>
#include <ViennaRNA/data_structures.h>
Generated by Doxygen
15.44 Data Structures and Preprocessor Macros 279
#include <ViennaRNA/data_structures.h>
#include <ViennaRNA/data_structures.h>
Dummy symbol to check whether the library was build using C11/C++11 features.
By default, several data structures of our new v3.0 API use C11/C++11 features, such as unnamed unions, unnamed
structs. However, these features can be deactivated at compile time to allow building the library and executables
with compilers that do not support these features.
Now, the problem arises that once our static library is compiled and a third-party application is supposed to link
against it, it needs to know, at compile time, how to correctly address particular data structures. This is usually
implicitely taken care of through the API exposed in our header files. Unfortunately, we had some preprocessor
directives in our header files that changed the API depending on the capabilities of the compiler the third-party
application is build with. This in turn prohibited the use of an RNAlib compiled without C11/C++11 support in a
program that compiles/links with enabled C11/C++11 support and vice-versa.
Therefore, we introduce this dummy symbol which can be used to check, whether the static library was build with
C11/C++11 features.
Note
If the symbol is present, the library was build with enabled C11/C++11 features support and no action is
required. However, if the symbol is missing in RNAlib >= 2.2.9, programs that link to RNAlib must define a
pre-processor identifier VRNA_DISABLE_C11_FEATURES before including any ViennaRNA Package header
file, for instance by adding a CPPFLAG
00001 CPPFLAGS+=-DVRNA_DISABLE_C11_FEATURES
Since
v2.2.9
Generated by Doxygen
280 Module Documentation
15.45 Utilities
Parsing, converting,
comparing secondary
structures
Functions to convert
between various units
Parsing, converting,
and comparing sequences
Utilities
Functions for Creating
RNA Secondary Structures
Plots, Dot-Plots, and More
Functions to Read/Write
several File Formats
for RNA Sequences, Structures,
and Alignments
Modules
Files
file aln_util.h
Various utility- and helper-functions for sequence alignments and comparative structure prediction.
Generated by Doxygen
15.45 Utilities 281
file alphabet.h
Functions to process, convert, and generally handle different nucleotide and/or base pair alphabets.
file combinatorics.h
Various implementations that deal with combinatorial aspects of RNA/DNA folding.
file string_utils.h
General utility- and helper-functions for RNA sequence and structure strings used throughout the ViennaRNA Pack-
age.
file structure_utils.h
Various utility- and helper-functions for secondary structure parsing, converting, etc.
file utils.h
General utility- and helper-functions used throughout the ViennaRNA Package.
Generated by Doxygen
282 Module Documentation
Get a timestamp.
unsigned int get_input_line (char string, unsigned int options)
void vrna_message_input_seq_simple (void)
Print a line to stdout that asks for an input sequence.
void vrna_message_input_seq (const char s)
Print a line with a user defined string and a ruler to stdout.
int vrna_idx_row_wise (unsigned int length)
Get an index mapper array (iindx) for accessing the energy matrices, e.g. in partition function related functions.
int vrna_idx_col_wise (unsigned int length)
Get an index mapper array (indx) for accessing the energy matrices, e.g. in MFE related functions.
#define VRNA_INPUT_ERROR 1U
Output flag of get_input_line(): "An ERROR has occured, maybe EOF".
#define VRNA_INPUT_QUIT 2U
Output flag of get_input_line(): "the user requested quitting the program".
#define VRNA_INPUT_MISC 4U
Output flag of get_input_line(): "something was read".
#define VRNA_INPUT_FASTA_HEADER 8U
Input/Output flag of get_input_line():
if used as input option this tells get_input_line() that the data to be read should comply with the FASTA format.
#define VRNA_INPUT_CONSTRAINT 32U
Input flag for get_input_line():
Tell get_input_line() that we assume to read a structure constraint.
#define VRNA_INPUT_NO_TRUNCATION 256U
Input switch for get_input_line(): "do not trunkate the line by eliminating white spaces at end of line".
#define VRNA_INPUT_NO_REST 512U
Input switch for vrna_file_fasta_read_record(): "do fill rest array".
#define VRNA_INPUT_NO_SPAN 1024U
Input switch for vrna_file_fasta_read_record(): "never allow data to span more than one line".
#define VRNA_INPUT_NOSKIP_BLANK_LINES 2048U
Input switch for vrna_file_fasta_read_record(): "do not skip empty lines".
#define VRNA_INPUT_BLANK_LINE 4096U
Output flag for vrna_file_fasta_read_record(): "read an empty line".
#define VRNA_INPUT_NOSKIP_COMMENTS 128U
Input switch for get_input_line(): "do not skip comment lines".
#define VRNA_INPUT_COMMENT 8192U
Output flag for vrna_file_fasta_read_record(): "read a comment".
#define MIN2(A, B) ((A) < (B) ? (A) : (B))
Get the minimum of two comparable values.
#define MAX2(A, B) ((A) > (B) ? (A) : (B))
Get the maximum of two comparable values.
#define MIN3(A, B, C) (MIN2( (MIN2((A),(B))) ,(C)))
Get the minimum of three comparable values.
#define MAX3(A, B, C) (MAX2( (MAX2((A),(B))) ,(C)))
Get the maximum of three comparable values.
unsigned short xsubi [3]
Current 48 bit random number.
Generated by Doxygen
15.45 Utilities 283
#include <ViennaRNA/utils.h>
the function will return this flag if a fasta header was read
#include <ViennaRNA/utils.h>
#include <ViennaRNA/combinatorics.h>
This function implements A fast algorithm to generate necklaces with fixed content as published by Joe Sawada in
2003 [16].
The function receives a list of counts (the elements on the necklace) for each type of object within a necklace. The
list starts at index 0 and ends with an entry that has a count of 0. The algorithm then enumerates all non-cyclic
permutations of the content, returned as a list of necklaces. This list, again, is zero-terminated, i.e. the last entry of
the list is a NULL pointer.
Parameters
Returns
SWIG Wrapper Notes This function is available as global function enumerate_necklaces() which accepts lists
input, an produces list of lists output.
Generated by Doxygen
284 Module Documentation
#include <ViennaRNA/alphabet.h>
Get an array of the numerical encoding for each possible base pair (i,j)
Note
This array is always indexed in column-wise order, in contrast to previously different indexing between mfe and
pf variants!
See also
vrna_idx_col_wise(), vrna_fold_compound_t
#include <ViennaRNA/alphabet.h>
This function encodes a nucleotide character to its numerical representation as required by many functions in R-
NAlib.
See also
vrna_nucleotide_decode(), vrna_seq_encode()
Parameters
c The nucleotide character to encode
md The model details that determine the kind of encoding
Returns
#include <ViennaRNA/alphabet.h>
This function decodes a numerical representation of a nucleotide character back into nucleotide alphabet
See also
vrna_nucleotide_encode(), vrna_seq_encode()
Generated by Doxygen
15.45 Utilities 285
Parameters
enc The encoded nucleotide
md The model details that determine the kind of decoding
Returns
#include <ViennaRNA/utils.h>
Parameters
Returns
#include <ViennaRNA/utils.h>
Parameters
p A pointer to the memory region to be reallocated
size The size of the memory to be allocated in bytes
Returns
#include <ViennaRNA/utils.h>
This function is a wrapper to fprintf(stderr, ...) that puts a capital ERROR: in front of the message and then exits the
calling program.
Generated by Doxygen
286 Module Documentation
See also
Generated by Doxygen
15.45 Utilities 287
Parameters
#include <ViennaRNA/utils.h>
This function is a wrapper to vfprintf(stderr, ...) that puts a capital ERROR: in front of the message and then exits
the calling program.
See also
Parameters
#include <ViennaRNA/utils.h>
This function is a wrapper to fprintf(stderr, ...) that puts a capital WARNING: in front of the message.
See also
Parameters
#include <ViennaRNA/utils.h>
Print a warning message.
This function is a wrapper to fprintf(stderr, ...) that puts a capital WARNING: in front of the message.
Generated by Doxygen
288 Module Documentation
See also
Parameters
#include <ViennaRNA/utils.h>
See also
Parameters
15.45.3.12 void vrna_message_vinfo ( FILE fp, const char format, va_list args )
#include <ViennaRNA/utils.h>
See also
Parameters
Generated by Doxygen
15.45 Utilities 289
#include <ViennaRNA/utils.h>
See also
vrna_int_urn(), vrna_init_rand()
Note
Returns
#include <ViennaRNA/utils.h>
See also
vrna_urn(), vrna_init_rand()
Parameters
Returns
#include <ViennaRNA/utils.h>
Get a timestamp.
Returns a string containing the current date in the format
Returns
Generated by Doxygen
290 Module Documentation
#include <ViennaRNA/utils.h>
Retrieve a line from 'stdin' savely while skipping comment characters and other features This function returns the
type of input it has read if recognized. An option argument allows one to switch between different reading modes.
Currently available options are:
#VRNA_INPUT_NOPRINT_COMMENTS, VRNA_INPUT_NOSKIP_COMMENTS, #VRNA_INPUT_NOELIM_W-
S_SUFFIX
If the function recognizes the type of input, it will report it in the return value. It also reports if a user defined 'quit'
command (-sign on 'stdin') was given. Possible return values are:
VRNA_INPUT_FASTA_HEADER, VRNA_INPUT_ERROR, VRNA_INPUT_MISC, VRNA_INPUT_QUIT
Parameters
string A pointer to the character array that contains the line read
options A collection of options for switching the functions behavior
Returns
#include <ViennaRNA/utils.h>
There will also be a ruler (scale line) printed that helps orientation of the sequence positions
#include <ViennaRNA/utils.h>
(usually this is used to ask for user input) There will also be a ruler (scale line) printed that helps orientation of the
sequence positions
Parameters
Generated by Doxygen
15.45 Utilities 291
#include <ViennaRNA/utils.h>
Get an index mapper array (iindx) for accessing the energy matrices, e.g. in partition function related functions.
(i,j) ~ iindx[i]-j
This function is necessary as most of the two-dimensional energy matrices are actually one-dimensional arrays
throughout the ViennaRNA Package
Consult the implemented code to find out about the mapping formula ;)
See also
vrna_idx_col_wise()
Parameters
Returns
#include <ViennaRNA/utils.h>
Get an index mapper array (indx) for accessing the energy matrices, e.g. in MFE related functions.
(i,j) ~ indx[j]+i
This function is necessary as most of the two-dimensional energy matrices are actually one-dimensional arrays
throughout the ViennaRNAPackage
Consult the implemented code to find out about the mapping formula ;)
See also
vrna_idx_row_wise()
Parameters
Generated by Doxygen
292 Module Documentation
Returns
#include <ViennaRNA/utils.h>
This variable is used by vrna_urn(). These should be set to some random number seeds before the first call to
vrna_urn().
See also
vrna_urn()
Generated by Doxygen
15.46 MFE Structures of single Nucleic Acid Sequences 293
This module contains all functions and variables related to the calculation of global minimum free energy structures
for single sequences.
Functions
float vrna_fold (const char sequence, char structure)
Compute Minimum Free Energy (MFE), and a corresponding secondary structure for an RNA sequence.
float vrna_circfold (const char sequence, char structure)
Compute Minimum Free Energy (MFE), and a corresponding secondary structure for a circular RNA sequence.
float fold_par (const char sequence, char structure, vrna_param_t parameters, int is_constrained, int is-
_circular)
Compute minimum free energy and an appropriate secondary structure of an RNA sequence.
float fold (const char sequence, char structure)
Compute minimum free energy and an appropriate secondary structure of an RNA sequence.
float circfold (const char sequence, char structure)
Compute minimum free energy and an appropriate secondary structure of a circular RNA sequence.
void free_arrays (void)
Free arrays for mfe folding.
void update_fold_params (void)
Recalculate energy parameters.
void update_fold_params_par (vrna_param_t parameters)
Recalculate energy parameters.
void export_fold_arrays (int f5_p, int c_p, int fML_p, int fM1_p, int indx_p, char ptype_p)
void export_fold_arrays_par (int f5_p, int c_p, int fML_p, int fM1_p, int indx_p, char ptype_p,
vrna_param_t P_p)
void export_circfold_arrays (int Fc_p, int FcH_p, int FcI_p, int FcM_p, int fM2_p, int f5_p, int c_p,
int fML_p, int fM1_p, int indx_p, char ptype_p)
void export_circfold_arrays_par (int Fc_p, int FcH_p, int FcI_p, int FcM_p, int fM2_p, int f5_p, int
c_p, int fML_p, int fM1_p, int indx_p, char ptype_p, vrna_param_t P_p)
int LoopEnergy (int n1, int n2, int type, int type_2, int si1, int sj1, int sp1, int sq1)
int HairpinE (int size, int type, int si1, int sj1, const char string)
void initialize_fold (int length)
This module contains all functions and variables related to the calculation of global minimum free energy structures
for single sequences.
The library provides a fast dynamic programming minimum free energy folding algorithm as described by "Zuker &
Stiegler (1981)" [24].
Generated by Doxygen
294 Module Documentation
#include <ViennaRNA/fold.h>
Compute Minimum Free Energy (MFE), and a corresponding secondary structure for an RNA sequence.
This simplified interface to vrna_mfe() computes the MFE and, if required, a secondary structure for an RNA se-
quence using default options. Memory required for dynamic programming (DP) matrices will be allocated and free'd
on-the-fly. Hence, after return of this function, the recursively filled matrices are not available any more for any
post-processing, e.g. suboptimal backtracking, etc.
Note
In case you want to use the filled DP matrices for any subsequent post-processing step, or you require other
conditions than specified by the default model details, use vrna_mfe(), and the data structure vrna_fold_-
compound_t instead.
See also
Parameters
sequence RNA sequence
structure A pointer to the character array where the secondary structure in dot-bracket notation will be written to
Returns
#include <ViennaRNA/fold.h>
Compute Minimum Free Energy (MFE), and a corresponding secondary structure for a circular RNA sequence.
This simplified interface to vrna_mfe() computes the MFE and, if required, a secondary structure for a circular RNA
sequence using default options. Memory required for dynamic programming (DP) matrices will be allocated and
free'd on-the-fly. Hence, after return of this function, the recursively filled matrices are not available any more for
any post-processing, e.g. suboptimal backtracking, etc.
Folding of circular RNA sequences is handled as a post-processing step of the forward recursions. See [9] for
further details.
Note
In case you want to use the filled DP matrices for any subsequent post-processing step, or you require other
conditions than specified by the default model details, use vrna_mfe(), and the data structure vrna_fold_-
compound_t instead.
See also
Generated by Doxygen
15.46 MFE Structures of single Nucleic Acid Sequences 295
Parameters
sequence RNA sequence
structure A pointer to the character array where the secondary structure in dot-bracket notation will be written to
Returns
15.46.2.3 float fold_par ( const char sequence, char structure, vrna_param_t parameters, int is_constrained, int
is_circular )
#include <ViennaRNA/fold.h>
Compute minimum free energy and an appropriate secondary structure of an RNA sequence.
The first parameter given, the RNA sequence, must be uppercase and should only contain an alphabet that is
understood by the RNAlib
(e.g. = {A, U, C, G})
The second parameter, structure, must always point to an allocated block of memory with a size of at least
strlen(sequence) + 1
If the third parameter is NULL, global model detail settings are assumed for the folding recursions. Otherwise, the
provided parameters are used.
The fourth parameter indicates whether a secondary structure constraint in enhanced dot-bracket notation is passed
through the structure parameter or not. If so, the characters " | x < > " are recognized to mark bases that are paired,
unpaired, paired upstream, or downstream, respectively. Matching brackets " ( ) " denote base pairs, dots "." are
used for unconstrained bases.
To indicate that the RNA sequence is circular and thus has to be post-processed, set the last parameter to non-zero
After a successful call of fold_par(), a backtracked secondary structure (in dot-bracket notation) that exhibits the
minimum of free energy will be written to the memory structure is pointing to. The function returns the minimum of
free energy for any fold of the sequence given.
Note
OpenMP: Passing NULL to the 'parameters' argument involves access to several global model detail variables
and thus is not to be considered threadsafe
See also
Parameters
sequence RNA sequence
structure A pointer to the character array where the secondary structure in dot-bracket notation will be
written to
parameters
Generated by Doxygen A data structure containing the pre-scaled energy contributions and the model details. (NULL
may be passed, see OpenMP notes above)
is_constrained Switch to indicate that a structure constraint is passed via the structure argument (0==off)
is_circular Switch to (de-)activate post-processing steps in case RNA sequence is circular (0==off)
296 Module Documentation
Returns
#include <ViennaRNA/fold.h>
Compute minimum free energy and an appropriate secondary structure of an RNA sequence.
This function essentially does the same thing as fold_par(). However, it takes its model details, i.e. temperature,
dangles, tetra_loop, noGU, no_closingGU, fold_constrained, noLonelyPairs from the current global settings within
the library
See also
fold_par(), circfold()
Parameters
sequence RNA sequence
structure A pointer to the character array where the secondary structure in dot-bracket notation will be written to
Returns
#include <ViennaRNA/fold.h>
Compute minimum free energy and an appropriate secondary structure of a circular RNA sequence.
This function essentially does the same thing as fold_par(). However, it takes its model details, i.e. temperature,
dangles, tetra_loop, noGU, no_closingGU, fold_constrained, noLonelyPairs from the current global settings within
the library
See also
fold_par(), circfold()
Generated by Doxygen
15.46 MFE Structures of single Nucleic Acid Sequences 297
Parameters
sequence RNA sequence
structure A pointer to the character array where the secondary structure in dot-bracket notation will be written to
Returns
#include <ViennaRNA/fold.h>
Deprecated See vrna_fold(), vrna_circfold(), or vrna_mfe() and vrna_fold_compound_t for the usage of the new
API!
#include <ViennaRNA/fold.h>
Deprecated For non-default model settings use the new API with vrna_params_subst() and vrna_mfe() instead!
#include <ViennaRNA/fold.h>
Deprecated For non-default model settings use the new API with vrna_params_subst() and vrna_mfe() instead!
15.46.2.9 void export_fold_arrays ( int f5_p, int c_p, int fML_p, int fM1_p, int indx_p, char ptype_p )
#include <ViennaRNA/fold.h>
Deprecated See vrna_mfe() and vrna_fold_compound_t for the usage of the new API!
Generated by Doxygen
298 Module Documentation
15.46.2.10 void export_fold_arrays_par ( int f5_p, int c_p, int fML_p, int fM1_p, int indx_p, char ptype_p,
vrna_param_t P_p )
#include <ViennaRNA/fold.h>
Deprecated See vrna_mfe() and vrna_fold_compound_t for the usage of the new API!
15.46.2.11 void export_circfold_arrays ( int Fc_p, int FcH_p, int FcI_p, int FcM_p, int fM2_p, int f5_p, int
c_p, int fML_p, int fM1_p, int indx_p, char ptype_p )
#include <ViennaRNA/fold.h>
Deprecated See vrna_mfe() and vrna_fold_compound_t for the usage of the new API!
15.46.2.12 void export_circfold_arrays_par ( int Fc_p, int FcH_p, int FcI_p, int FcM_p, int fM2_p, int f5_p, int
c_p, int fML_p, int fM1_p, int indx_p, char ptype_p, vrna_param_t P_p )
#include <ViennaRNA/fold.h>
Deprecated See vrna_mfe() and vrna_fold_compound_t for the usage of the new API!
15.46.2.13 int LoopEnergy ( int n1, int n2, int type, int type_2, int si1, int sj1, int sp1, int sq1 )
#include <ViennaRNA/fold.h>
Deprecated {This function is deprecated and will be removed soon. Use E_IntLoop() instead!}
15.46.2.14 int HairpinE ( int size, int type, int si1, int sj1, const char string )
#include <ViennaRNA/fold.h>
Deprecated {This function is deprecated and will be removed soon. Use E_Hairpin() instead!}
#include <ViennaRNA/fold.h>
Deprecated See vrna_mfe() and vrna_fold_compound_t for the usage of the new API!
Generated by Doxygen
15.47 MFE Structures of two hybridized Sequences 299
MFE version of cofolding routines This file includes (almost) all function declarations within the RNAlib that are
related to MFE Cofolding... This also includes the Zuker suboptimals calculations, since they are implemented
using the cofold routines.
Functions
float vrna_cofold (const char sequence, char structure)
Compute Minimum Free Energy (MFE), and a corresponding secondary structure for two dimerized RNA sequences.
float cofold (const char sequence, char structure)
Compute the minimum free energy of two interacting RNA molecules.
float cofold_par (const char string, char structure, vrna_param_t parameters, int is_constrained)
Compute the minimum free energy of two interacting RNA molecules.
void free_co_arrays (void)
Free memory occupied by cofold()
void update_cofold_params (void)
Recalculate parameters.
void update_cofold_params_par (vrna_param_t parameters)
Recalculate parameters.
void export_cofold_arrays_gq (int f5_p, int c_p, int fML_p, int fM1_p, int fc_p, int ggg_p, int
indx_p, char ptype_p)
Export the arrays of partition function cofold (with gquadruplex support)
void export_cofold_arrays (int f5_p, int c_p, int fML_p, int fM1_p, int fc_p, int indx_p, char
ptype_p)
Export the arrays of partition function cofold.
void get_monomere_mfes (float e1, float e2)
get_monomer_free_energies
void initialize_cofold (int length)
float vrna_mfe_dimer (vrna_fold_compound_t vc, char structure)
Compute the minimum free energy of two interacting RNA molecules.
MFE version of cofolding routines This file includes (almost) all function declarations within the RNAlib that are
related to MFE Cofolding... This also includes the Zuker suboptimals calculations, since they are implemented
using the cofold routines.
Generated by Doxygen
300 Module Documentation
#include <ViennaRNA/cofold.h>
Compute Minimum Free Energy (MFE), and a corresponding secondary structure for two dimerized RNA se-
quences.
This simplified interface to vrna_mfe() computes the MFE and, if required, a secondary structure for two RNA
sequences upon dimerization using default options. Memory required for dynamic programming (DP) matrices will
be allocated and free'd on-the-fly. Hence, after return of this function, the recursively filled matrices are not available
any more for any post-processing, e.g. suboptimal backtracking, etc.
Note
In case you want to use the filled DP matrices for any subsequent post-processing step, or you require other
conditions than specified by the default model details, use vrna_mfe(), and the data structure vrna_fold_-
compound_t instead.
See also
Parameters
Returns
#include <ViennaRNA/cofold.h>
The code is analog to the fold() function. If cut_point ==-1 results should be the same as with fold().
Parameters
sequence The two sequences concatenated
structure Will hold the barcket dot structure of the dimer molecule
Generated by Doxygen
15.47 MFE Structures of two hybridized Sequences 301
Returns
15.47.2.3 float cofold_par ( const char string, char structure, vrna_param_t parameters, int is_constrained )
#include <ViennaRNA/cofold.h>
#include <ViennaRNA/cofold.h>
Deprecated This function will only free memory allocated by a prior call of cofold() or cofold_par(). See vrna_-
mfe_dimer() for how to use the new API
Note
folding matrices now reside in the fold compound, and should be free'd there
See also
vrna_fc_destroy(), vrna_mfe_dimer()
#include <ViennaRNA/cofold.h>
Recalculate parameters.
#include <ViennaRNA/cofold.h>
Recalculate parameters.
Generated by Doxygen
302 Module Documentation
15.47.2.7 void export_cofold_arrays_gq ( int f5_p, int c_p, int fML_p, int fM1_p, int fc_p, int ggg_p, int
indx_p, char ptype_p )
#include <ViennaRNA/cofold.h>
Export the cofold arrays for use e.g. in the concentration Computations or suboptimal secondary structure back-
tracking
Deprecated folding matrices now reside within the fold compound. Thus, this function will only work in conjunction
with a prior call to cofold() or cofold_par()
See also
Parameters
f5_p A pointer to the 'f5' array, i.e. array conatining best free energy in interval [1,j]
c_p A pointer to the 'c' array, i.e. array containing best free energy in interval [i,j] given that i pairs with j
fML_p A pointer to the 'M' array, i.e. array containing best free energy in interval [i,j] for any multiloop
segment with at least one stem
fM1_p A pointer to the 'M1' array, i.e. array containing best free energy in interval [i,j] for multiloop segment
with exactly one stem
fc_p A pointer to the 'fc' array, i.e. array ...
ggg_p A pointer to the 'ggg' array, i.e. array containing best free energy of a gquadruplex delimited by [i,j]
indx_p A pointer to the indexing array used for accessing the energy matrices
ptype- A pointer to the ptype array containing the base pair types for each possibility (i,j)
_p
15.47.2.8 void export_cofold_arrays ( int f5_p, int c_p, int fML_p, int fM1_p, int fc_p, int indx_p, char
ptype_p )
#include <ViennaRNA/cofold.h>
Export the cofold arrays for use e.g. in the concentration Computations or suboptimal secondary structure back-
tracking
Deprecated folding matrices now reside within the vrna_fold_compound_t. Thus, this function will only work in
conjunction with a prior call to the deprecated functions cofold() or cofold_par()
See also
Generated by Doxygen
15.47 MFE Structures of two hybridized Sequences 303
Parameters
f5_p A pointer to the 'f5' array, i.e. array conatining best free energy in interval [1,j]
c_p A pointer to the 'c' array, i.e. array containing best free energy in interval [i,j] given that i pairs with j
fML_p A pointer to the 'M' array, i.e. array containing best free energy in interval [i,j] for any multiloop
segment with at least one stem
fM1_p A pointer to the 'M1' array, i.e. array containing best free energy in interval [i,j] for multiloop segment
with exactly one stem
fc_p A pointer to the 'fc' array, i.e. array ...
indx_p A pointer to the indexing array used for accessing the energy matrices
ptype- A pointer to the ptype array containing the base pair types for each possibility (i,j)
_p
#include <ViennaRNA/cofold.h>
get_monomer_free_energies
Parameters
#include <ViennaRNA/cofold.h>
#include <ViennaRNA/mfe.h>
Generated by Doxygen
304 Module Documentation
Parameters
vc fold compound
structure Will hold the barcket dot structure of the dimer molecule
Returns
SWIG Wrapper Notes This function is attached as method mfe_dimer() to objects of type fold_compound
Generated by Doxygen
15.48 Partition Function for two hybridized Sequences 305
part_func_co.h
Partition Function
Partition function part_func_up.h
part_func_co.h for two hybridized RNA-RNA interaction
and equilibrium properties
part_func_up.h Sequences
Files
file part_func_co.h
Partition function for two RNA sequences.
file part_func_up.h
Implementations for accessibility and RNA-RNA interaction as a stepwise process.
Data Structures
struct vrna_dimer_pf_s
Data structure returned by vrna_pf_dimer() More...
struct vrna_dimer_conc_s
Data structure for concentration dependency computations. More...
Typedefs
typedef struct vrna_dimer_pf_s vrna_dimer_pf_t
Typename for the data structure that stores the dimer partition functions, vrna_dimer_pf_s, as returned by vrna_pf-
_dimer()
typedef struct vrna_dimer_conc_s vrna_dimer_conc_t
Typename for the data structure that stores the dimer concentrations, vrna_dimer_conc_s, as required by vrna_pf-
_dimer_concentration()
typedef struct vrna_dimer_pf_s cofoldF
Backward compatibility typedef for vrna_dimer_pf_s.
typedef struct vrna_dimer_conc_s ConcEnt
Backward compatibility typedef for vrna_dimer_conc_s.
Functions
vrna_dimer_pf_t vrna_pf_dimer (vrna_fold_compound_t vc, char structure)
Calculate partition function and base pair probabilities of nucleic acid/nucleic acid dimers.
void vrna_pf_dimer_probs (double FAB, double FA, double FB, vrna_plist_t prAB, const vrna_plist_t prA,
const vrna_plist_t prB, int Alength, const vrna_exp_param_t exp_params)
Compute Boltzmann probabilities of dimerization without homodimers.
vrna_dimer_conc_t vrna_pf_dimer_concentrations (double FcAB, double FcAA, double FcBB, double FEA,
double FEB, const double startconc, const vrna_exp_param_t exp_params)
Given two start monomer concentrations a and b, compute the concentrations in thermodynamic equilibrium of all
dimers and the monomers.
Generated by Doxygen
306 Module Documentation
Variables
int mirnatog
Toggles no intrabp in 2nd mol.
double F_monomer [2]
Free energies of the two monomers.
To simplify the implementation the partition function computation is done internally in a null model that does not
include the duplex initiation energy, i.e. the entropic penalty for producing a dimer from two monomers). The
resulting free energies and pair probabilities are initially relative to that null model. In a second step the free
energies can be corrected to include the dimerization penalty, and the pair probabilities can be divided into the
conditional pair probabilities given that a re dimer is formed or not formed. See [2] for further details.
As for folding one RNA molecule, this computes the partition function of all possible structures and the base pair
probabilities. Uses the same global pf_scale variable to avoid overflows.
To simplify the implementation the partition function computation is done internally in a null model that does not
include the duplex initiation energy, i.e. the entropic penalty for producing a dimer from two monomers). The
resulting free energies and pair probabilities are initially relative to that null model. In a second step the free
energies can be corrected to include the dimerization penalty, and the pair probabilities can be divided into the
conditional pair probabilities given that a re dimer is formed or not formed.
After computing the partition functions of all possible dimeres one can compute the probabilities of base pairs, the
concentrations out of start concentrations and sofar and soaway.
Dimer formation is inherently concentration dependent. Given the free energies of the monomers A and B and
dimers AB, AA, and BB one can compute the equilibrium concentrations, given input concentrations of A and B, see
e.g. Dimitrov & Zuker (2004)
Data Fields
double F0AB
Null model without DuplexInit.
double FAB
all states with DuplexInit correction
double FcAB
true hybrid states only
double FA
monomer A
double FB
monomer B
Generated by Doxygen
15.48 Partition Function for two hybridized Sequences 307
Data Fields
double Ac_start
start concentration A
double Bc_start
start concentration B
double ABc
End concentration AB.
#include <ViennaRNA/part_func_co.h>
Calculate partition function and base pair probabilities of nucleic acid/nucleic acid dimers.
See also
Parameters
Returns
SWIG Wrapper Notes This function is attached as method pf_dimer() to objects of type fold_compound
15.48.3.2 void vrna_pf_dimer_probs ( double FAB, double FA, double FB, vrna_plist_t prAB, const vrna_plist_t prA,
const vrna_plist_t prB, int Alength, const vrna_exp_param_t exp_params )
#include <ViennaRNA/part_func_co.h>
Given the pair probabilities and free energies (in the null model) for a dimer AB and the two constituent monomers A
and B, compute the conditional pair probabilities given that a dimer AB actually forms. Null model pair probabilities
are given as a list as produced by vrna_plist_from_probs(), the dimer probabilities 'prAB' are modified in place.
Generated by Doxygen
308 Module Documentation
Parameters
15.48.3.3 vrna_dimer_conc_t vrna_pf_dimer_concentrations ( double FcAB, double FcAA, double FcBB, double FEA,
double FEB, const double startconc, const vrna_exp_param_t exp_params )
#include <ViennaRNA/part_func_co.h>
Given two start monomer concentrations a and b, compute the concentrations in thermodynamic equilibrium of all
dimers and the monomers.
This function takes an array 'startconc' of input concentrations with alternating entries for the initial concentrations
of molecules A and B (terminated by two zeroes), then computes the resulting equilibrium concentrations from the
free energies for the dimers. Dimer free energies should be the dimer-only free energies, i.e. the FcAB entries from
the vrna_dimer_pf_t struct.
Parameters
Returns
Generated by Doxygen
15.49 Partition Function for two hybridized Sequences as a stepwise Process 309
Collaboration diagram for Partition Function for two hybridized Sequences as a stepwise Process:
Partition function
and equilibrium properties Partition Function
for two hybridized
Sequences as a stepwise
Process
RNA-RNA interaction
Functions
In this approach to cofolding the interaction between two RNA molecules is seen as a stepwise process. In a first
step, the target molecule has to adopt a structure in which a binding site is accessible. In a second step, the ligand
molecule will hybridize with a region accessible to an interaction. Consequently the algorithm is designed as a
two step process: The first step is the calculation of the probability that a region within the target is unpaired, or
equivalently, the calculation of the free energy needed to expose a region. In the second step we compute the free
energy of an interaction for every possible binding site.
#include <ViennaRNA/part_func_up.h>
Calculate the partition function over all unpaired regions of a maximal length.
Generated by Doxygen
310 Module Documentation
You have to call function pf_fold() providing the same sequence before calling pf_unstru(). If you want to calculate
unpaired regions for a constrained structure, set variable 'structure' in function 'pf_fold()' to the constrain string. It
returns a pu_contrib struct containing four arrays of dimension [i = 1 to length(sequence)][j = 0 to u-1] containing
all possible contributions to the probabilities of unpaired regions of maximum length u. Each array in pu_contrib
contains one of the contributions to the total probability of being unpaired: The probability of being unpaired within
an exterior loop is in array pu_contrib->E, the probability of being unpaired within a hairpin loop is in array pu_-
contrib->H, the probability of being unpaired within an interior loop is in array pu_contrib->I and probability of being
unpaired within a multi-loop is in array pu_contrib->M. The total probability of being unpaired is the sum of the four
arrays of pu_contrib.
This function frees everything allocated automatically. To free the output structure call free_pu_contrib().
Parameters
sequence
max_w
Returns
15.49.2.2 interact pf_interact ( const char s1, const char s2, pu_contrib p_c, pu_contrib p_c2, int max_w,
char cstruc, int incr3, int incr5 )
#include <ViennaRNA/part_func_up.h>
The function considers the probability that the region of interaction is unpaired within 's1' and 's2'. The longer
sequence has to be given as 's1'. The shorter sequence has to be given as 's2'. Function pf_unstru() has to be
called for 's1' and 's2', where the probabilities of being unpaired have to be given in 'p_c' and 'p_c2', respectively.
If you do not want to include the probabilities of being unpaired for 's2' set 'p_c2' to NULL. If variable 'cstruc' is not
NULL, constrained folding is done: The available constrains for intermolecular interaction are: '.' (no constrain), 'x'
(the base has no intermolecular interaction) and '|' (the corresponding base has to be paired intermolecularily).
The parameter 'w' determines the maximal length of the interaction. The parameters 'incr5' and 'incr3' allows
inclusion of unpaired residues left ('incr5') and right ('incr3') of the region of interaction in 's1'. If the 'incr' options are
used, function pf_unstru() has to be called with w=w+incr5+incr3 for the longer sequence 's1'.
It returns a structure of type interact which contains the probability of the best local interaction including residue i
in Pi and the minimum free energy in Gi, where i is the position in sequence 's1'. The member Gikjl of structure
interact is the best interaction between region [k,i] k<i in longer sequence 's1' and region [j,l] j<l in 's2'. Gikjl_wo is
Gikjl without the probability of beeing unpaired.
Use free_interact() to free the returned structure, all other stuff is freed inside pf_interact().
Parameters
s1
s2
p_c
p_c2
max-
_w
cstruc
incr3
incr5
Generated by Doxygen
15.49 Partition Function for two hybridized Sequences as a stepwise Process 311
Returns
Generated by Doxygen
312 Module Documentation
Functions
float vrna_Lfold (const char string, int window_size, FILE file)
Local MFE prediction using a sliding window approach (simplified interface)
float vrna_Lfoldz (const char string, int window_size, double min_z, FILE file)
Local MFE prediction using a sliding window approach with z-score cut-off (simplified interface)
float Lfold (const char string, char structure, int maxdist)
The local analog to fold().
float Lfoldz (const char string, char structure, int maxdist, int zsc, double min_z)
float vrna_mfe_window (vrna_fold_compound_t vc, FILE file)
Local MFE prediction using a sliding window approach.
float vrna_mfe_window_zscore (vrna_fold_compound_t vc, double min_z, FILE file)
Local MFE prediction using a sliding window approach (with z-score cut-off)
15.50.2.1 float vrna_Lfold ( const char string, int window_size, FILE file )
#include <ViennaRNA/Lfold.h>
Local MFE prediction using a sliding window approach (simplified interface)
This simplified interface to vrna_mfe_window() computes the MFE and locally optimal secondary structure using
default options. Structures are predicted using a sliding window approach, where base pairs may not span outside
the window. Memory required for dynamic programming (DP) matrices will be allocated and free'd on-the-fly. Hence,
after return of this function, the recursively filled matrices are not available any more for any post-processing.
Note
In case you want to use the filled DP matrices for any subsequent post-processing step, or you require other
conditions than specified by the default model details, use vrna_mfe_window(), and the data structure vrna-
_fold_compound_t instead.
See also
Generated by Doxygen
15.50 Local MFE Structure Prediction and Z-scores 313
Parameters
string The nucleic acid sequence
window_size The window size for locally optimal structures
file The output file handle where predictions are written to (if NULL, output is written to stdout)
15.50.2.2 float vrna_Lfoldz ( const char string, int window_size, double min_z, FILE file )
#include <ViennaRNA/Lfold.h>
Local MFE prediction using a sliding window approach with z-score cut-off (simplified interface)
This simplified interface to vrna_mfe_window_zscore() computes the MFE and locally optimal secondary structure
using default options. Structures are predicted using a sliding window approach, where base pairs may not span
outside the window. Memory required for dynamic programming (DP) matrices will be allocated and free'd on-the-fly.
Hence, after return of this function, the recursively filled matrices are not available any more for any post-processing.
This function is the z-score version of vrna_Lfold(), i.e. only predictions above a certain z-score cut-off value are
printed.
Note
In case you want to use the filled DP matrices for any subsequent post-processing step, or you require other
conditions than specified by the default model details, use vrna_mfe_window(), and the data structure vrna-
_fold_compound_t instead.
See also
Parameters
string The nucleic acid sequence
window_size The window size for locally optimal structures
min_z The minimal z-score for a predicted structure to appear in the output
file The output file handle where predictions are written to (if NULL, output is written to stdout)
15.50.2.3 float Lfold ( const char string, char structure, int maxdist )
#include <ViennaRNA/Lfold.h>
Computes the minimum free energy structure including only base pairs with a span smaller than 'maxdist'
Generated by Doxygen
314 Module Documentation
15.50.2.4 float Lfoldz ( const char string, char structure, int maxdist, int zsc, double min_z )
#include <ViennaRNA/Lfold.h>
#include <ViennaRNA/mfe.h>
Computes minimum free energy structures using a sliding window approach, where base pairs may not span outside
the window. In contrast to vrna_mfe(), where a maximum base pair span may be set using the vrna_md_t.max_-
bp_span attribute and one globally optimal structure is predicted, this function uses a sliding window to retrieve all
locally optimal structures within each window. The size of the sliding window is set in the vrna_md_t.window_size
attribute, prior to the retrieval of the vrna_fold_compound_t using vrna_fold_compound() with option VRNA_OPT-
ION_WINDOW
The predicted structures are written on-the-fly, either to stdout, if a NULL pointer is passed as file parameter, or to
the corresponding filehandle.
See also
Parameters
SWIG Wrapper Notes This function is attached as method mfe_window() to objects of type fold_compound
#include <ViennaRNA/mfe.h>
Local MFE prediction using a sliding window approach (with z-score cut-off)
Computes minimum free energy structures using a sliding window approach, where base pairs may not span outside
the window. This function is the z-score version of vrna_mfe_window(), i.e. only predictions above a certain z-score
cut-off value are printed. As for vrna_mfe_window(), the size of the sliding window is set in the vrna_md_t.-
window_size attribute, prior to the retrieval of the vrna_fold_compound_t using vrna_fold_compound() with option
VRNA_OPTION_WINDOW.
The predicted structures are written on-the-fly, either to stdout, if a NULL pointer is passed as file parameter, or to
the corresponding filehandle.
Generated by Doxygen
15.50 Local MFE Structure Prediction and Z-scores 315
See also
Generated by Doxygen
316 Module Documentation
Parameters
Generated by Doxygen
15.51 Partition Function and Equilibrium Probabilities for Locally Stable Secondary Structures 317
15.51 Partition Function and Equilibrium Probabilities for Locally Stable Secondary
Structures
Collaboration diagram for Partition Function and Equilibrium Probabilities for Locally Stable Secondary Structures:
Partition function
and equilibrium properties Partition Function
and Equilibrium Probabilities
for Locally Stable Secondary
Structures
Locally stable structures
Macros
Functions
vrna_plist_t vrna_pfl_fold (const char sequence, int window_size, int max_bp_span, float cutoff)
Compute base pair probabilities using a sliding-window approach.
void vrna_pfl_fold_cb (const char sequence, int window_size, int max_bp_span, vrna_probs_window_-
callback cb, void data)
Compute base pair probabilities using a sliding-window approach (callback version)
double vrna_pfl_fold_up (const char sequence, int ulength, int window_size, int max_bp_span)
Compute probability of contiguous unpaired segments.
void vrna_pfl_fold_up_cb (const char sequence, int ulength, int window_size, int max_bp_span, vrna_-
probs_window_callback cb, void data)
Compute probability of contiguous unpaired segments.
void vrna_probs_window (vrna_fold_compound_t fc, int ulength, vrna_probs_window_callback cb, void
data, unsigned int options)
Compute various equilibrium probabilities under a sliding window approach.
Generated by Doxygen
318 Module Documentation
#include <ViennaRNA/LPfold.h>
See also
vrna_probs_window()
#include <ViennaRNA/LPfold.h>
See also
vrna_probs_window()
#include <ViennaRNA/LPfold.h>
See also
vrna_probs_window()
#include <ViennaRNA/LPfold.h>
Option flag to activate callback triggers for unpaired probabilities (split up into different loop types)
See also
Generated by Doxygen
15.51 Partition Function and Equilibrium Probabilities for Locally Stable Secondary Structures 319
15.51.3.1 vrna_plist_t vrna_pfl_fold ( const char sequence, int window_size, int max_bp_span, float cutoff )
#include <ViennaRNA/LPfold.h>
This is a simplified wrapper to vrna_probs_window() that given a nucleid acid sequence, a window size, a maximum
base pair span, and a cutoff value computes the pair probabilities for any base pair in any window. The pair
probabilities are returned as a list and the user has to take care to free() the memory occupied by the list.
Note
This function uses default model settings! For custom model settings, we refer to the function vrna_probs_-
window().
See also
Parameters
sequence The nucleic acid input sequence
window_size The size of the sliding window
max_bp_span The maximum distance along the backbone between two nucleotides that form a base pairs
cutoff A cutoff value that omits all pairs with lower probability
Returns
A list of base pair probabilities, terminated by an entry with #vrna_plist_t.i and #vrna_plist_t.j set to 0
15.51.3.2 void vrna_pfl_fold_cb ( const char sequence, int window_size, int max_bp_span, vrna_probs_window_callback
cb, void data )
#include <ViennaRNA/LPfold.h>
Compute base pair probabilities using a sliding-window approach (callback version)
This is a simplified wrapper to vrna_probs_window() that given a nucleid acid sequence, a window size, a maximum
base pair span, and a cutoff value computes the pair probabilities for any base pair in any window. It is similar to
vrna_pfl_fold() but uses a callback mechanism to return the pair probabilities.
Read the details for vrna_probs_window() for details on the callback implementation!
Note
This function uses default model settings! For custom model settings, we refer to the function vrna_probs_-
window().
See also
Generated by Doxygen
320 Module Documentation
Parameters
sequence The nucleic acid input sequence
window_size The size of the sliding window
max_bp_span The maximum distance along the backbone between two nucleotides that form a base pairs
cb The callback function which collects the pair probability data for further processing
data Some arbitrary data structure that is passed to the callback cb
15.51.3.3 double vrna_pfl_fold_up ( const char sequence, int ulength, int window_size, int max_bp_span )
#include <ViennaRNA/LPfold.h>
This is a simplified wrapper to vrna_probs_window() that given a nucleic acid sequence, a maximum length of un-
paired segments (ulength), a window size, and a maximum base pair span computes the equilibrium probability
of any segment not exceeding ulength. The probabilities to be unpaired are returned as a 1-based, 2-dimensional
matrix with dimensions N M , where N is the length of the sequence and M is the maximum segment length. As
an example, the probability of a segment of size 5 starting at position 100 is stored in the matrix entry X[100][5].
Note
This function uses default model settings! For custom model settings, we refer to the function vrna_probs_-
window().
Parameters
sequence The nucleic acid input sequence
ulength The maximal length of an unpaired segment
window_size The size of the sliding window
max_bp_span The maximum distance along the backbone between two nucleotides that form a base pairs
Returns
15.51.3.4 void vrna_pfl_fold_up_cb ( const char sequence, int ulength, int window_size, int max_bp_span,
vrna_probs_window_callback cb, void data )
#include <ViennaRNA/LPfold.h>
This is a simplified wrapper to vrna_probs_window() that given a nucleic acid sequence, a maximum length of un-
paired segments (ulength), a window size, and a maximum base pair span computes the equilibrium probability
of any segment not exceeding ulength. It is similar to vrna_pfl_fold_up() but uses a callback mechanism to return
the unpaired probabilities.
Read the details for vrna_probs_window() for details on the callback implementation!
Generated by Doxygen
15.51 Partition Function and Equilibrium Probabilities for Locally Stable Secondary Structures 321
Note
This function uses default model settings! For custom model settings, we refer to the function vrna_probs_-
window().
Parameters
sequence The nucleic acid input sequence
ulength The maximal length of an unpaired segment
window_size The size of the sliding window
max_bp_span The maximum distance along the backbone between two nucleotides that form a base pairs
cb The callback function which collects the pair probability data for further processing
data Some arbitrary data structure that is passed to the callback cb
Returns
15.51.3.5 void vrna_probs_window ( vrna_fold_compound_t fc, int ulength, vrna_probs_window_callback cb, void
data, unsigned int options )
#include <ViennaRNA/LPfold.h>
See also
Parameters
fc The fold compound with sequence data, model settings and precomputed energy parameters
ulength The maximal length of an unpaired segment (only for unpaired probability computations)
cb The callback function which collects the pair probability data for further processing
data Some arbitrary data structure that is passed to the callback cb
options Option flags to control the behavior of this function
Generated by Doxygen
322 Module Documentation
Collaboration diagram for Local MFE Consensus Structure Prediction for Sequence Alignments:
Comparative structure
prediction
Local MFE Consensus
Structure Prediction
for Sequence Alignments
Locally stable structures
Functions
15.52.2.1 float aliLfold ( const char AS, char structure, int maxdist )
#include <ViennaRNA/Lfold.h>
Parameters
strings
structure
maxdist
Returns
Generated by Doxygen
15.53 Reading/Writing Energy Parameter Sets from/to File 323
Read and Write energy parameter sets from and to text files.
Modules
Functions
Read and Write energy parameter sets from and to text files.
A default set of parameters, identical to the one described in [14] and [19], is compiled into the library.
#include <ViennaRNA/read_epars.h>
Parameters
Generated by Doxygen
324 Module Documentation
#include <ViennaRNA/read_epars.h>
Parameters
fname A filename (path) for the file where the current energy parameters will be written to
Generated by Doxygen
15.54 Converting Energy Parameter Files 325
Files
file 1.8.4_epars.h
Free energy parameters for parameter file conversion.
file 1.8.4_intloops.h
Free energy parameters for interior loop contributions needed by the parameter file conversion functions.
Macros
#define VRNA_CONVERT_OUTPUT_ALL 1U
#define VRNA_CONVERT_OUTPUT_HP 2U
#define VRNA_CONVERT_OUTPUT_STACK 4U
#define VRNA_CONVERT_OUTPUT_MM_HP 8U
#define VRNA_CONVERT_OUTPUT_MM_INT 16U
#define VRNA_CONVERT_OUTPUT_MM_INT_1N 32U
#define VRNA_CONVERT_OUTPUT_MM_INT_23 64U
#define VRNA_CONVERT_OUTPUT_MM_MULTI 128U
#define VRNA_CONVERT_OUTPUT_MM_EXT 256U
#define VRNA_CONVERT_OUTPUT_DANGLE5 512U
#define VRNA_CONVERT_OUTPUT_DANGLE3 1024U
#define VRNA_CONVERT_OUTPUT_INT_11 2048U
#define VRNA_CONVERT_OUTPUT_INT_21 4096U
#define VRNA_CONVERT_OUTPUT_INT_22 8192U
#define VRNA_CONVERT_OUTPUT_BULGE 16384U
#define VRNA_CONVERT_OUTPUT_INT 32768U
#define VRNA_CONVERT_OUTPUT_ML 65536U
#define VRNA_CONVERT_OUTPUT_MISC 131072U
#define VRNA_CONVERT_OUTPUT_SPECIAL_HP 262144U
#define VRNA_CONVERT_OUTPUT_VANILLA 524288U
#define VRNA_CONVERT_OUTPUT_NINIO 1048576U
#define VRNA_CONVERT_OUTPUT_DUMP 2097152U
Functions
void convert_parameter_file (const char iname, const char oname, unsigned int options)
Generated by Doxygen
326 Module Documentation
To preserve some backward compatibility the RNAlib also provides functions to convert energy parameter files from
the format used in version 1.4-1.8 into the new format used since version 2.0
#include <ViennaRNA/convert_epars.h>
#include <ViennaRNA/convert_epars.h>
#include <ViennaRNA/convert_epars.h>
#include <ViennaRNA/convert_epars.h>
#include <ViennaRNA/convert_epars.h>
#include <ViennaRNA/convert_epars.h>
Generated by Doxygen
15.54 Converting Energy Parameter Files 327
#include <ViennaRNA/convert_epars.h>
#include <ViennaRNA/convert_epars.h>
#include <ViennaRNA/convert_epars.h>
#include <ViennaRNA/convert_epars.h>
#include <ViennaRNA/convert_epars.h>
#include <ViennaRNA/convert_epars.h>
#include <ViennaRNA/convert_epars.h>
#include <ViennaRNA/convert_epars.h>
Generated by Doxygen
328 Module Documentation
#include <ViennaRNA/convert_epars.h>
#include <ViennaRNA/convert_epars.h>
#include <ViennaRNA/convert_epars.h>
#include <ViennaRNA/convert_epars.h>
#include <ViennaRNA/convert_epars.h>
#include <ViennaRNA/convert_epars.h>
Note
#include <ViennaRNA/convert_epars.h>
Generated by Doxygen
15.54 Converting Energy Parameter Files 329
#include <ViennaRNA/convert_epars.h>
Flag to indicate dumping the energy contributions from the library instead of an input file
15.54.3.1 void convert_parameter_file ( const char iname, const char oname, unsigned int options )
#include <ViennaRNA/convert_epars.h>
The options argument allows one to control the different output modes.
Currently available options are:
VRNA_CONVERT_OUTPUT_ALL, VRNA_CONVERT_OUTPUT_HP, VRNA_CONVERT_OUTPUT_STACK
VRNA_CONVERT_OUTPUT_MM_HP, VRNA_CONVERT_OUTPUT_MM_INT, VRNA_CONVERT_OUTPUT_-
MM_INT_1N
VRNA_CONVERT_OUTPUT_MM_INT_23, VRNA_CONVERT_OUTPUT_MM_MULTI, VRNA_CONVERT_OUT-
PUT_MM_EXT
VRNA_CONVERT_OUTPUT_DANGLE5, VRNA_CONVERT_OUTPUT_DANGLE3, VRNA_CONVERT_OUTPU-
T_INT_11
VRNA_CONVERT_OUTPUT_INT_21, VRNA_CONVERT_OUTPUT_INT_22, VRNA_CONVERT_OUTPUT_BU-
LGE
VRNA_CONVERT_OUTPUT_INT, VRNA_CONVERT_OUTPUT_ML, VRNA_CONVERT_OUTPUT_MISC
VRNA_CONVERT_OUTPUT_SPECIAL_HP, VRNA_CONVERT_OUTPUT_VANILLA, VRNA_CONVERT_OUT-
PUT_NINIO
VRNA_CONVERT_OUTPUT_DUMP
The defined options are fine for bitwise compare- and assignment-operations, e. g.: pass a collection of options as
a single value like this:
Parameters
iname The input file name (If NULL input is read from stdin)
oname The output file name (If NULL output is written to stdout)
options The options (as described above)
Generated by Doxygen
330 Module Documentation
This module provides interfaces that deal with the most basic data structure used in structure predicting and energy
evaluating function of the RNAlib.
Data Structures
struct vrna_fc_s
The most basic data structure required by many functions throughout the RNAlib. More...
Macros
Generated by Doxygen
15.55 The Fold Compound 331
Typedefs
Enumerations
Functions
vrna_fold_compound_t vrna_fold_compound (const char sequence, vrna_md_t md_p, unsigned int op-
tions)
Retrieve a vrna_fold_compound_t data structure for single sequences and hybridizing sequences.
vrna_fold_compound_t vrna_fold_compound_comparative (const char sequences, vrna_md_t md_p,
unsigned int options)
Retrieve a vrna_fold_compound_t data structure for sequence alignments.
void vrna_fold_compound_free (vrna_fold_compound_t vc)
Free memory occupied by a vrna_fold_compound_t.
void vrna_fold_compound_add_auxdata (vrna_fold_compound_t vc, void data, vrna_callback_free_-
auxdata f)
Add auxiliary data to the vrna_fold_compound_t.
void vrna_fold_compound_add_callback (vrna_fold_compound_t vc, vrna_callback_recursion_status f)
Add a recursion status callback to the vrna_fold_compound_t.
This module provides interfaces that deal with the most basic data structure used in structure predicting and energy
evaluating function of the RNAlib.
Throughout the entire RNAlib, the vrna_fold_compound_t, is used to group information and data that is required
for structure prediction and energy evaluation. Here, you'll find interface functions to create, modify, and delete
vrna_fold_compound_t data structures.
The most basic data structure required by many functions throughout the RNAlib.
Note
Please read the documentation of this data structure carefully! Some attributes are only available for specific
types this data structure can adopt.
Generated by Doxygen
332 Module Documentation
Warning
Reading/Writing from/to attributes that are not within the scope of the current type usually result in undefined
behavior!
See also
SWIG Wrapper Notes This data structure is wrapped as an object fold_compound with several related functions
attached as methods.
A new fold_compound can be obtained by calling one of its constructors:
The resulting object has a list of attached methods which in most cases directly correspond
to functions that mainly operate on the corresponding C data structure:
sc
vrna_sc_s scs
vrna_hc_s
hc
domains_up
vrna_unstructured_domain_s vrna_fc_s
matrices
vrna_mx_mfe_s aux_grammar
vrna_gr_aux_s exp_matrices
vrna_mx_pf_s domains_struc
vrna_structured_domains_s
Generated by Doxygen
15.55 The Fold Compound 333
Data Fields
vrna_fc_type_e type
The type of the vrna_fold_compound_t.
unsigned int length
The length of the sequence (or sequence alignment)
int cutpoint
The position of the (cofold) cutpoint within the provided sequence. If there is no cutpoint, this field will be set to -1.
unsigned int strand_number
The strand number a particular nucleotide is associated with.
vrna_hc_t hc
The hard constraints data structure used for structure prediction.
vrna_mx_mfe_t matrices
The MFE DP matrices.
vrna_mx_pf_t exp_matrices
The PF DP matrices.
vrna_param_t params
The precomputed free energy contributions for each type of loop.
vrna_exp_param_t exp_params
The precomputed free energy contributions as Boltzmann factors.
int iindx
DP matrix accessor.
int jindx
DP matrix accessor.
vrna_callback_recursion_status stat_cb
Recursion status callback (usually called just before, and after recursive computations in the library.
void auxdata
A pointer to auxiliary, user-defined data.
vrna_callback_free_auxdata free_auxdata
A callback to free auxiliary user data whenever the fold_compound itself is free'd.
vrna_sd_t domains_struc
Additional structured domains.
vrna_ud_t domains_up
Additional unstructured domains.
vrna_gr_aux_t aux_grammar
Generated by Doxygen
334 Module Documentation
int window_size
window size for local folding sliding window approach
char ptype_local
Pair type array (for local folding)
Warning
Do not edit this attribute, it will be automagically set by the corresponding get() methods for the vrna_fold-
_compound_t. The value specified in this attribute dictates the set of other attributes to use within this data
structure.
Recursion status callback (usually called just before, and after recursive computations in the library.
See also
vrna_callback_recursion_status(), vrna_fold_compound_add_callback()
See also
vrna_fold_compound_add_auxdata(), vrna_fold_compound_t.free_auxdata
Generated by Doxygen
15.55 The Fold Compound 335
A callback to free auxiliary user data whenever the fold_compound itself is free'd.
See also
vrna_fold_compound_t.auxdata, vrna_callback_free_auxdata()
Warning
Only available if
type==VRNA_FC_TYPE_SINGLE
See also
vrna_sequence_encode()
Warning
Only available if
type==VRNA_FC_TYPE_SINGLE
Contains the numerical encoding of the pair type for each pair (i,j) used in MFE, Partition function and Evaluation
computations.
Note
This array is always indexed via jindx, in contrast to previously different indexing between mfe and pf variants!
Warning
Only available if
type==VRNA_FC_TYPE_SINGLE
See also
vrna_idx_col_wise(), vrna_ptypes()
Generated by Doxygen
336 Module Documentation
Deprecated This attribute will vanish in the future! It's meant for backward compatibility only!
Warning
Only available if
type==VRNA_FC_TYPE_SINGLE
Warning
Only available if
type==VRNA_FC_TYPE_SINGLE
Note
The end of the alignment is indicated by a NULL pointer in the second dimension
Warning
Only available if
type==VRNA_FC_TYPE_COMPARATIVE
Warning
Only available if
type==VRNA_FC_TYPE_COMPARATIVE
Warning
Only available if
type==VRNA_FC_TYPE_COMPARATIVE
Generated by Doxygen
15.55 The Fold Compound 337
Warning
Only available if
type==VRNA_FC_TYPE_COMPARATIVE
Warning
Only available if
type==VRNA_FC_TYPE_COMPARATIVE
Warning
Only available if
type==VRNA_FC_TYPE_COMPARATIVE
Warning
Only available if
type==VRNA_FC_TYPE_COMPARATIVE
Warning
Only available if
type==VRNA_FC_TYPE_COMPARATIVE
Generated by Doxygen
338 Module Documentation
Warning
Only available if
type==VRNA_FC_TYPE_COMPARATIVE
Precomputed array of pair types expressed as pairing scores indexed via iindx.
Warning
Only available if
type==VRNA_FC_TYPE_COMPARATIVE
Warning
Only available if
type==VRNA_FC_TYPE_COMPARATIVE
#include <ViennaRNA/data_structures.h>
See also
Generated by Doxygen
15.55 The Fold Compound 339
#include <ViennaRNA/data_structures.h>
See also
#include <ViennaRNA/data_structures.h>
Status message indicating that Partition function computations are about to begin.
See also
#include <ViennaRNA/data_structures.h>
See also
#include <ViennaRNA/data_structures.h>
Option flag to specify requirement of Minimum Free Energy (MFE) DP matrices and corresponding set of energy
parameters.
See also
#include <ViennaRNA/data_structures.h>
Option flag to specify requirement of Partition Function (PF) DP matrices and corresponding set of Boltzmann
factors.
See also
Generated by Doxygen
340 Module Documentation
#include <ViennaRNA/data_structures.h>
Option flag to specify that neither MFE, nor PF DP matrices are required.
Use this flag in conjuntion with VRNA_OPTION_MFE, and VRNA_OPTION_PF to save memory for a vrna_fold-
_compound_t obtained from vrna_fold_compound(), or vrna_fold_compound_comparative() in cases where only
energy evaluation but no structure prediction is required.
See also
#include <ViennaRNA/data_structures.h>
This type of user-implemented function usually deletes auxiliary data structures. The user must take care to free all
the memory occupied by the data structure passed.
Parameters
#include <ViennaRNA/data_structures.h>
See also
Parameters
status The status indicator
data The data structure that was assigned with vrna_fold_compound_add_auxdata()
status The status indicator
Generated by Doxygen
15.55 The Fold Compound 341
#include <ViennaRNA/data_structures.h>
An enumerator that is used to specify the type of a vrna_fold_compound_t.
Enumerator
15.55.6.1 vrna_fold_compound_t vrna_fold_compound ( const char sequence, vrna_md_t md_p, unsigned int
options )
#include <ViennaRNA/data_structures.h>
Retrieve a vrna_fold_compound_t data structure for single sequences and hybridizing sequences.
This function provides an easy interface to obtain a prefilled vrna_fold_compound_t by passing a single sequence,
or two contatenated sequences as input. For the latter, sequences need to be seperated by an '&' character like
this:
The optional parameter md_p can be used to specify the model details for successive computations based on
the content of the generated vrna_fold_compound_t. Passing NULL will instruct the function to use default model
details. The third parameter options may be used to specify dynamic programming (DP) matrix requirements.
Use the macros:
VRNA_OPTION_MFE
VRNA_OPTION_PF
VRNA_OPTION_WINDOW
VRNA_OPTION_EVAL_ONLY
VRNA_OPTION_DEFAULT
to specify the required type of computations that will be performed with the vrna_fold_compound_t.
If you just need the folding compound serving as a container for your data, you can simply pass VRNA_OPTIO-
N_DEFAULT to the option parameter. This creates a vrna_fold_compound_t without DP matrices, thus saving
memory. Subsequent calls of any structure prediction function will then take care of allocating the memory required
for the DP matrices. If you only intend to evaluate structures instead of actually predicting them, you may use the
VRNA_OPTION_EVAL_ONLY macro. This will seriously speedup the creation of the vrna_fold_compound_t.
Note
The sequence string must be uppercase, and should contain only RNA (resp. DNA) alphabet depending on
what energy parameter set is used
See also
Generated by Doxygen
342 Module Documentation
Parameters
Returns
#include <ViennaRNA/data_structures.h>
This function provides an easy interface to obtain a prefilled vrna_fold_compound_t by passing an alignment of
sequences.
The optional parameter md_p can be used to specify the model details for successive computations based on
the content of the generated vrna_fold_compound_t. Passing NULL will instruct the function to use default model
details. The third parameter options may be used to specify dynamic programming (DP) matrix requirements.
Use the macros:
VRNA_OPTION_MFE
VRNA_OPTION_PF
VRNA_OPTION_EVAL_ONLY
VRNA_OPTION_DEFAULT
to specify the required type of computations that will be performed with the vrna_fold_compound_t.
If you just need the folding compound serving as a container for your data, you can simply pass VRNA_OPTIO-
N_DEFAULT to the option parameter. This creates a vrna_fold_compound_t without DP matrices, thus saving
memory. Subsequent calls of any structure prediction function will then take care of allocating the memory required
for the DP matrices. If you only intend to evaluate structures instead of actually predicting them, you may use the
VRNA_OPTION_EVAL_ONLY macro. This will seriously speedup the creation of the vrna_fold_compound_t.
Note
The sequence strings must be uppercase, and should contain only RNA (resp. DNA) alphabet including gap
characters depending on what energy parameter set is used.
See also
Generated by Doxygen
15.55 The Fold Compound 343
Parameters
Returns
#include <ViennaRNA/data_structures.h>
See also
Parameters
#include <ViennaRNA/data_structures.h>
This function allows one to bind arbitrary data to a vrna_fold_compound_t which may later on be used by one of the
callback functions, e.g. vrna_callback_recursion_status(). To allow for proper cleanup of the memory occupied by
this auxiliary data, the user may also provide a pointer to a cleanup function that free's the corresponding memory.
This function will be called automatically when the vrna_fold_compound_t is free'd with vrna_fold_compound_free().
Note
Before attaching the arbitrary data pointer, this function will call the vrna_callback_free_auxdata() on any
pre-existing data that is already attached.
See also
vrna_callback_free_auxdata()
Parameters
#include <ViennaRNA/data_structures.h>
Binding a recursion status callback function to a vrna_fold_compound_t allows one to perform arbitrary operations
just before, or after an actual recursive computations, e.g. MFE prediction, is performed by the RNAlib. The callback
function will be provided with a pointer to its vrna_fold_compound_t, and a status message. Hence, it has complete
access to all variables that incluence the recursive computations.
See also
Parameters
Generated by Doxygen
15.56 The Dynamic Programming Matrices 345
This module provides interfaces that deal with creation and destruction of dynamic programming matrices used
within the RNAlib.
Data Structures
struct vrna_mx_mfe_s
Minimum Free Energy (MFE) Dynamic Programming (DP) matrices data structure required within the vrna_fold_-
compound_t. More...
struct vrna_mx_pf_s
Partition function (PF) Dynamic Programming (DP) matrices data structure required within the vrna_fold_compound-
_t. More...
Typedefs
Enumerations
Functions
This module provides interfaces that deal with creation and destruction of dynamic programming matrices used
within the RNAlib.
Generated by Doxygen
346 Module Documentation
Minimum Free Energy (MFE) Dynamic Programming (DP) matrices data structure required within the vrna_fold_-
compound_t.
Data Fields
vrna_mx_type_e type
unsigned int length
Length of the sequence, therefore an indicator of the size of the DP matrices.
Default DP matrices
Note
Note
Note
Partition function (PF) Dynamic Programming (DP) matrices data structure required within the vrna_fold_-
compound_t.
Generated by Doxygen
15.56 The Dynamic Programming Matrices 347
Data Fields
vrna_mx_type_e type
unsigned int length
FLT_OR_DBL scale
FLT_OR_DBL expMLbase
Default PF matrices
Note
Note
Note
#include <ViennaRNA/dp_matrices.h>
An enumerator that is used to specify the type of a polymorphic Dynamic Programming (DP) matrix data structure.
See also
vrna_mx_mfe_t, vrna_mx_pf_t
Enumerator
vrna_mfe_TwoD(), vrna_pf_TwoD()
Generated by Doxygen
348 Module Documentation
15.56.4.1 int vrna_mx_add ( vrna_fold_compound_t vc, vrna_mx_type_e type, unsigned int options )
#include <ViennaRNA/dp_matrices.h>
This function adds DP matrices of a specific type to the provided vrna_fold_compound_t, such that successive DP
recursion can be applied. The function caller has to specify which type of DP matrix is requested, see vrna_-
mx_type_e, and what kind of recursive algorithm will be applied later on, using the parameters type, and options,
respectively. For the latter, Minimum free energy (MFE), and Partition function (PF) computations are distinguished.
A third option that may be passed is VRNA_OPTION_HYBRID, indicating that auxiliary DP arrays are required for
RNA-RNA interaction prediction.
Note
Usually, there is no need to call this function, since the constructors of vrna_fold_compound_t are handling all
the DP matrix memory allocation.
See also
Parameters
Returns
#include <ViennaRNA/dp_matrices.h>
Free memory occupied by the Minimum Free Energy (MFE) Dynamic Programming (DP) matrices.
See also
Parameters
vc The vrna_fold_compound_t storing the MFE DP matrices that are to be erased from memory
Generated by Doxygen
15.56 The Dynamic Programming Matrices 349
#include <ViennaRNA/dp_matrices.h>
Free memory occupied by the Partition Function (PF) Dynamic Programming (DP) matrices.
See also
Parameters
vc The vrna_fold_compound_t storing the PF DP matrices that are to be erased from memory
Generated by Doxygen
350 Module Documentation
Heuristics to explore direct, optimal (re-)folding paths between two secondary structures.
Collaboration diagram for Direct refolding paths between two secondary structures:
Data Structures
struct vrna_path_s
An element of a refolding path list. More...
Typedefs
Functions
int vrna_path_findpath_saddle (vrna_fold_compound_t vc, const char struc1, const char struc2, int max)
Find energy of a saddle point between 2 structures (search only direct path)
vrna_path_t vrna_path_findpath (vrna_fold_compound_t vc, const char s1, const char s2, int maxkeep)
Find refolding path between 2 structures (search only direct path)
int find_saddle (const char seq, const char struc1, const char struc2, int max)
Find energy of a saddle point between 2 structures (search only direct path)
void free_path (vrna_path_t path)
Free memory allocated by get_path() function.
vrna_path_t get_path (const char seq, const char s1, const char s2, int maxkeep)
Find refolding path between 2 structures (search only direct path)
Heuristics to explore direct, optimal (re-)folding paths between two secondary structures.
Generated by Doxygen
15.57 Direct refolding paths between two secondary structures 351
See also
vrna_path_findpath()
Data Fields
double en
Free energy of current structure.
char s
Secondary structure in dot-bracket notation.
#include <ViennaRNA/findpath.h>
15.57.4.1 int vrna_path_findpath_saddle ( vrna_fold_compound_t vc, const char struc1, const char struc2, int max
)
#include <ViennaRNA/findpath.h>
Find energy of a saddle point between 2 structures (search only direct path)
This function uses an inplementation of the findpath algorithm [5] for near-optimal direct refolding path prediction.
Model details, and energy parameters are used as provided via the parameter 'vc'. The vrna_fold_compound_t
does not require memory for any DP matrices, but requires all most basic init values as one would get from a call
like this:
See also
Generated by Doxygen
352 Module Documentation
Parameters
Returns
15.57.4.2 vrna_path_t vrna_path_findpath ( vrna_fold_compound_t vc, const char s1, const char s2, int
maxkeep )
#include <ViennaRNA/findpath.h>
This function uses an inplementation of the findpath algorithm [5] for near-optimal direct refolding path prediction.
Model details, and energy parameters are used as provided via the parameter 'vc'. The vrna_fold_compound_t
does not require memory for any DP matrices, but requires all most basic init values as one would get from a call
like this:
See also
Parameters
Returns
15.57.4.3 int find_saddle ( const char seq, const char struc1, const char struc2, int max )
#include <ViennaRNA/findpath.h>
Find energy of a saddle point between 2 structures (search only direct path)
Generated by Doxygen
15.57 Direct refolding paths between two secondary structures 353
Parameters
seq RNA sequence
struc1 A pointer to the character array where the first secondary structure in dot-bracket notation will be
written to
struc2 A pointer to the character array where the second secondary structure in dot-bracket notation will be
written to
max integer how many strutures are being kept during the search
Returns
#include <ViennaRNA/findpath.h>
Parameters
15.57.4.5 vrna_path_t get_path ( const char seq, const char s1, const char s2, int maxkeep )
#include <ViennaRNA/findpath.h>
Parameters
seq RNA sequence
s1 A pointer to the character array where the first secondary structure in dot-bracket notation will be
written to
s2 A pointer to the character array where the second secondary structure in dot-bracket notation will
be written to
maxkeep integer how many strutures are being kept during the search
Returns
Generated by Doxygen
354 Module Documentation
Parsing, converting,
Utilities
and comparing sequences
Generated by Doxygen
15.58 Parsing, converting, and comparing sequences 355
#include <ViennaRNA/string_utils.h>
This definition should be used throughout the complete ViennaRNA package wherever a static array holding file-
names of output files is declared.
#include <ViennaRNA/string_utils.h>
this has to be smaller than FILENAME_MAX_LENGTH since in most cases, some suffix will be appended to the ID
#include <ViennaRNA/string_utils.h>
This function is a safe implementation for creating a formatted character array, similar to sprintf. Internally, it uses
the asprintf function if available to dynamically allocate a large enough character array to store the supplied content.
If asprintf is not available, mimic it's behavior using vsnprintf.
Note
The returned pointer of this function should always be passed to free() to release the allocated memory
See also
vrna_strdup_vprintf(), vrna_strcat_printf()
Parameters
Generated by Doxygen
356 Module Documentation
Returns
#include <ViennaRNA/string_utils.h>
Note
The returned pointer of this function should always be passed to free() to release the allocated memory
See also
Parameters
Returns
#include <ViennaRNA/string_utils.h>
This function is a safe implementation for appending a formatted character array, similar to a cobination of strcat and
sprintf. The function automatically allocates enough memory to store both, the previous content stored at dest and
the appended format string. If the dest pointer is NULL, the function allocate memory only for the format string.
The function returns the number of characters in the resulting string or -1 in case of an error.
See also
Parameters
dest The address of a char pointer where the formatted string is to be appended
format The format string (See also sprintf)
... The list of variables used to fill the format string
Generated by Doxygen
15.58 Parsing, converting, and comparing sequences 357
Returns
15.58.3.4 int vrna_strcat_vprintf ( char dest, const char format, va_list args )
#include <ViennaRNA/string_utils.h>
See also
Parameters
dest The address of a char pointer where the formatted string is to be appended
format The format string (See also sprintf)
... The list of variables used to fill the format string
Returns
#include <ViennaRNA/string_utils.h>
Parameters
Returns
#include <ViennaRNA/string_utils.h>
Generated by Doxygen
358 Module Documentation
Parameters
Returns
15.58.3.7 int vrna_hamming_distance_bound ( const char s1, const char s2, int n )
#include <ViennaRNA/string_utils.h>
This function is similar to vrna_hamming_distance() but instead of comparing both sequences up to their actual
length only the first 'n' characters are taken into account
Parameters
Returns
#include <ViennaRNA/string_utils.h>
Convert an input sequence (possibly containing DNA alphabet characters) to RNA alphabet.
Parameters
sequence The sequence to be converted
#include <ViennaRNA/string_utils.h>
Generated by Doxygen
15.58 Parsing, converting, and comparing sequences 359
Parameters
sequence The sequence to be converted
#include <ViennaRNA/string_utils.h>
If the cut-point position is less or equal to zero, this function just returns a copy of the provided string. Otherwise,
the cut-point character is set at the corresponding position
Parameters
string The original string
cp The cut-point position
Returns
#include <ViennaRNA/string_utils.h>
This function removes the cut-point indicating '&' character from a string and memorizes its position in a provided
integer variable. If not '&' is found in the input, the integer variable is set to -1. The function returns a copy of the
input string with the '&' being sliced out.
Parameters
string The original string
cp The cut-point position
Returns
A copy of the input string with the '&' being sliced out
Generated by Doxygen
360 Module Documentation
Parsing, converting,
Utilities comparing secondary
structures
Files
file RNAstruct.h
Parsing and Coarse Graining of Structures.
Functions
Generated by Doxygen
15.59 Parsing, converting, comparing secondary structures 361
Variables
Generated by Doxygen
362 Module Documentation
#include <ViennaRNA/RNAstruct.h>
Converts the full structure from bracket notation to the HIT notation including root.
Parameters
structure
Generated by Doxygen
15.59 Parsing, converting, comparing secondary structures 363
Returns
#include <ViennaRNA/RNAstruct.h>
Converts the full structure from bracket notation to the a coarse grained notation using the 'H' 'B' 'I' 'M' and 'R'
identifiers.
Parameters
structure
Returns
#include <ViennaRNA/RNAstruct.h>
Converts the full structure from bracket notation to the weighted coarse grained notation using the 'H' 'B' 'I' 'M' 'S' 'E'
and 'R' identifiers.
Parameters
structure
Returns
#include <ViennaRNA/RNAstruct.h>
Parameters
structure
Returns
Generated by Doxygen
364 Module Documentation
#include <ViennaRNA/RNAstruct.h>
Inserts missing 'S' identifiers in unweighted coarse grained structures as obtained from b2C().
Parameters
coarse
Returns
#include <ViennaRNA/RNAstruct.h>
Convert the full structure from bracket notation to the expanded notation including root.
Parameters
structure
Returns
#include <ViennaRNA/RNAstruct.h>
Restores the bracket notation from an expanded full or HIT tree, that is any tree using only identifiers 'U' 'P' and 'R'.
Parameters
ffull
Returns
#include <ViennaRNA/RNAstruct.h>
Strip weights from any weighted tree.
Generated by Doxygen
15.59 Parsing, converting, comparing secondary structures 365
Parameters
wcoarse
Returns
#include <ViennaRNA/RNAstruct.h>
Takes two aligned structures as produced by tree_edit_distance() function back to bracket notation with '_' as the
gap character. The result overwrites the input.
Parameters
align
#include <ViennaRNA/RNAstruct.h>
The function writes to the following global variables: loop_size, loop_degree, helix_size, loops, pairs, unpaired
Parameters
structure
Returns
#include <ViennaRNA/structure_utils.h>
Pack secondary secondary structure, 5:1 compression using base 3 encoding.
Returns a binary string encoding of the secondary structure using a 5:1 compression scheme. The string is NULL
terminated and can therefore be used with standard string functions such as strcmp(). Useful for programs that
need to keep many structures in memory.
See also
vrna_db_unpack()
Generated by Doxygen
366 Module Documentation
Parameters
struc The secondary structure in dot-bracket notation
Returns
#include <ViennaRNA/structure_utils.h>
Translate a compressed binary string produced by vrna_db_pack() back into the familiar dot-bracket notation.
See also
vrna_db_pack()
Parameters
packed The binary encoded packed secondary structure
Returns
#include <ViennaRNA/structure_utils.h>
Returns a newly allocated table, such that table[i]=j if (i.j) pair or 0 if i is unpaired, table[0] contains the length of the
structure.
Parameters
structure The secondary structure in dot-bracket notation
Returns
Generated by Doxygen
15.59 Parsing, converting, comparing secondary structures 367
#include <ViennaRNA/structure_utils.h>
Returns a newly allocated table, such that table[i]=j if (i.j) pair or 0 if i is unpaired, table[0] contains the length of the
structure.
In contrast to vrna_ptable() this function also recognizes the base pairs denoted by '[' and ']' brackets.
Parameters
Returns
#include <ViennaRNA/structure_utils.h>
Parameters
pt The pair table to be copied
Returns
#include <ViennaRNA/structure_utils.h>
returns a newly allocated table, such that: table[i]=j if (i.j) pair or 0 if i is unpaired, table[0] contains the length of the
structure. The special pseudoknotted H/ACA-mRNA structure is taken into account.
#include <ViennaRNA/structure_utils.h>
Generated by Doxygen
368 Module Documentation
Parameters
pt The pair table to be copied
Returns
#include <ViennaRNA/structure_utils.h>
Compute the "base pair" distance between two secondary structures s1 and s2.
The sequences should have the same length. dist = number of base pairs in one structure but not in the other same
as edit distance with open-pair close-pair as move-set
Parameters
str1 First structure in dot-bracket notation
str2 Second structure in dot-bracket notation
Returns
15.59.2.19 unsigned int vrna_refBPcnt_matrix ( const short reference_pt, unsigned int turn )
#include <ViennaRNA/structure_utils.h>
Make a reference base pair count matrix.
Get an upper triangular matrix containing the number of basepairs of a reference structure for each interval [i,j] with
i<j. Access it via iindx!!!
15.59.2.20 unsigned int vrna_refBPdist_matrix ( const short pt1, const short pt2, unsigned int turn )
#include <ViennaRNA/structure_utils.h>
Make a reference base pair distance matrix.
Get an upper triangular matrix containing the base pair distance of two reference structures for each interval [i,j]
with i<j. Access it via iindx!!!
#include <ViennaRNA/structure_utils.h>
Create a dot-backet/parenthesis structure from backtracking stack.
This function is capable to create dot-bracket structures from suboptimal structure prediction sensu M. Zuker
Generated by Doxygen
15.59 Parsing, converting, comparing secondary structures 369
Parameters
bp Base pair stack containing the traced base pairs
length The length of the structure
Returns
#include <ViennaRNA/structure_utils.h>
The dot-bracket string is parsed and for each base pair an entry in the plist is created. The probability of each pair
in the list is set by a function parameter.
The end of the plist is marked by sequence positions i as well as j equal to 0. This condition should be used to stop
looping over its entries
Parameters
struc The secondary structure in dot-bracket notation
pr The probability for each base pair used in the plist
Returns
#include <ViennaRNA/structure_utils.h>
The probability matrix provided via the vrna_fold_compound_t is parsed and all pair probabilities above the given
threshold are used to create an entry in the plist
The end of the plist is marked by sequence positions i as well as j equal to 0. This condition should be used to stop
looping over its entries
Parameters
Generated by Doxygen
370 Module Documentation
Returns
#include <ViennaRNA/structure_utils.h>
See also
vrna_plist()
Parameters
pairs A vrna_plist_t containing the pairs to be included in the dot-bracket string
n The length of the structure (number of nucleotides)
Returns
#include <ViennaRNA/structure_utils.h>
The dot-bracket string is parsed and for each base pair an entry in the plist is created. The probability of each pair
in the list is set by a function parameter.
The end of the plist is marked by sequence positions i as well as j equal to 0. This condition should be used to stop
looping over its entries
Parameters
pl A pointer to the vrna_plist_t that is to be created
struc The secondary structure in dot-bracket notation
pr The probability for each base pair
#include <ViennaRNA/structure_utils.h>
Generated by Doxygen
15.59 Parsing, converting, comparing secondary structures 371
Returns a binary string encoding of the secondary structure using a 5:1 compression scheme. The string is NULL
terminated and can therefore be used with standard string functions such as strcmp(). Useful for programs that
need to keep many structures in memory.
Parameters
struc The secondary structure in dot-bracket notation
Returns
#include <ViennaRNA/structure_utils.h>
Translate a compressed binary string produced by pack_structure() back into the familiar dot-bracket notation.
Parameters
packed The binary encoded packed secondary structure
Returns
#include <ViennaRNA/structure_utils.h>
Returns a newly allocated table, such that table[i]=j if (i.j) pair or 0 if i is unpaired, table[0] contains the length of the
structure.
Generated by Doxygen
372 Module Documentation
Parameters
structure The secondary structure in dot-bracket notation
Returns
#include <ViennaRNA/structure_utils.h>
Parameters
pt The pair table to be copied
Returns
#include <ViennaRNA/structure_utils.h>
Pair table for snoop align
#include <ViennaRNA/structure_utils.h>
returns a newly allocated table, such that: table[i]=j if (i.j) pair or 0 if i is unpaired, table[0] contains the length of the
structure. The special pseudoknotted H/ACA-mRNA structure is taken into account.
#include <ViennaRNA/structure_utils.h>
Compute the "base pair" distance between two secondary structures s1 and s2.
The sequences should have the same length. dist = number of base pairs in one structure but not in the other same
as edit distance with open-pair close-pair as move-set
Generated by Doxygen
15.59 Parsing, converting, comparing secondary structures 373
Parameters
str1 First structure in dot-bracket notation
str2 Second structure in dot-bracket notation
Returns
#include <ViennaRNA/structure_utils.h>
Get an upper triangular matrix containing the number of basepairs of a reference structure for each interval [i,j] with
i<j. Access it via iindx!!!
15.59.2.34 unsigned int compute_BPdifferences ( short pt1, short pt2, unsigned int turn )
#include <ViennaRNA/structure_utils.h>
Get an upper triangular matrix containing the base pair distance of two reference structures for each interval [i,j]
with i<j. Access it via iindx!!!
15.59.2.35 void assign_plist_from_pr ( vrna_plist_t pl, FLT_OR_DBL probs, int length, double cutoff )
#include <ViennaRNA/structure_utils.h>
The probability matrix given is parsed and all pair probabilities above the given threshold are used to create an entry
in the plist
The end of the plist is marked by sequence positions i as well as j equal to 0. This condition should be used to stop
looping over its entries
Note
Generated by Doxygen
374 Module Documentation
Parameters
out pl A pointer to the vrna_plist_t that is to be created
in probs The probability matrix used for creating the plist
in length The length of the RNA sequence
in cutoff The cutoff value
#include <ViennaRNA/structure_utils.h>
Note
#include <ViennaRNA/structure_utils.h>
Create a dot-backet/parenthesis structure from backtracking stack obtained by zuker suboptimal calculation in
cofold.c.
Note
15.59.2.38 void bppm_to_structure ( char structure, FLT_OR_DBL pr, unsigned int length )
#include <ViennaRNA/structure_utils.h>
Create a dot-bracket like structure string from base pair probability matrix.
#include <ViennaRNA/structure_utils.h>
Generated by Doxygen
15.60 Utilities for sequence alignments 375
Generated by Doxygen
376 Module Documentation
15.61 Functions to Read/Write several File Formats for RNA Sequences, Structures, and
Alignments
Functions dealing with file formats for RNA sequences, structures, and alignments.
Collaboration diagram for Functions to Read/Write several File Formats for RNA Sequences, Structures, and
Alignments:
Functions to Read/Write
several File Formats
Utilities
for RNA Sequences, Structures,
and Alignments
Files
file commands.h
Parse and apply different commands that alter the behavior of secondary structure prediction and evaluation.
file file_formats.h
Read and write different file formats for RNA sequences, structures.
file file_formats_msa.h
Functions dealing with file formats for Multiple Sequence Alignments (MSA)
file file_utils.h
Several utilities for file handling.
file ribo.h
Parse RiboSum Scoring Matrices for Covariance Scoring of Alignments.
Macros
#define VRNA_FILE_FORMAT_MSA_CLUSTAL 1U
Option flag indicating ClustalW formatted files.
#define VRNA_FILE_FORMAT_MSA_STOCKHOLM 2U
Option flag indicating Stockholm 1.0 formatted files.
#define VRNA_FILE_FORMAT_MSA_FASTA 4U
Option flag indicating FASTA (Pearson) formatted files.
#define VRNA_FILE_FORMAT_MSA_MAF 8U
Option flag indicating MAF formatted files.
#define VRNA_FILE_FORMAT_MSA_MIS 16U
Option flag indicating most informative sequence (MIS) output.
#define VRNA_FILE_FORMAT_MSA_DEFAULT
Option flag indicating the set of default file formats.
#define VRNA_FILE_FORMAT_MSA_NOCHECK 4096U
Option flag to disable validation of the alignment.
#define VRNA_FILE_FORMAT_MSA_UNKNOWN 8192U
Return flag of vrna_file_msa_detect_format() to indicate unknown or malformatted alignment.
Generated by Doxygen
15.61 Functions to Read/Write several File Formats for RNA Sequences, Structures, and Alignments 377
Functions
int vrna_file_msa_read (const char filename, char names, char aln, char id, char structure,
unsigned int options)
Read a multiple sequence alignment from file.
int vrna_file_msa_read_record (FILE fp, char names, char aln, char id, char structure, unsigned
int options)
Read a multiple sequence alignment from file handle.
unsigned int vrna_file_msa_detect_format (const char filename, unsigned int options)
Detect the format of a multiple sequence alignment file.
int vrna_file_msa_write (const char filename, const char names, const char aln, const char id, const
char structure, const char source, unsigned int options)
Write multiple sequence alignment file.
void vrna_file_copy (FILE from, FILE to)
Inefficient cp'.
char vrna_read_line (FILE fp)
Read a line of arbitrary length from a stream.
int vrna_mkdir_p (const char path)
Recursivly create a directory tree.
char vrna_basename (const char path)
Extract the filename from a file path.
char vrna_dirname (const char path)
Extract the directory part of a file path.
char vrna_filename_sanitize (const char name, const char replacement)
Sanitize a file name.
void vrna_file_helixlist (const char seq, const char db, float energy, FILE file)
Print a secondary structure as helix list.
Functions dealing with file formats for RNA sequences, structures, and alignments.
#include <ViennaRNA/file_formats_msa.h>
See also
Generated by Doxygen
378 Module Documentation
#include <ViennaRNA/file_formats_msa.h>
See also
#include <ViennaRNA/file_formats_msa.h>
See also
#include <ViennaRNA/file_formats_msa.h>
See also
#include <ViennaRNA/file_formats_msa.h>
The default reference sequence output for an alignment is simply a consensus sequence. This flag allows to write
the most informative equence (MIS) instead.
See also
vrna_file_msa_write()
Generated by Doxygen
15.61 Functions to Read/Write several File Formats for RNA Sequences, Structures, and Alignments 379
#include <ViennaRNA/file_formats_msa.h>
Value:
( \
VRNA_FILE_FORMAT_MSA_CLUSTAL \
| VRNA_FILE_FORMAT_MSA_STOCKHOLM \
| VRNA_FILE_FORMAT_MSA_FASTA \
| VRNA_FILE_FORMAT_MSA_MAF \
)
See also
#include <ViennaRNA/file_formats_msa.h>
See also
vrna_file_msa_read(), vrna_file_msa_read_record()
#include <ViennaRNA/file_formats_msa.h>
See also
vrna_file_msa_detect_format()
15.61.3.1 void vrna_file_helixlist ( const char seq, const char db, float energy, FILE file )
#include <ViennaRNA/file_formats.h>
Generated by Doxygen
380 Module Documentation
Parameters
seq The RNA sequence
db The structure in dot-bracket format
energy Free energy of the structure in kcal/mol
file The file handle used to print to (print defaults to 'stdout' if(file == NULL) )
15.61.3.2 int vrna_file_msa_read ( const char filename, char names, char aln, char id, char structure,
unsigned int options )
#include <ViennaRNA/file_formats_msa.h>
This function reads the (first) multiple sequence alignment from an input file. The read alignment is split into the
sequence id/name part and the actual sequence information and stored in memory as arrays of ids/names and
sequences. If the alignment file format allows for additional information, such as an ID of the entire alignment or
consensus structure information, this data is retrieved as well and made available. The options parameter allows
to specify the set of alignment file formats that should be used to retrieve the data. If 0 is passed as option, the list
of alignment file formats defaults to VRNA_FILE_FORMAT_MSA_DEFAULT.
Currently, the list of parsable multiple sequence alignment file formats consists of:
ClustalW format
MAF format
Note
After successfully reading an alignment, this function performs a validation of the data that includes unique-
ness of the sequence identifiers, and equal sequence lengths. This check can be deactivated by passing
VRNA_FILE_FORMAT_MSA_NOCHECK in the options parameter.
See also
Parameters
Generated by Doxygen
15.61 Functions to Read/Write several File Formats for RNA Sequences, Structures, and Alignments 381
Returns
15.61.3.3 int vrna_file_msa_read_record ( FILE fp, char names, char aln, char id, char structure, unsigned
int options )
#include <ViennaRNA/file_formats_msa.h>
Similar to vrna_file_msa_read(), this function reads a multiple sequence alignment from an input file handle. Since
using a file handle, this function is not limited to the first alignment record, but allows for looping over all alignments
within the input.
The read alignment is split into the sequence id/name part and the actual sequence information and stored in
memory as arrays of ids/names and sequences. If the alignment file format allows for additional information, such
as an ID of the entire alignment or consensus structure information, this data is retrieved as well and made available.
The options parameter allows to specify the alignment file format used to retrieve the data. A single format must
be specified here, see vrna_file_msa_detect_format() for helping to determine the correct MSA file format.
Currently, the list of parsable multiple sequence alignment file formats consists of:
ClustalW format
MAF format
Note
After successfully reading an alignment, this function performs a validation of the data that includes unique-
ness of the sequence identifiers, and equal sequence lengths. This check can be deactivated by passing
VRNA_FILE_FORMAT_MSA_NOCHECK in the options parameter.
See also
Parameters
Generated by Doxygen
382 Module Documentation
Returns
15.61.3.4 unsigned int vrna_file_msa_detect_format ( const char filename, unsigned int options )
#include <ViennaRNA/file_formats_msa.h>
This function attempts to determine the format of a file that supposedly contains a multiple sequence alignment
(MSA). This is useful in cases where a MSA file contains more than a single record and therefore vrna_file_msa-
_read() can not be applied, since it only retrieves the first. Here, one can try to guess the correct file format using
this function and then loop over the file, record by record using one of the low-level record retrieval functions for the
corresponding MSA file format.
Note
This function parses the entire first record within the specified file. As a result, it returns VRNA_FILE_FO-
RMAT_MSA_UNKNOWN not only if it can't detect the file's format, but also in cases where the file doesn't
contain sequences!
See also
Parameters
Returns
15.61.3.5 int vrna_file_msa_write ( const char filename, const char names, const char aln, const char id, const
char structure, const char source, unsigned int options )
#include <ViennaRNA/file_formats_msa.h>
Note
Generated by Doxygen
15.61 Functions to Read/Write several File Formats for RNA Sequences, Structures, and Alignments 383
Parameters
Returns
#include <ViennaRNA/file_utils.h>
Returns a pointer to the resulting string. The necessary memory is allocated and should be released using free()
when the string is no longer needed.
Parameters
fp A file pointer to the stream where the function should read from
Returns
#include <ViennaRNA/file_utils.h>
Returns a new file name where all invalid characters are substituted by a replacement character. If no replacement
character is supplied, invalid characters are simply removed from the filename. File names may also never exceed
a length of 255 characters. Longer file names will undergo a 'smart' truncation process, where the filenames suffix,
i.e. everything after the last dot '.', is attempted to be kept intact. Hence, only the filename part before the suffix
is reduced in such a way that the total filename complies to the length restriction of 255 characters. If no suffix is
present or the suffix itself already exceeds the maximum length, the filename is simply truncated from the back of
the string.
backslash '\'
Generated by Doxygen
384 Module Documentation
slash '/'
asterisk ''
colon ':'
Furthermore, the (resulting) file name must not be a reserved file name, such as:
'.'
'..'
Note
This function allocates a new block of memory for the sanitized string. It also may return (a) NULL if the input
is pointing to NULL, or (b) an empty string if the input only consists of invalid characters which are simply
removed!
Parameters
Returns
Generated by Doxygen
15.62 Functions for Creating RNA Secondary Structures Plots, Dot-Plots, and More 385
15.62 Functions for Creating RNA Secondary Structures Plots, Dot-Plots, and More
Collaboration diagram for Functions for Creating RNA Secondary Structures Plots, Dot-Plots, and More:
Files
file naview.h
file plot_aln.h
Various functions for plotting Sequence / Structure Alignments.
file plot_layouts.h
Secondary structure plot layout algorithms.
file plot_structure.h
Various functions for plotting RNA secondary structures.
file PS_dot.h
Various functions for plotting RNA secondary structures, dot-plots and other visualizations.
int PS_color_aln (const char structure, const char filename, const char seqs[ ], const char names[ ])
Produce PostScript sequence alignment color-annotated by consensus structure.
int aliPS_color_aln (const char structure, const char filename, const char seqs[ ], const char names[ ])
int vrna_file_PS_rnaplot (const char seq, const char structure, const char file, vrna_md_t md_p)
Produce a secondary structure graph in PostScript and write it to 'filename'.
int vrna_file_PS_rnaplot_a (const char seq, const char structure, const char file, const char pre, const
char post, vrna_md_t md_p)
Produce a secondary structure graph in PostScript including additional annotation macros and write it to 'filename'.
Generated by Doxygen
386 Module Documentation
int gmlRNA (char string, char structure, char ssfile, char option)
Produce a secondary structure graph in Graph Meta Language (gml) and write it to a file.
int ssv_rna_plot (char string, char structure, char ssfile)
Produce a secondary structure graph in SStructView format.
int svg_rna_plot (char string, char structure, char ssfile)
Produce a secondary structure plot in SVG format and write it to a file.
int xrna_plot (char string, char structure, char ssfile)
Produce a secondary structure plot for further editing in XRNA.
int PS_rna_plot (char string, char structure, char file)
Produce a secondary structure graph in PostScript and write it to 'filename'.
int PS_rna_plot_a (char string, char structure, char file, char pre, char post)
Produce a secondary structure graph in PostScript including additional annotation macros and write it to 'filename'.
int PS_rna_plot_a_gquad (char string, char structure, char ssfile, char pre, char post)
Produce a secondary structure graph in PostScript including additional annotation macros and write it to 'filename'
(detect and draw g-quadruplexes)
int PS_dot_plot_list (char seq, char filename, plist pl, plist mf, char comment)
Produce a postscript dot-plot from two pair lists.
int PS_dot_plot (char string, char file)
Produce postscript dot-plot.
#include <ViennaRNA/plot_layouts.h>
This is the plot type definition for several RNA structure plotting functions telling them to use Simple plotting algo-
rithm
See also
#include <ViennaRNA/plot_layouts.h>
This is the plot type definition for several RNA structure plotting functions telling them to use Naview plotting algo-
rithm
See also
Generated by Doxygen
15.62 Functions for Creating RNA Secondary Structures Plots, Dot-Plots, and More 387
#include <ViennaRNA/plot_layouts.h>
This is the plot type definition for several RNA structure plotting functions telling them to produce a Circular plot
See also
15.62.3.1 int aliPS_color_aln ( const char structure, const char filename, const char seqs[ ], const char names[ ] )
#include <ViennaRNA/plot_aln.h>
#include <ViennaRNA/plot_layouts.h>
Calculate nucleotide coordinates for secondary structure plot the Simple way
See also
Parameters
Returns
#include <ViennaRNA/plot_layouts.h>
This function calculates the coordinates of nucleotides mapped in equal distancies onto a unit circle.
Generated by Doxygen
388 Module Documentation
Note
In order to draw nice arcs using quadratic bezier curves that connect base pairs one may calculate a second
tangential point P t in addition to the actual R2 coordinates. the simplest way to do so may be to compute a
radius scaling factor rs in the interval [0, 1] that weights the proportion of base pair span to the actual length of
the sequence. This scaling factor can then be used to calculate the coordinates for P t , i.e. Pxt [i] = X[i] rs
and Pyt [i] = Y [i] rs.
See also
Parameters
Returns
15.62.3.4 int vrna_file_PS_rnaplot ( const char seq, const char structure, const char file, vrna_md_t md_p )
#include <ViennaRNA/plot_structure.h>
Note that this function has changed from previous versions and now expects the structure to be plotted in dot-bracket
notation as an argument. It does not make use of the global base_pair array anymore.
Parameters
seq The RNA sequence
structure The secondary structure in dot-bracket notation
file The filename of the postscript output
md_p Model parameters used to generate a commandline option string in the output (Maybe NULL)
Returns
1 on success, 0 otherwise
15.62.3.5 int vrna_file_PS_rnaplot_a ( const char seq, const char structure, const char file, const char pre, const char
post, vrna_md_t md_p )
#include <ViennaRNA/plot_structure.h>
Generated by Doxygen
15.62 Functions for Creating RNA Secondary Structures Plots, Dot-Plots, and More 389
Produce a secondary structure graph in PostScript including additional annotation macros and write it to 'filename'.
Same as vrna_file_PS_rnaplot() but adds extra PostScript macros for various annotations (see generated PS code).
The 'pre' and 'post' variables contain PostScript code that is verbatim copied in the resulting PS file just before and
after the structure plot. If both arguments ('pre' and 'post') are NULL, no additional macros will be printed into the
PostScript.
Parameters
seq The RNA sequence
structure The secondary structure in dot-bracket notation
file The filename of the postscript output
pre PostScript code to appear before the secondary structure plot
post PostScript code to appear after the secondary structure plot
md_p Model parameters used to generate a commandline option string in the output (Maybe NULL)
Returns
1 on success, 0 otherwise
15.62.3.6 int gmlRNA ( char string, char structure, char ssfile, char option )
#include <ViennaRNA/plot_structure.h>
Produce a secondary structure graph in Graph Meta Language (gml) and write it to a file.
If 'option' is an uppercase letter the RNA sequence is used to label nodes, if 'option' equals 'X' or 'x' the resulting file
will coordinates for an initial layout of the graph.
Parameters
string The RNA sequence
structure The secondary structure in dot-bracket notation
ssfile The filename of the gml output
option The option flag
Returns
1 on success, 0 otherwise
#include <ViennaRNA/plot_structure.h>
Generated by Doxygen
390 Module Documentation
Parameters
string The RNA sequence
structure The secondary structure in dot-bracket notation
ssfile The filename of the ssv output
Returns
1 on success, 0 otherwise
#include <ViennaRNA/plot_structure.h>
Parameters
string The RNA sequence
structure The secondary structure in dot-bracket notation
ssfile The filename of the svg output
Returns
1 on success, 0 otherwise
#include <ViennaRNA/plot_structure.h>
Parameters
string The RNA sequence
structure The secondary structure in dot-bracket notation
ssfile The filename of the xrna output
Returns
1 on success, 0 otherwise
#include <ViennaRNA/plot_structure.h>
Produce a secondary structure graph in PostScript and write it to 'filename'.
Generated by Doxygen
15.62 Functions for Creating RNA Secondary Structures Plots, Dot-Plots, and More 391
15.62.3.11 int PS_rna_plot_a ( char string, char structure, char file, char pre, char post )
#include <ViennaRNA/plot_structure.h>
Produce a secondary structure graph in PostScript including additional annotation macros and write it to 'filename'.
15.62.3.12 int PS_rna_plot_a_gquad ( char string, char structure, char ssfile, char pre, char post )
#include <ViennaRNA/plot_structure.h>
Produce a secondary structure graph in PostScript including additional annotation macros and write it to 'filename'
(detect and draw g-quadruplexes)
15.62.3.13 int PS_dot_plot_list ( char seq, char filename, plist pl, plist mf, char comment )
#include <ViennaRNA/PS_dot.h>
This function reads two plist structures (e.g. base pair probabilities and a secondary structure) as produced by
assign_plist_from_pr() and assign_plist_from_db() and produces a postscript "dot plot" that is written to 'filename'.
Using base pair probabilities in the first and mfe structure in the second plist, the resulting "dot plot" represents each
base pairing probability by a square of corresponding area in a upper triangle matrix. The lower part of the matrix
contains the minimum free energy structure.
See also
assign_plist_from_pr(), assign_plist_from_db()
Parameters
seq The RNA sequence
filename A filename for the postscript output
pl The base pair probability pairlist
mf The mfe secondary structure pairlist
comment A comment
Generated by Doxygen
392 Module Documentation
Returns
#include <ViennaRNA/PS_dot.h>
Wrapper to PS_dot_plot_list
Reads base pair probabilities produced by pf_fold() from the global array pr and the pair list base_pair produced by
fold() and produces a postscript "dot plot" that is written to 'filename'. The "dot plot" represents each base pairing
probability by a square of corresponding area in a upper triangle matrix. The lower part of the matrix contains the
minimum free energy
Note
Deprecated This function is deprecated and will be removed soon! Use PS_dot_plot_list() instead!
#include <ViennaRNA/plot_layouts.h>
Current possibility are 0 for a simple radial drawing or 1 for the modified radial drawing taken from the naview
program of [3].
Note
To provide thread safety please do not rely on this global variable in future implementations but pass a plot
type flag directly to the function that decides which layout algorithm it may use!
See also
Generated by Doxygen
15.63 Functions to convert between various units 393
Functions to convert
Utilities
between various units
Files
file units.h
Physical Units and Functions to convert them into each other.
#include <ViennaRNA/units.h>
Energy / Work Units.
See also
vrna_convert_energy()
Enumerator
VRNA_UNIT_J Joule ( 1 J = 1 kg m2 s2 )
VRNA_UNIT_KJ Kilojoule ( 1 kJ = 1, 000 J )
VRNA_UNIT_CAL_IT Calorie (International (Steam) Table, 1 calIT = 4.1868 J )
VRNA_UNIT_DACAL_IT Decacolorie (International (Steam) Table, 1 dacalIT = 10 calIT = 41.868 J )
VRNA_UNIT_KCAL_IT Kilocalorie (International (Steam) Table, 1 kcalIT = 4.1868 kJ )
VRNA_UNIT_CAL Calorie (Thermochemical, 1 calth = 4.184 J )
VRNA_UNIT_DACAL Decacalorie (Thermochemical, 1 dacalth = 10 calth = 41.84 J )
VRNA_UNIT_KCAL Kilocalorie (Thermochemical, 1 kcalth = 4.184 kJ )
VRNA_UNIT_G_TNT g TNT ( 1 g TNT = 1, 000 calth = 4, 184 J )
VRNA_UNIT_KG_TNT kg TNT ( 1 kg TNT = 1, 000 kcalth = 4, 184 kJ )
VRNA_UNIT_T_TNT ton TNT ( 1 t TNT = 1, 000, 000 kcalth = 4, 184 M J )
VRNA_UNIT_EV Electronvolt ( 1 eV = 1.602176565 1019 J )
VRNA_UNIT_WH Watt hour ( 1 W h = 1 W 3, 600s = 3, 600 J = 3.6 kJ )
VRNA_UNIT_KWH Kilowatt hour ( 1 kW h = 1 kW 3, 600 s = 3, 600 kJ = 3.6 M J )
Generated by Doxygen
394 Module Documentation
#include <ViennaRNA/units.h>
Temperature Units.
See also
vrna_convert_temperature()
Enumerator
#include <ViennaRNA/units.h>
See also
vrna_unit_energy_e
Parameters
energy Input energy value
from Input unit
to Output unit
Returns
#include <ViennaRNA/units.h>
Convert between temperature units.
Generated by Doxygen
15.63 Functions to convert between various units 395
See also
vrna_unit_temperature_e
Parameters
temp Input temperature value
from Input unit
to Output unit
Returns
Generated by Doxygen
396 Module Documentation
Generated by Doxygen
Chapter 16
The documentation for this struct was generated from the following file:
ViennaRNA/move_set.h
this is a workarround for the SWIG Perl Wrapper RNA plot function that returns an array of type COORDINATE
this is a workarround for the SWIG Perl Wrapper RNA plot function that returns an array of type COORDINATE
The documentation for this struct was generated from the following file:
ViennaRNA/plot_layouts.h
The documentation for this struct was generated from the following file:
ViennaRNA/dist_vars.h
The documentation for this struct was generated from the following file:
ViennaRNA/dist_vars.h
Postorder_list
postorder_list
Tree
The documentation for this struct was generated from the following file:
ViennaRNA/dist_vars.h
Generated by Doxygen
16.6 TwoDpfold_vars Struct Reference 399
pf_params
vrna_exp_param_s exp_params
model_details
TwoDpfold_vars
vrna_sc_s sc
vrna_md_s scs
model_details compatibility
vrna_structured_domains_s
domains_struc
vrna_param_s params
vrna_fc_s
hc
vrna_hc_s
domains_up
vrna_unstructured_domain_s
matrices
vrna_mx_mfe_s
aux_grammar
vrna_gr_aux_s
exp_matrices
vrna_mx_pf_s
Data Fields
char ptype
Precomputed array of pair types.
char sequence
The input sequence.
short S1
The input sequences in numeric form.
unsigned int maxD1
Maximum allowed base pair distance to first reference.
unsigned int maxD2
Maximum allowed base pair distance to second reference.
int my_iindx
Index for moving in quadratic distancy dimensions.
int jindx
Index for moving in the triangular matrix qm1.
unsigned int referenceBPs1
Matrix containing number of basepairs of reference structure1 in interval [i,j].
unsigned int referenceBPs2
Matrix containing number of basepairs of reference structure2 in interval [i,j].
unsigned int bpdist
Matrix containing base pair distance of reference structure 1 and 2 on interval [i,j].
unsigned int mm1
Maximum matching matrix, reference struct 1 disallowed.
unsigned int mm2
Maximum matching matrix, reference struct 2 disallowed.
Generated by Doxygen
400 Data Structure Documentation
Deprecated This data structure will be removed from the library soon! Use vrna_fold_compound_t and the corre-
sponding functions vrna_fold_compound_TwoD(), vrna_pf_TwoD(), and vrna_fold_compound_free()
instead!
The documentation for this struct was generated from the following file:
ViennaRNA/2Dpfold.h
See also
The documentation for this struct was generated from the following file:
ViennaRNA/commands.h
vrna_color_s
color
vrna_data_linear_s
right
left
bottom
top
vrna_dotplot_auxdata_t
The documentation for this struct was generated from the following file:
Generated by Doxygen
16.9 vrna_gr_aux_s Struct Reference 401
ViennaRNA/PS_dot.h
The documentation for this struct was generated from the following file:
ViennaRNA/grammar.h
The documentation for this struct was generated from the following file:
ViennaRNA/structure_utils.h
The data structure that contains the complete model details used throughout the calculations.
Data Fields
double temperature
The temperature used to scale the thermodynamic parameters.
double betaScale
A scaling factor for the thermodynamic temperature of the Boltzmann factors.
int dangles
Specifies the dangle model used in any energy evaluation (0,1,2 or 3)
int special_hp
Include special hairpin contributions for tri, tetra and hexaloops.
int noLP
Only consider canonical structures, i.e. no 'lonely' base pairs.
int noGU
Do not allow GU pairs.
int noGUclosure
Do not allow loops to be closed by GU pair.
int logML
Use logarithmic scaling for multiloops.
int circ
Generated by Doxygen
402 Data Structure Documentation
The data structure that contains the complete model details used throughout the calculations.
For convenience reasons, we provide the type name vrna_md_t to address this data structure without the use of
the struct keyword
Generated by Doxygen
16.11 vrna_md_s Struct Reference 403
See also
SWIG Wrapper Notes This data structure is wrapped as an object md with multiple related functions attached as
methods.
A new set of default parameters can be obtained by calling the constructure of md:
The resulting object has a list of attached methods which directly correspond to functions
that mainly operate on the corresponding C data structure:
reset() vrna_md_set_default()
set_from_globals() set_model_details()
option_string() vrna_md_option_string()
Note, that default parameters can be modified by directly setting any of the following global
variables. Internally, getting/setting default parameters using their global variable repre-
sentative translates into calls of the following functions, therefore these wrappers for these
functions do not exist in the scripting language interface(s):
Generated by Doxygen
404 Data Structure Documentation
If set to 0 no stabilizing energies are assigned to bases adjacent to helices in free ends and multiloops (so called
dangling ends). Normally (dangles = 1) dangling end energies are assigned only to unpaired bases and a base
cannot participate simultaneously in two dangling ends. In the partition function algorithm vrna_pf() these checks
are neglected. To provide comparability between free energy minimization and partition function algorithms, the
default setting is 2. This treatment of dangling ends gives more favorable energies to helices directly adjacent to
one another, which can be beneficial since such helices often do engage in stabilizing interactions through co-axial
stacking.
If set to 3 co-axial stacking is explicitly included for adjacent helices in multiloops. The option affects only mfe
folding and energy evaluation (vrna_mfe() and vrna_eval_structure()), as well as suboptimal folding (vrna_subopt())
via re-evaluation of energies. Co-axial stacking with one intervening mismatch is not considered so far.
Note
Some function do not implement all dangle model but only a subset of (0,1,2,3). In particular, partition function
algorithms can only handle 0 and 2. Read the documentation of the particular recurrences or energy evaluation
function for information about the provided dangle model.
Note
The default value for this field is TURN, however, it may be 0 in cofolding context.
The documentation for this struct was generated from the following file:
ViennaRNA/model.h
Generated by Doxygen
16.12 vrna_pinfo_s Struct Reference 405
Data Fields
unsigned i
nucleotide position i
unsigned j
nucleotide position j
float p
Probability.
float ent
Pseudo entropy for p(i, j) = Si + Sj pi j ln(pi j).
short bp [8]
Frequencies of pair_types.
char comp
1 iff pair is in mfe structure
For each base pair (i,j) with i,j in [0, n-1] the structure lists:
The documentation for this struct was generated from the following file:
ViennaRNA/aln_util.h
The documentation for this struct was generated from the following file:
ViennaRNA/constraints_ligand.h
Generated by Doxygen
406 Data Structure Documentation
The documentation for this struct was generated from the following file:
ViennaRNA/structured_domains.h
Data Fields
float energy
Free Energy of structure in kcal/mol.
char structure
Structure in dot-bracket notation.
The documentation for this struct was generated from the following file:
ViennaRNA/subopt.h
The documentation for this struct was generated from the following file:
ViennaRNA/unstructured_domains.h
Generated by Doxygen
Chapter 17
File Documentation
This file contains the free energy parameters used in ViennaRNAPackage 1.8.4. They are summarized in:
D.H.Mathews, J. Sabina, M. ZUker, D.H. Turner "Expanded sequence dependence of thermodynamic parameters
improves prediction of RNA secondary structure" JMB, 288, pp 911-940, 1999
A. Walter, D Turner, J Kim, M Lyttle, P M"uller, D Mathews, M Zuker "Coaxial stckaing of helices enhances binding
of oligoribonucleotides.." PNAS, 91, pp 9218-9222, 1994
D.H. Turner, N. Sugimoto, and S.M. Freier. "RNA Structure Prediction", Ann. Rev. Biophys. Biophys. Chem. 17,
167-192, 1988.
John A.Jaeger, Douglas H.Turner, and Michael Zuker. "Improved predictions of secondary structures for RNA",
PNAS, 86, 7706-7710, October 1989.
L. He, R. Kierzek, J. SantaLucia, A.E. Walter, D.H. Turner "Nearest-Neughbor Parameters for GU Mismatches...."
Biochemistry 1991, 30 11124-11132
A.E. Peritz, R. Kierzek, N, Sugimoto, D.H. Turner "Thermodynamic Study of Internal Loops in Oligoribonucleotides..."
Biochemistry 1991, 30, 64286435
Free energy parameters for interior loop contributions needed by the parameter file conversion functions.
408 File Documentation
Free energy parameters for interior loop contributions needed by the parameter file conversion functions.
ViennaRNA/2Dfold.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Data Structures
struct vrna_sol_TwoD_t
Solution element returned from vrna_mfe_TwoD() More...
struct TwoDfold_vars
Variables compound for 2Dfold MFE folding. More...
Typedefs
Functions
Generated by Doxygen
17.4 ViennaRNA/2Dpfold.h File Reference 409
ViennaRNA/2Dpfold.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Data Structures
struct vrna_sol_TwoD_pf_t
Solution element returned from vrna_pf_TwoD() More...
struct TwoDpfold_vars
Variables compound for 2Dfold partition function folding.
Typedefs
typedef struct vrna_sol_TwoD_pf_t vrna_sol_TwoD_pf_t
Solution element returned from vrna_pf_TwoD()
Functions
vrna_sol_TwoD_pf_t vrna_pf_TwoD (vrna_fold_compound_t vc, int maxDistance1, int maxDistance2)
Compute the partition function for all distance classes.
char vrna_pbacktrack_TwoD (vrna_fold_compound_t vc, int d1, int d2)
Sample secondary structure representatives from a set of distance classes according to their Boltzmann probability.
char vrna_pbacktrack5_TwoD (vrna_fold_compound_t vc, int d1, int d2, unsigned int length)
Sample secondary structure representatives with a specified length from a set of distance classes according to their
Boltzmann probability.
TwoDpfold_vars get_TwoDpfold_variables (const char seq, const char structure1, char structure2, int
circ)
Get a datastructure containing all necessary attributes and global folding switches.
void destroy_TwoDpfold_variables (TwoDpfold_vars vars)
Free all memory occupied by a TwoDpfold_vars datastructure.
vrna_sol_TwoD_pf_t TwoDpfoldList (TwoDpfold_vars vars, int maxDistance1, int maxDistance2)
Compute the partition function for all distance classes.
char TwoDpfold_pbacktrack (TwoDpfold_vars vars, int d1, int d2)
Sample secondary structure representatives from a set of distance classes according to their Boltzmann probability.
char TwoDpfold_pbacktrack5 (TwoDpfold_vars vars, int d1, int d2, unsigned int length)
Sample secondary structure representatives with a specified length from a set of distance classes according to their
Boltzmann probability.
Generated by Doxygen
410 File Documentation
17.4.2.1 TwoDpfold_vars get_TwoDpfold_variables ( const char seq, const char structure1, char structure2, int circ
)
Get a datastructure containing all necessary attributes and global folding switches.
This function prepares all necessary attributes and matrices etc which are needed for a call of TwoDpfold() . A
snapshot of all current global model switches (dangles, temperature and so on) is done and stored in the returned
datastructure. Additionally, all matrices that will hold the partition function values are prepared.
Deprecated Use the new API that relies on vrna_fold_compound_t and the corresponding functions vrna_fold_-
compound_TwoD(), vrna_pf_TwoD(), and vrna_fold_compound_free() instead!
Parameters
seq the RNA sequence in uppercase format with letters from the alphabet {AUCG}
structure1 the first reference structure in dot-bracket notation
structure2 the second reference structure in dot-bracket notation
circ a switch indicating if the sequence is linear (0) or circular (1)
Returns
This function free's all memory occupied by a datastructure obtained from from get_TwoDpfold_variabless() or get-
_TwoDpfold_variables_from_MFE()
Deprecated Use the new API that relies on vrna_fold_compound_t and the corresponding functions vrna_fold_-
compound_TwoD(), vrna_pf_TwoD(), and vrna_fold_compound_free() instead!
See also
get_TwoDpfold_variables(), get_TwoDpfold_variables_from_MFE()
Parameters
Generated by Doxygen
17.4 ViennaRNA/2Dpfold.h File Reference 411
This function computes the partition functions for all distance classes according the two reference structures spec-
ified in the datastructure 'vars'. Similar to TwoDfold() the arguments maxDistance1 and maxDistance2 specify the
maximum distance to both reference structures. A value of '-1' in either of them makes the appropriate distance
restrictionless, i.e. all basepair distancies to the reference are taken into account during computation. In case there
is a restriction, the returned solution contains an entry where the attribute k=l=-1 contains the partition function for
all structures exceeding the restriction. A values of INF in the attribute 'k' of the returned list denotes the end of the
list
Deprecated Use the new API that relies on vrna_fold_compound_t and the corresponding functions vrna_fold_-
compound_TwoD(), vrna_pf_TwoD(), and vrna_fold_compound_free() instead!
See also
Parameters
vars the datastructure containing all necessary folding attributes and matrices
maxDistance1 the maximum basepair distance to reference1 (may be -1)
maxDistance2 the maximum basepair distance to reference2 (may be -1)
Returns
Sample secondary structure representatives from a set of distance classes according to their Boltzmann probability.
If the argument 'd1' is set to '-1', the structure will be backtracked in the distance class where all structures exceeding
the maximum basepair distance to either of the references reside.
Precondition
The argument 'vars' must contain precalculated partition function matrices, i.e. a call to TwoDpfold() preceding
this function is mandatory!
Deprecated Use the new API that relies on vrna_fold_compound_t and the corresponding functions vrna_fold-
_compound_TwoD(), vrna_pf_TwoD(), vrna_pbacktrack_TwoD(), and vrna_fold_compound_free() in-
stead!
See also
TwoDpfold()
Generated by Doxygen
412 File Documentation
Parameters
in vars the datastructure containing all necessary folding attributes and matrices
in d1 the distance to reference1 (may be -1)
in d2 the distance to reference2
Returns
17.4.2.5 char TwoDpfold_pbacktrack5 ( TwoDpfold_vars vars, int d1, int d2, unsigned int length )
Sample secondary structure representatives with a specified length from a set of distance classes according to their
Boltzmann probability.
This function does essentially the same as TwoDpfold_pbacktrack() with the only difference that partial structures,
i.e. structures beginning from the 5' end with a specified length of the sequence, are backtracked
Note
This function does not work (since it makes no sense) for circular RNA sequences!
Precondition
The argument 'vars' must contain precalculated partition function matrices, i.e. a call to TwoDpfold() preceding
this function is mandatory!
Deprecated Use the new API that relies on vrna_fold_compound_t and the corresponding functions vrna_fold_-
compound_TwoD(), vrna_pf_TwoD(), vrna_pbacktrack5_TwoD(), and vrna_fold_compound_free() in-
stead!
See also
TwoDpfold_pbacktrack(), TwoDpfold()
Parameters
in vars the datastructure containing all necessary folding attributes and matrices
in d1 the distance to reference1 (may be -1)
in d2 the distance to reference2
in length the length of the structure beginning from the 5' end
Returns
Generated by Doxygen
17.5 ViennaRNA/alifold.h File Reference 413
ViennaRNA/alifold.h
ViennaRNA/equilibrium ViennaRNA/boltzmann
ViennaRNA/centroid.h stdio.h
_probs.h _sampling.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/grammar.h ViennaRNA/constraints.h
_domains.h _domains.h
limits.h
Functions
Generated by Doxygen
414 File Documentation
Sample a consensus secondary structure from the Boltzmann ensemble according its probability.
int get_alipf_arrays (short S_p, short S5_p, short S3_p, unsigned short a2s_p, char Ss-
_p, FLT_OR_DBL qb_p, FLT_OR_DBL qm_p, FLT_OR_DBL q1k_p, FLT_OR_DBL qln_p, short
pscore)
Get pointers to (almost) all relavant arrays used in alifold's partition function computation.
void update_alifold_params (void)
Update the energy parameters for alifold function.
Variables
double cv_fact
This variable controls the weight of the covariance term in the energy function of alignment folding algorithms.
double nc_fact
This variable controls the magnitude of the penalty for non-compatible sequences in the covariance term of alignment
folding algorithms.
Various utility- and helper-functions for sequence alignments and comparative structure prediction.
This graph shows which files directly or indirectly include this file:
ViennaRNA/aln_util.h
ViennaRNA/alifold.h
Data Structures
struct vrna_pinfo_s
A base pair info structure.
Generated by Doxygen
17.6 ViennaRNA/aln_util.h File Reference 415
Various utility- and helper-functions for sequence alignments and comparative structure prediction.
17.6.3.1 vrna_pinfo_t vrna_aln_pinfo ( vrna_fold_compound_t vc, const char structure, double threshold )
This array of structures contains information about positionwise pair probabilies, base pair entropy and more
See also
Parameters
Generated by Doxygen
416 File Documentation
Returns
Functions to process, convert, and generally handle different nucleotide and/or base pair alphabets.
ViennaRNA/alphabet.h
ViennaRNA/model.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/alphabet.h
ViennaRNA/utils.h
ViennaRNA/interior ViennaRNA/multibranch
ViennaRNA/hairpin_loops.h ViennaRNA/pair_mat.h
_loops.h _loops.h
ViennaRNA/loop_energies.h
Functions
Generated by Doxygen
17.8 ViennaRNA/boltzmann_sampling.h File Reference 417
Functions to process, convert, and generally handle different nucleotide and/or base pair alphabets.
ViennaRNA/boltzmann
_sampling.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/boltzmann
_sampling.h
ViennaRNA/part_func.h
ViennaRNA/alifold.h
Functions
Generated by Doxygen
418 File Documentation
ViennaRNA/centroid.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/centroid.h
ViennaRNA/part_func.h
ViennaRNA/alifold.h
Functions
char vrna_centroid (vrna_fold_compound_t vc, double dist)
Get the centroid structure of the ensemble.
char vrna_centroid_from_plist (int length, double dist, vrna_plist_t pl)
Get the centroid structure of the ensemble.
char vrna_centroid_from_probs (int length, double dist, FLT_OR_DBL probs)
Get the centroid structure of the ensemble.
char get_centroid_struct_pl (int length, double dist, vrna_plist_t pl)
Get the centroid structure of the ensemble.
char get_centroid_struct_pr (int length, double dist, FLT_OR_DBL pr)
Get the centroid structure of the ensemble.
Generated by Doxygen
17.10 ViennaRNA/cofold.h File Reference 419
ViennaRNA/cofold.h
ViennaRNA/mfe.h
ViennaRNA/data_structures.h stdio.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Generated by Doxygen
420 File Documentation
Functions
Functions
Generated by Doxygen
17.12 ViennaRNA/commands.h File Reference 421
Parse and apply different commands that alter the behavior of secondary structure prediction and evaluation.
ViennaRNA/commands.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Data Structures
struct vrna_command_s
List element for commands ready for application to a vrna_fold_compound_t.
#define VRNA_CMD_PARSE_HC 1U
Command parse/apply flag indicating hard constraints.
#define VRNA_CMD_PARSE_SC 2U
Command parse/apply flag indicating soft constraints.
#define VRNA_CMD_PARSE_UD 4U
Command parse/apply flag indicating unstructured domains.
#define VRNA_CMD_PARSE_SD 8U
Command parse/apply flag indicating structured domains.
#define VRNA_CMD_PARSE_DEFAULTS
Command parse/apply flag indicating default set of commands.
typedef struct vrna_command_s vrna_cmd_t
Typename for the command repesenting data structure vrna_command_s.
vrna_cmd_t vrna_file_commands_read (const char filename, unsigned int options)
Extract a list of commands from a command file.
int vrna_file_commands_apply (vrna_fold_compound_t vc, const char filename, unsigned int options)
Apply a list of commands from a command file.
int vrna_commands_apply (vrna_fold_compound_t vc, vrna_cmd_t commands, unsigned int options)
Apply a list of commands to a vrna_fold_compound_t.
void vrna_commands_free (vrna_cmd_t commands)
Free memory occupied by a list of commands.
Parse and apply different commands that alter the behavior of secondary structure prediction and evaluation.
Generated by Doxygen
422 File Documentation
See also
See also
See also
See also
Value:
( VRNA_CMD_PARSE_HC \
| VRNA_CMD_PARSE_SC \
| VRNA_CMD_PARSE_UD \
| VRNA_CMD_PARSE_SD \
)
See also
See also
Generated by Doxygen
17.12 ViennaRNA/commands.h File Reference 423
Parameters
Returns
17.12.3.2 int vrna_file_commands_apply ( vrna_fold_compound_t vc, const char filename, unsigned int options )
This function is a shortcut to directly parse a commands file and apply all successfully parsed commands to a
vrna_fold_compound_t data structure. It is the same as:
int r;
vrna_cmd_t *cmds;
vrna_commands_free(cmds);
return r;
Parameters
Returns
SWIG Wrapper Notes This function is attached as method file_commands_apply() to objects of type fold_-
compound
17.12.3.3 int vrna_commands_apply ( vrna_fold_compound_t vc, vrna_cmd_t commands, unsigned int options )
Parameters
Generated by Doxygen
424 File Documentation
Returns
SWIG Wrapper Notes This function is attached as method commands_apply() to objects of type fold_compound
Parameters
Functions and data structures for constraining secondary structure predictions and evaluation.
ViennaRNA/constraints.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/grammar.h
_domains.h _domains.h
ViennaRNA/energy_const.h ViennaRNA/model.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/constraints.h
ViennaRNA/data_structures.h
ViennaRNA/exterior
ViennaRNA/utils.h ViennaRNA/gquad.h ViennaRNA/LPfold.h ViennaRNA/MEA.h ViennaRNA/part_func_co.h ViennaRNA/subopt.h ViennaRNA/2Dfold.h ViennaRNA/part_func.h ViennaRNA/walk.h ViennaRNA/eval.h ViennaRNA/cofold.h
_loops.h
ViennaRNA/interior ViennaRNA/multibranch
ViennaRNA/hairpin_loops.h ViennaRNA/alifold.h ViennaRNA/fold.h
_loops.h _loops.h
Macros
#define VRNA_CONSTRAINT_FILE 0
Flag for vrna_constraints_add() to indicate that constraints are present in a text file.
#define VRNA_CONSTRAINT_SOFT_MFE 0
Generated by Doxygen
17.13 ViennaRNA/constraints.h File Reference 425
Functions
void vrna_constraints_add (vrna_fold_compound_t vc, const char constraint, unsigned int options)
Add constraints to a vrna_fold_compound_t data structure.
Functions and data structures for constraining secondary structure predictions and evaluation.
Generated by Doxygen
426 File Documentation
Functions and data structures for handling of secondary structure hard constraints.
ViennaRNA/constraints
_hard.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/constraints.h ViennaRNA/dp_matrices.h ViennaRNA/grammar.h ViennaRNA/params.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/constraints
_hard.h
ViennaRNA/constraints.h
ViennaRNA/data_structures.h
ViennaRNA/exterior
ViennaRNA/part_func.h ViennaRNA/cofold.h ViennaRNA/gquad.h ViennaRNA/LPfold.h ViennaRNA/MEA.h ViennaRNA/part_func_co.h ViennaRNA/subopt.h ViennaRNA/eval.h ViennaRNA/2Dfold.h ViennaRNA/walk.h ViennaRNA/utils.h
_loops.h
ViennaRNA/multibranch ViennaRNA/interior
ViennaRNA/alifold.h ViennaRNA/fold.h ViennaRNA/hairpin_loops.h
_loops.h _loops.h
Data Structures
struct vrna_hc_s
The hard constraints data structure. More...
struct vrna_hc_up_s
A single hard constraint for a single nucleotide. More...
Macros
#define VRNA_CONSTRAINT_NO_HEADER 0
do not print the header information line
#define VRNA_CONSTRAINT_DB 16384U
Flag for vrna_constraints_add() to indicate that constraint is passed in pseudo dot-bracket notation.
#define VRNA_CONSTRAINT_DB_ENFORCE_BP 32768U
Switch for dot-bracket structure constraint to enforce base pairs.
#define VRNA_CONSTRAINT_DB_PIPE 65536U
Flag that is used to indicate the pipe '|' sign in pseudo dot-bracket notation of hard constraints.
#define VRNA_CONSTRAINT_DB_DOT 131072U
dot '.' switch for structure constraints (no constraint at all)
#define VRNA_CONSTRAINT_DB_X 262144U
'x' switch for structure constraint (base must not pair)
#define VRNA_CONSTRAINT_DB_ANG_BRACK 524288U
angle brackets '<', '>' switch for structure constraint (paired downstream/upstream)
#define VRNA_CONSTRAINT_DB_RND_BRACK 1048576U
round brackets '(',')' switch for structure constraint (base i pairs base j)
#define VRNA_CONSTRAINT_DB_INTRAMOL 2097152U
Flag that is used to indicate the character 'l' in pseudo dot-bracket notation of hard constraints.
Generated by Doxygen
17.14 ViennaRNA/constraints_hard.h File Reference 427
Typedefs
Functions
Generated by Doxygen
428 File Documentation
Functions and data structures for handling of secondary structure hard constraints.
angle brackets '<', '>' switch for structure constraint (paired downstream/upstream)
See also
Add an auxiliary data structure for the generic hard constraints callback function.
See also
vrna_hc_add_f()
Generated by Doxygen
17.14 ViennaRNA/constraints_hard.h File Reference 429
Parameters
vc The fold compound the generic hard constraint function should be bound to
data A pointer to the data structure that holds required data for function 'f'
free_data A pointer to a function that free's the memory occupied by (Maybe NULL)
Print structure constraint characters to stdout. (constraint support is specified by option parameter)
Parameters
option Option switch that tells which constraint help will be printed
17.14.3.4 void constrain_ptypes ( const char constraint, unsigned int length, char ptype, int BP, int min_loop_size,
unsigned int idx_type )
Deprecated Do not use this function anymore! Structure constraints are now handled through vrna_hc_t and
related functions.
Parameters
constraint The structure constraint string
length The actual length of the sequence (constraint may be shorter)
ptype A pointer to the basepair type array
BP (not used anymore)
min_loop_size The minimal loop size (usually TURN )
idx_type Define the access type for base pair type array (0 = indx, 1 = iindx)
Generated by Doxygen
430 File Documentation
Functions for incorporation of ligands binding to hairpin and interior loop motifs using the soft constraints framework.
ViennaRNA/constraints
_ligand.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/constraints.h ViennaRNA/dp_matrices.h ViennaRNA/grammar.h ViennaRNA/params.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/constraints
_ligand.h
ViennaRNA/constraints.h
ViennaRNA/data_structures.h
ViennaRNA/exterior
ViennaRNA/part_func.h ViennaRNA/cofold.h ViennaRNA/gquad.h ViennaRNA/LPfold.h ViennaRNA/MEA.h ViennaRNA/part_func_co.h ViennaRNA/subopt.h ViennaRNA/eval.h ViennaRNA/2Dfold.h ViennaRNA/walk.h ViennaRNA/utils.h
_loops.h
ViennaRNA/multibranch ViennaRNA/interior
ViennaRNA/alifold.h ViennaRNA/fold.h ViennaRNA/hairpin_loops.h
_loops.h _loops.h
Data Structures
struct vrna_sc_motif_s
Functions
int vrna_sc_add_hi_motif (vrna_fold_compound_t vc, const char seq, const char structure, FLT_OR_DBL
energy, unsigned int options)
Add soft constraints for hairpin or interior loop binding motif.
Functions for incorporation of ligands binding to hairpin and interior loop motifs using the soft constraints framework.
This module provides function to incorporate SHAPE reactivity data into the folding recursions by means of soft
constraints.
ViennaRNA/constraints
_SHAPE.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/constraints.h ViennaRNA/dp_matrices.h ViennaRNA/grammar.h ViennaRNA/params.h
_domains.h _domains.h
limits.h
Generated by Doxygen
17.16 ViennaRNA/constraints_SHAPE.h File Reference 431
This graph shows which files directly or indirectly include this file:
ViennaRNA/constraints
_SHAPE.h
ViennaRNA/constraints.h
ViennaRNA/data_structures.h
ViennaRNA/exterior
ViennaRNA/part_func.h ViennaRNA/cofold.h ViennaRNA/gquad.h ViennaRNA/LPfold.h ViennaRNA/MEA.h ViennaRNA/part_func_co.h ViennaRNA/subopt.h ViennaRNA/eval.h ViennaRNA/2Dfold.h ViennaRNA/walk.h ViennaRNA/utils.h
_loops.h
ViennaRNA/multibranch ViennaRNA/interior
ViennaRNA/alifold.h ViennaRNA/fold.h ViennaRNA/hairpin_loops.h
_loops.h _loops.h
Functions
This module provides function to incorporate SHAPE reactivity data into the folding recursions by means of soft
constraints.
17.16.2.1 int vrna_sc_SHAPE_parse_method ( const char method_string, char method, float param_1, float param_2 )
Parse a character string and extract the encoded SHAPE reactivity conversion method and possibly the parameters
for conversion into pseudo free energies.
Parameters
method_string The string that contains the encoded SHAPE reactivity conversion method
method A pointer to the memory location where the method character will be stored
param_1 A pointer to the memory location where the first parameter of the corresponding method will
be stored
param_2 A pointer to the memory location where the second parameter of the corresponding method
will be stored
Returns
Generated by Doxygen
432 File Documentation
ViennaRNA/constraints
_soft.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/constraints.h ViennaRNA/dp_matrices.h ViennaRNA/grammar.h ViennaRNA/params.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/constraints
_soft.h
ViennaRNA/constraints.h
ViennaRNA/data_structures.h
ViennaRNA/exterior
ViennaRNA/part_func.h ViennaRNA/cofold.h ViennaRNA/gquad.h ViennaRNA/LPfold.h ViennaRNA/MEA.h ViennaRNA/part_func_co.h ViennaRNA/subopt.h ViennaRNA/eval.h ViennaRNA/2Dfold.h ViennaRNA/walk.h ViennaRNA/utils.h
_loops.h
ViennaRNA/multibranch ViennaRNA/interior
ViennaRNA/alifold.h ViennaRNA/fold.h ViennaRNA/hairpin_loops.h
_loops.h _loops.h
Data Structures
struct vrna_sc_s
The soft constraints data structure. More...
Typedefs
Functions
Generated by Doxygen
17.18 ViennaRNA/convert_epars.h File Reference 433
Macros
#define VRNA_CONVERT_OUTPUT_ALL 1U
#define VRNA_CONVERT_OUTPUT_HP 2U
#define VRNA_CONVERT_OUTPUT_STACK 4U
#define VRNA_CONVERT_OUTPUT_MM_HP 8U
#define VRNA_CONVERT_OUTPUT_MM_INT 16U
#define VRNA_CONVERT_OUTPUT_MM_INT_1N 32U
#define VRNA_CONVERT_OUTPUT_MM_INT_23 64U
#define VRNA_CONVERT_OUTPUT_MM_MULTI 128U
#define VRNA_CONVERT_OUTPUT_MM_EXT 256U
#define VRNA_CONVERT_OUTPUT_DANGLE5 512U
#define VRNA_CONVERT_OUTPUT_DANGLE3 1024U
#define VRNA_CONVERT_OUTPUT_INT_11 2048U
#define VRNA_CONVERT_OUTPUT_INT_21 4096U
#define VRNA_CONVERT_OUTPUT_INT_22 8192U
#define VRNA_CONVERT_OUTPUT_BULGE 16384U
#define VRNA_CONVERT_OUTPUT_INT 32768U
#define VRNA_CONVERT_OUTPUT_ML 65536U
#define VRNA_CONVERT_OUTPUT_MISC 131072U
#define VRNA_CONVERT_OUTPUT_SPECIAL_HP 262144U
#define VRNA_CONVERT_OUTPUT_VANILLA 524288U
#define VRNA_CONVERT_OUTPUT_NINIO 1048576U
#define VRNA_CONVERT_OUTPUT_DUMP 2097152U
Generated by Doxygen
434 File Documentation
Functions
void convert_parameter_file (const char iname, const char oname, unsigned int options)
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/data_structures.h
ViennaRNA/exterior
ViennaRNA/part_func.h ViennaRNA/cofold.h ViennaRNA/walk.h ViennaRNA/eval.h ViennaRNA/constraints.h ViennaRNA/2Dfold.h ViennaRNA/gquad.h ViennaRNA/LPfold.h ViennaRNA/MEA.h ViennaRNA/part_func_co.h ViennaRNA/subopt.h ViennaRNA/utils.h
_loops.h
ViennaRNA/interior ViennaRNA/multibranch
ViennaRNA/alifold.h ViennaRNA/fold.h ViennaRNA/hairpin_loops.h
_loops.h _loops.h
Data Structures
struct vrna_basepair_s
Base pair data structure used in subopt.c. More...
struct vrna_plist_s
this datastructure is used as input parameter in functions of PS_dot.h and others More...
struct vrna_cpair_s
this datastructure is used as input parameter in functions of PS_dot.c More...
struct vrna_color_s
struct vrna_data_linear_s
struct vrna_sect_s
Stack of partial structures for backtracking. More...
struct vrna_bp_stack_s
Base pair stack element. More...
struct pu_contrib
contributions to p_u More...
struct interact
interaction data structure for RNAup More...
struct pu_out
Collection of all free_energy of beeing unpaired values for output. More...
Generated by Doxygen
17.19 ViennaRNA/data_structures.h File Reference 435
struct constrain
constraints for cofolding More...
struct duplexT
Data structure for RNAduplex. More...
struct node
Data structure for RNAsnoop (fold energy list) More...
struct snoopT
Data structure for RNAsnoop. More...
struct dupVar
Data structure used in RNApkplex. More...
struct vrna_fc_s
The most basic data structure required by many functions throughout the RNAlib. More...
Macros
Typedefs
Generated by Doxygen
436 File Documentation
Enumerations
Functions
Generated by Doxygen
17.20 ViennaRNA/dist_vars.h File Reference 437
This graph shows which files directly or indirectly include this file:
ViennaRNA/dist_vars.h
ViennaRNA/stringdist.h ViennaRNA/treedist.h
Data Structures
struct Postorder_list
Postorder data structure.
struct Tree
Tree data structure.
struct swString
Some other data structure.
Variables
int edit_backtrack
Produce an alignment of the two structures being compared by tracing the editing path giving the minimum distance.
char aligned_line [4]
Contains the two aligned structures after a call to one of the distance functions with edit_backtrack set to 1.
int cost_matrix
Specify the cost matrix to be used for distance calculations.
Generated by Doxygen
438 File Documentation
Produce an alignment of the two structures being compared by tracing the editing path giving the minimum distance.
if 0, use the default cost matrix (upper matrix in example), otherwise use Shapiro's costs (lower matrix).
ViennaRNA/dp_matrices.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/dp_matrices.h
ViennaRNA/data_structures.h
ViennaRNA/exterior
ViennaRNA/part_func.h ViennaRNA/constraints.h ViennaRNA/cofold.h ViennaRNA/2Dfold.h ViennaRNA/gquad.h ViennaRNA/LPfold.h ViennaRNA/MEA.h ViennaRNA/part_func_co.h ViennaRNA/subopt.h ViennaRNA/eval.h ViennaRNA/walk.h ViennaRNA/utils.h
_loops.h
ViennaRNA/interior ViennaRNA/multibranch
ViennaRNA/alifold.h ViennaRNA/fold.h ViennaRNA/hairpin_loops.h
_loops.h _loops.h
Data Structures
struct vrna_mx_mfe_s
Minimum Free Energy (MFE) Dynamic Programming (DP) matrices data structure required within the vrna_fold_-
compound_t. More...
struct vrna_mx_pf_s
Partition function (PF) Dynamic Programming (DP) matrices data structure required within the vrna_fold_compound-
_t. More...
Generated by Doxygen
17.22 ViennaRNA/duplex.h File Reference 439
Typedefs
Enumerations
Functions
ViennaRNA/duplex.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Generated by Doxygen
440 File Documentation
ViennaRNA/energy_const.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/energy_const.h
ViennaRNA/energy_par.h ViennaRNA/data_structures.h
ViennaRNA/exterior ViennaRNA/multibranch
ViennaRNA/constraints.h ViennaRNA/part_func.h ViennaRNA/gquad.h ViennaRNA/hairpin_loops.h ViennaRNA/LPfold.h ViennaRNA/MEA.h ViennaRNA/part_func_co.h ViennaRNA/subopt.h ViennaRNA/2Dfold.h ViennaRNA/cofold.h ViennaRNA/eval.h
_loops.h _loops.h
ViennaRNA/interior
ViennaRNA/alifold.h ViennaRNA/fold.h
_loops.h
Macros
#define GASCONST 1.98717 / in [cal/K] /
#define K0 273.15
#define INF 10000000 / (INT_MAX/10) /
#define FORBIDDEN 9999
#define BONUS 10000
#define NBPAIRS 7
#define TURN 3
#define MAXLOOP 30
Generated by Doxygen
17.25 ViennaRNA/equilibrium_probs.h File Reference 441
forbidden
bonus contribution
ViennaRNA/equilibrium
_probs.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Generated by Doxygen
442 File Documentation
This graph shows which files directly or indirectly include this file:
ViennaRNA/equilibrium
_probs.h
ViennaRNA/part_func.h
ViennaRNA/alifold.h
Functions
double vrna_mean_bp_distance_pr (int length, FLT_OR_DBL pr)
Get the mean base pair distance in the thermodynamic ensemble from a probability matrix.
double vrna_mean_bp_distance (vrna_fold_compound_t vc)
Get the mean base pair distance in the thermodynamic ensemble.
vrna_plist_t vrna_stack_prob (vrna_fold_compound_t vc, double cutoff)
Compute stacking probabilities.
This file includes various implementations for equilibrium probability computations based on the partition function of
an RNA sequence, two concatenated sequences, or a sequence alignment.
ViennaRNA/eval.h
stdio.h ViennaRNA/neighbor.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Generated by Doxygen
17.26 ViennaRNA/eval.h File Reference 443
This graph shows which files directly or indirectly include this file:
ViennaRNA/eval.h
ViennaRNA/fold.h
Functions
Generated by Doxygen
444 File Documentation
Calculate the free energy of an already folded RNA using global model detail settings.
float energy_of_struct_par (const char string, const char structure, vrna_param_t parameters, int
verbosity_level)
Calculate the free energy of an already folded RNA.
float energy_of_circ_structure (const char string, const char structure, int verbosity_level)
Calculate the free energy of an already folded circular RNA.
float energy_of_circ_struct_par (const char string, const char structure, vrna_param_t parameters, int
verbosity_level)
Calculate the free energy of an already folded circular RNA.
int energy_of_structure_pt (const char string, short ptable, short s, short s1, int verbosity_level)
Calculate the free energy of an already folded RNA.
int energy_of_struct_pt_par (const char string, short ptable, short s, short s1, vrna_param_-
t parameters, int verbosity_level)
Calculate the free energy of an already folded RNA.
float energy_of_move (const char string, const char structure, int m1, int m2)
Calculate energy of a move (closing or opening of a base pair)
int energy_of_move_pt (short pt, short s, short s1, int m1, int m2)
Calculate energy of a move (closing or opening of a base pair)
int loop_energy (short ptable, short s, short s1, int i)
Calculate energy of a loop.
float energy_of_struct (const char string, const char structure)
int energy_of_struct_pt (const char string, short ptable, short s, short s1)
float energy_of_circ_struct (const char string, const char structure)
Variables
int cut_point
set to first pos of second seq for cofolding
int eos_debug
verbose info from energy_of_struct
Energy evaluation of exterior loops for MFE and partition function calculations.
ViennaRNA/exterior
_loops.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Generated by Doxygen
17.27 ViennaRNA/exterior_loops.h File Reference 445
This graph shows which files directly or indirectly include this file:
ViennaRNA/exterior
_loops.h
ViennaRNA/loop_energies.h
Data Structures
struct vrna_mx_pf_aux_el_t
Auxiliary helper arrays for fast exterior loop computations. More...
Functions
Energy evaluation of exterior loops for MFE and partition function calculations.
17.27.2.1 int E_ExtLoop ( int type, int si1, int sj1, vrna_param_t P )
This definition is a wrapper for the E_Stem() function. It is substituted by an E_Stem() function call with argument
extLoop=1, so the energy contribution returned reflects a stem introduced in an exterior-loop.
As for the parameters si1 and sj1 of the substituted E_Stem() function, you can inhibit to take 5'-, 3'-dangles or
mismatch contributions to be taken into account by passing -1 to these parameters.
See also
E_Stem()
Generated by Doxygen
446 File Documentation
Parameters
Returns
17.27.2.2 FLT_OR_DBL exp_E_ExtLoop ( int type, int si1, int sj1, vrna_exp_param_t P )
See also
E_ExtLoop()
Returns
17.27.2.3 int E_Stem ( int type, int si1, int sj1, int extLoop, vrna_param_t P )
This function computes the energy contribution of a stem that branches off a loop region. This can be the case in
multiloops, when a stem branching off increases the degree of the loop but also immediately interior base pairs of an
exterior loop contribute free energy. To switch the behavior of the function according to the evaluation of a multiloop-
or exterior-loop-stem, you pass the flag 'extLoop'. The returned energy contribution consists of a TerminalAU penalty
if the pair type is greater than 2, dangling end contributions of mismatching nucleotides adjacent to the stem if only
one of the si1, sj1 parameters is greater than 0 and mismatch energies if both mismatching nucleotides are positive
values. Thus, to avoid incorporating dangling end or mismatch energies just pass a negative number, e.g. -1 to the
mismatch argument.
This is an illustration of how the energy contribution is assembled:
3 5
| |
X - Y
5-si1 sj1-3
Here, (X,Y) is the base pair that closes the stem that branches off a loop region. The nucleotides si1 and sj1 are
the 5'- and 3'- mismatches, respectively. If the base pair type of (X,Y) is greater than 2 (i.e. an A-U or G-U pair,
the TerminalAU penalty will be included in the energy contribution returned. If si1 and sj1 are both nonnegative
numbers, mismatch energies will also be included. If one of si1 or sj1 is a negative value, only 5' or 3' dangling end
contributions are taken into account. To prohibit any of these mismatch contributions to be incorporated, just pass
a negative number to both, si1 and sj1. In case the argument extLoop is 0, the returned energy contribution also
includes the internal-loop-penalty of a multiloop stem with closing pair type.
See also
E_MLstem()
E_ExtLoop()
Note
Generated by Doxygen
17.28 ViennaRNA/file_formats.h File Reference 447
Parameters
type The pair type of the first base pair un the stem
si1 The 5'-mismatching nucleotide
sj1 The 3'-mismatching nucleotide
extLoop A flag that indicates whether the contribution reflects the one of an exterior loop or not
P The data structure containing scaled energy parameters
Returns
17.27.2.4 FLT_OR_DBL exp_E_Stem ( int type, int si1, int sj1, int extLoop, vrna_exp_param_t P )
Compute the Boltzmann weighted energy contribution of a stem branching off a loop-region
See also
E_Stem()
Note
Returns
The Boltzmann weighted energy contribution of the branch off the loop
Read and write different file formats for RNA sequences, structures.
ViennaRNA/file_formats.h
ViennaRNA/file_formats
ViennaRNA/data_structures.h
_msa.h
ViennaRNA/structured ViennaRNA/unstructured
stdio.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h ViennaRNA/params.h
_domains.h _domains.h
limits.h
Generated by Doxygen
448 File Documentation
Read and write different file formats for RNA sequences, structures.
If used as input-option a function might also be returning this state telling that it has read data from multiple lines.
See also
vrna_extract_record_rest_structure(), vrna_file_fasta_read_record()
Generated by Doxygen
17.28 ViennaRNA/file_formats.h File Reference 449
17.28.3.1 void vrna_file_connect ( const char seq, const char db, float energy, const char identifier, FILE file )
2. Base (A, C, G, T, U, X)
6. Natural numbering.
Parameters
seq The RNA sequence
db The structure in dot-bracket format
energy The free energy of the structure
identifier An optional identifier for the sequence
file The file handle used to print to (print defaults to 'stdout' if(file == NULL) )
17.28.3.2 void vrna_file_bpseq ( const char seq, const char db, FILE file )
Parameters
seq The RNA sequence
db The structure in dot-bracket format
file The file handle used to print to (print defaults to 'stdout' if(file == NULL) )
17.28.3.3 void vrna_file_json ( const char seq, const char db, double energy, const char identifier, FILE file )
Generated by Doxygen
450 File Documentation
Parameters
seq The RNA sequence
db The structure in dot-bracket format
energy The free energy
identifier An identifier for the sequence
file The file handle used to print to (print defaults to 'stdout' if(file == NULL) )
17.28.3.4 unsigned int vrna_file_fasta_read_record ( char header, char sequence, char rest, FILE file, unsigned
int options )
This function may be used to obtain complete datasets from a filehandle or stdin. A dataset is always defined to
contain at least a sequence. If data starts with a fasta header, i.e. a line like
then vrna_file_fasta_read_record() will assume that the sequence that follows the header may span over several
lines. To disable this behavior and to assign a single line to the argument 'sequence' one can pass VRNA_INPU-
T_NO_SPAN in the 'options' argument. If no fasta header is read in the beginning of a data block, a sequence must
not span over multiple lines!
Unless the options VRNA_INPUT_NOSKIP_COMMENTS or VRNA_INPUT_NOSKIP_BLANK_LINES are passed,
a sequence may be interrupted by lines starting with a comment character or empty lines.
A sequence is regarded as completely read if it was either assumed to not span over multiple lines, a secondary
structure or structure constraint follows the sequence on the next line, or a new header marks the beginning of a
new sequence...
All lines following the sequence (this includes comments) that do not initiate a new dataset according to the above
definition are available through the line-array 'rest'. Here one can usually find the structure constraint or other infor-
mation belonging to the current dataset. Filling of 'rest' may be prevented by passing VRNA_INPUT_NO_REST to
the options argument.
Note
This function will exit any program with an error message if no sequence could be read!
This function is NOT threadsafe! It uses a global variable to store information about the next data block.
The main purpose of this function is to be able to easily parse blocks of data in the header of a loop where all
calculations for the appropriate data is done inside the loop. The loop may be then left on certain return values,
e.g.:
Generated by Doxygen
17.28 ViennaRNA/file_formats.h File Reference 451
In the example above, the while loop will be terminated when vrna_file_fasta_read_record() returns either an error,
EOF, or a user initiated quit request.
As long as data is read from stdin (we are passing NULL as the file pointer), the id is printed if it is available for the
current block of data. The sequence will be printed in any case and if some more lines belong to the current block
of data each line will be printed as well.
Note
Do not forget to free the memory occupied by header, sequence and rest!
Parameters
header A pointer which will be set such that it points to the header of the record
sequence A pointer which will be set such that it points to the sequence of the record
rest A pointer which will be set such that it points to an array of lines which also belong to the record
file A file handle to read from (if NULL, this function reads from stdin)
options Some options which may be passed to alter the behavior of the function, use 0 for no options
Returns
A flag with information about what the function actually did read
17.28.3.5 char vrna_extract_record_rest_structure ( const char lines, unsigned int length, unsigned int option )
This function extracts a dot-bracket structure string from the 'rest' array as returned by vrna_file_fasta_read_record()
and returns it. All occurences of comments within the 'lines' array will be skipped as long as they do not break the
structure string. If no structure could be read, this function returns NULL.
Precondition
See also
vrna_file_fasta_read_record()
Parameters
Returns
Generated by Doxygen
452 File Documentation
17.28.3.6 int vrna_file_SHAPE_read ( const char file_name, int length, double default_value, char sequence, double
values )
This function parses the informations from a given file and stores the result in the preallocated string sequence and
the double array values.
Parameters
17.28.3.7 void vrna_extract_record_rest_constraint ( char cstruc, const char lines, unsigned int option )
Precondition
See also
Parameters
cstruc A pointer to a character array that is used as pseudo dot-bracket output
lines A 2-dimensional character array with the extension lines from the FASTA input
option The option flags that define the behavior and recognition pattern of this function
17.28.3.8 unsigned int read_record ( char header, char sequence, char rest, unsigned int options )
Generated by Doxygen
17.29 ViennaRNA/file_formats_msa.h File Reference 453
Functions dealing with file formats for Multiple Sequence Alignments (MSA)
ViennaRNA/file_formats
_msa.h
stdio.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/file_formats
_msa.h
ViennaRNA/file_formats.h
Macros
#define VRNA_FILE_FORMAT_MSA_CLUSTAL 1U
Option flag indicating ClustalW formatted files.
#define VRNA_FILE_FORMAT_MSA_STOCKHOLM 2U
Option flag indicating Stockholm 1.0 formatted files.
#define VRNA_FILE_FORMAT_MSA_FASTA 4U
Option flag indicating FASTA (Pearson) formatted files.
#define VRNA_FILE_FORMAT_MSA_MAF 8U
Option flag indicating MAF formatted files.
#define VRNA_FILE_FORMAT_MSA_MIS 16U
Option flag indicating most informative sequence (MIS) output.
#define VRNA_FILE_FORMAT_MSA_DEFAULT
Generated by Doxygen
454 File Documentation
Functions
int vrna_file_msa_read (const char filename, char names, char aln, char id, char structure,
unsigned int options)
Read a multiple sequence alignment from file.
int vrna_file_msa_read_record (FILE fp, char names, char aln, char id, char structure, unsigned
int options)
Read a multiple sequence alignment from file handle.
unsigned int vrna_file_msa_detect_format (const char filename, unsigned int options)
Detect the format of a multiple sequence alignment file.
int vrna_file_msa_write (const char filename, const char names, const char aln, const char id, const
char structure, const char source, unsigned int options)
Write multiple sequence alignment file.
Functions dealing with file formats for Multiple Sequence Alignments (MSA)
This graph shows which files directly or indirectly include this file:
ViennaRNA/file_utils.h
ViennaRNA/utils.h
ViennaRNA/interior ViennaRNA/multibranch
ViennaRNA/hairpin_loops.h ViennaRNA/pair_mat.h
_loops.h _loops.h
ViennaRNA/loop_energies.h
Generated by Doxygen
17.31 ViennaRNA/findpath.h File Reference 455
Functions
ViennaRNA/findpath.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Data Structures
struct vrna_path_s
An element of a refolding path list. More...
Typedefs
Generated by Doxygen
456 File Documentation
Functions
int vrna_path_findpath_saddle (vrna_fold_compound_t vc, const char struc1, const char struc2, int max)
Find energy of a saddle point between 2 structures (search only direct path)
vrna_path_t vrna_path_findpath (vrna_fold_compound_t vc, const char s1, const char s2, int maxkeep)
Find refolding path between 2 structures (search only direct path)
int find_saddle (const char seq, const char struc1, const char struc2, int max)
Find energy of a saddle point between 2 structures (search only direct path)
void free_path (vrna_path_t path)
Free memory allocated by get_path() function.
vrna_path_t get_path (const char seq, const char s1, const char s2, int maxkeep)
Find refolding path between 2 structures (search only direct path)
ViennaRNA/fold.h
ViennaRNA/mfe.h ViennaRNA/eval.h
stdio.h ViennaRNA/neighbor.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h ViennaRNA/params.h
_domains.h _domains.h
limits.h
Functions
Generated by Doxygen
17.33 ViennaRNA/fold_vars.h File Reference 457
Here all all declarations of the global variables used throughout RNAlib.
ViennaRNA/fold_vars.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/fold_vars.h
ViennaRNA/pair_mat.h
Generated by Doxygen
458 File Documentation
Variables
int fold_constrained
Global switch to activate/deactivate folding with structure constraints.
int csv
generate comma seperated output
char RibosumFile
int james_rule
int logML
int cut_point
Marks the position (starting from 1) of the first nucleotide of the second molecule within the concatenated sequence.
bondT base_pair
Contains a list of base pairs after a call to fold().
FLT_OR_DBL pr
A pointer to the base pair probability matrix.
int iindx
index array to move through pr.
Here all all declarations of the global variables used throughout RNAlib.
warning this variable will vanish in the future ribosums will be compiled in instead
Marks the position (starting from 1) of the first nucleotide of the second molecule within the concatenated sequence.
To evaluate the energy of a duplex structure (a structure formed by two strands), concatenate the to sequences and
set it to the first base of the second strand in the concatenated sequence. The default value of -1 stands for single
molecule folding. The cut_point variable is also used by vrna_file_PS_rnaplot() and PS_dot_plot() to mark the chain
break in postscript plots.
Generated by Doxygen
17.34 ViennaRNA/gquad.h File Reference 459
17.33.2.6 FLT_OR_DBL pr
G-quadruplexes.
ViennaRNA/gquad.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Functions
Generated by Doxygen
460 File Documentation
G-quadruplexes.
ViennaRNA/grammar.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/grammar.h
ViennaRNA/data_structures.h
ViennaRNA/exterior
ViennaRNA/part_func.h ViennaRNA/constraints.h ViennaRNA/cofold.h ViennaRNA/2Dfold.h ViennaRNA/gquad.h ViennaRNA/LPfold.h ViennaRNA/MEA.h ViennaRNA/part_func_co.h ViennaRNA/subopt.h ViennaRNA/eval.h ViennaRNA/walk.h ViennaRNA/utils.h
_loops.h
ViennaRNA/interior ViennaRNA/multibranch
ViennaRNA/alifold.h ViennaRNA/fold.h ViennaRNA/hairpin_loops.h
_loops.h _loops.h
Data Structures
struct vrna_gr_aux_s
Energy evaluation of hairpin loops for MFE and partition function calculations.
ViennaRNA/hairpin_loops.h
ViennaRNA/structure
ViennaRNA/string_utils.h ViennaRNA/file_utils.h
_utils.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/grammar.h ViennaRNA/constraints.h ViennaRNA/dp_matrices.h ViennaRNA/params.h
_domains.h _domains.h
limits.h
Generated by Doxygen
17.37 ViennaRNA/interior_loops.h File Reference 461
This graph shows which files directly or indirectly include this file:
ViennaRNA/hairpin_loops.h
ViennaRNA/loop_energies.h
Functions
PRIVATE int E_Hairpin (int size, int type, int si1, int sj1, const char string, vrna_param_t P)
Compute the Energy of a hairpin-loop.
PRIVATE FLT_OR_DBL exp_E_Hairpin (int u, int type, short si1, short sj1, const char string, vrna_exp_-
param_t P)
Compute Boltzmann weight eG/kT of a hairpin loop.
int vrna_E_hp_loop (vrna_fold_compound_t vc, int i, int j)
Evaluate the free energy of a hairpin loop and consider hard constraints if they apply.
int vrna_E_ext_hp_loop (vrna_fold_compound_t vc, int i, int j)
Evaluate the free energy of an exterior hairpin loop and consider possible hard constraints.
int vrna_eval_ext_hp_loop (vrna_fold_compound_t vc, int i, int j)
Evaluate free energy of an exterior hairpin loop.
int vrna_eval_hp_loop (vrna_fold_compound_t vc, int i, int j)
Evaluate free energy of a hairpin loop.
FLT_OR_DBL vrna_exp_E_hp_loop (vrna_fold_compound_t vc, int i, int j)
High-Level function for hairpin loop energy evaluation (partition function variant)
int vrna_BT_hp_loop (vrna_fold_compound_t vc, int i, int j, int en, vrna_bp_stack_t bp_stack, int stack-
_count)
Backtrack a hairpin loop closed by (i, j).
Energy evaluation of hairpin loops for MFE and partition function calculations.
Energy evaluation of interior loops for MFE and partition function calculations.
Generated by Doxygen
462 File Documentation
ViennaRNA/interior
_loops.h
ViennaRNA/energy_par.h ViennaRNA/utils.h
ViennaRNA/structure
ViennaRNA/string_utils.h ViennaRNA/file_utils.h
_utils.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/grammar.h ViennaRNA/constraints.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/interior
_loops.h
ViennaRNA/loop_energies.h
Functions
PRIVATE int E_IntLoop (int n1, int n2, int type, int type_2, int si1, int sj1, int sp1, int sq1, vrna_param_t P)
PRIVATE FLT_OR_DBL exp_E_IntLoop (int u1, int u2, int type, int type2, short si1, short sj1, short sp1, short
sq1, vrna_exp_param_t P)
int vrna_eval_int_loop (vrna_fold_compound_t vc, int i, int j, int k, int l)
int vrna_BT_stack (vrna_fold_compound_t vc, int i, int j, int en, vrna_bp_stack_t bp_stack, int stack-
_count)
Backtrack a stacked pair closed by (i, j).
int vrna_BT_int_loop (vrna_fold_compound_t vc, int i, int j, int en, vrna_bp_stack_t bp_stack, int
stack_count)
Backtrack an interior loop closed by (i, j).
Energy evaluation of interior loops for MFE and partition function calculations.
Generated by Doxygen
17.39 ViennaRNA/Lfold.h File Reference 463
Functions
Variables
char symbolset
This global variable points to the allowed bases, initially "AUGC". It can be used to design sequences from reduced
alphabets.
float final_cost
int give_up
int inv_verbose
ViennaRNA/Lfold.h
ViennaRNA/mfe.h
stdio.h ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Functions
Generated by Doxygen
464 File Documentation
ViennaRNA/loop_energies.h
ViennaRNA/multibranch ViennaRNA/interior
ViennaRNA/hairpin_loops.h
_loops.h _loops.h
ViennaRNA/exterior ViennaRNA/structure
ViennaRNA/file_utils.h ViennaRNA/string_utils.h
_loops.h _utils.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/constraints.h ViennaRNA/dp_matrices.h ViennaRNA/grammar.h ViennaRNA/params.h
_domains.h _domains.h
limits.h
ViennaRNA/LPfold.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Macros
#define VRNA_PROBS_WINDOW_BPP 4096U
Option flag to activate callback triggers for pairing probabilities.
#define VRNA_PROBS_WINDOW_UP 8192U
Option flag to activate callback triggers for unpaired probabilities.
#define VRNA_PROBS_WINDOW_STACKP 16384U
Option flag to activate callback triggers for stacking probabilities.
#define VRNA_PROBS_WINDOW_UP_SPLIT 32768U
Option flag to activate callback triggers for unpaired probabilities (split up into different loop types)
Generated by Doxygen
17.42 ViennaRNA/MEA.h File Reference 465
Functions
vrna_plist_t vrna_pfl_fold (const char sequence, int window_size, int max_bp_span, float cutoff)
Compute base pair probabilities using a sliding-window approach.
void vrna_pfl_fold_cb (const char sequence, int window_size, int max_bp_span, vrna_probs_window_-
callback cb, void data)
Compute base pair probabilities using a sliding-window approach (callback version)
double vrna_pfl_fold_up (const char sequence, int ulength, int window_size, int max_bp_span)
Compute probability of contiguous unpaired segments.
void vrna_pfl_fold_up_cb (const char sequence, int ulength, int window_size, int max_bp_span, vrna_-
probs_window_callback cb, void data)
Compute probability of contiguous unpaired segments.
void vrna_probs_window (vrna_fold_compound_t fc, int ulength, vrna_probs_window_callback cb, void
data, unsigned int options)
Compute various equilibrium probabilities under a sliding window approach.
ViennaRNA/MEA.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Functions
Generated by Doxygen
466 File Documentation
ViennaRNA/mfe.h
stdio.h ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/mfe.h
Functions
This file includes (almost) all function declarations within the RNAlib that are related to MFE folding...
Generated by Doxygen
17.45 ViennaRNA/model.h File Reference 467
This file contains the declarations for several maximum matching implementations
This graph shows which files directly or indirectly include this file:
ViennaRNA/model.h
ViennaRNA/alphabet.h ViennaRNA/data_structures.h
ViennaRNA/exterior
ViennaRNA/constraints.h ViennaRNA/utils.h ViennaRNA/2Dfold.h ViennaRNA/gquad.h ViennaRNA/LPfold.h ViennaRNA/MEA.h ViennaRNA/part_func_co.h ViennaRNA/part_func.h ViennaRNA/cofold.h ViennaRNA/eval.h ViennaRNA/plot_structure.h
_loops.h
ViennaRNA/interior ViennaRNA/multibranch
ViennaRNA/hairpin_loops.h ViennaRNA/alifold.h ViennaRNA/fold.h ViennaRNA/PS_dot.h
_loops.h _loops.h
Data Structures
struct vrna_md_s
The data structure that contains the complete model details used throughout the calculations.
Generated by Doxygen
468 File Documentation
Generated by Doxygen
17.45 ViennaRNA/model.h File Reference 469
Generated by Doxygen
470 File Documentation
Generated by Doxygen
17.46 ViennaRNA/multibranch_loops.h File Reference 471
Energy evaluation of multibranch loops for MFE and partition function calculations.
ViennaRNA/multibranch
_loops.h
ViennaRNA/utils.h
ViennaRNA/structure
ViennaRNA/string_utils.h ViennaRNA/file_utils.h
_utils.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/grammar.h ViennaRNA/constraints.h ViennaRNA/dp_matrices.h ViennaRNA/params.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/multibranch
_loops.h
ViennaRNA/loop_energies.h
Generated by Doxygen
472 File Documentation
Data Structures
struct vrna_mx_pf_aux_ml_t
Auxiliary helper arrays for fast exterior loop computations. More...
Functions
Energy evaluation of multibranch loops for MFE and partition function calculations.
Evaluate energy of a multi branch helices stacking onto closing pair (i,j)
Computes total free energy for coaxial stacking of (i.j) with (i+1.k) or (k+1.j-1)
17.46.2.2 int vrna_BT_mb_loop ( vrna_fold_compound_t vc, int i, int j, int k, int en, int component1, int
component2 )
Parameters
Returns
Generated by Doxygen
17.47 ViennaRNA/naview.h File Reference 473
This graph shows which files directly or indirectly include this file:
ViennaRNA/naview.h
ViennaRNA/plot_layouts.h
ViennaRNA/plot_structure.h
ViennaRNA/PS_dot.h
ViennaRNA/neighbor.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Generated by Doxygen
474 File Documentation
This graph shows which files directly or indirectly include this file:
ViennaRNA/neighbor.h
ViennaRNA/eval.h ViennaRNA/walk.h
ViennaRNA/fold.h
Data Structures
struct vrna_move_s
An atomic representation of the transition / move from one structure to its neighbor. More...
Macros
#define VRNA_MOVESET_INSERTION 4
Option flag indicating insertion move.
#define VRNA_MOVESET_DELETION 8
Option flag indicating deletion move.
#define VRNA_MOVESET_SHIFT 16
Option flag indicating shift move.
#define VRNA_MOVESET_DEFAULT (VRNA_MOVESET_INSERTION | VRNA_MOVESET_DELETION)
Option flag indicating default move set, i.e. insertions/deletion of a base pair.
Functions
Generated by Doxygen
17.49 ViennaRNA/params.h File Reference 475
ViennaRNA/params.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/energy_const.h ViennaRNA/model.h ViennaRNA/grammar.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h
_domains.h _domains.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/params.h
ViennaRNA/data_structures.h
ViennaRNA/boltzmann ViennaRNA/equilibrium ViennaRNA/unstructured ViennaRNA/structure ViennaRNA/constraints ViennaRNA/constraints ViennaRNA/constraints ViennaRNA/constraints ViennaRNA/perturbation ViennaRNA/exterior
ViennaRNA/2Dfold.h ViennaRNA/duplex.h ViennaRNA/mfe.h ViennaRNA/file_formats.h ViennaRNA/findpath.h ViennaRNA/fold_vars.h ViennaRNA/grammar.h ViennaRNA/neighbor.h ViennaRNA/part_func_up.h ViennaRNA/PKplex.h ViennaRNA/plex.h ViennaRNA/plot_layouts.h ViennaRNA/profiledist.h ViennaRNA/PS_dot.h ViennaRNA/snofold.h ViennaRNA/snoop.h ViennaRNA/centroid.h ViennaRNA/2Dpfold.h ViennaRNA/ali_plex.h ViennaRNA/commands.h ViennaRNA/string_utils.h ViennaRNA/dp_matrices.h ViennaRNA/gquad.h ViennaRNA/LPfold.h ViennaRNA/MEA.h ViennaRNA/part_func_co.h ViennaRNA/subopt.h
_sampling.h _probs.h _domains.h _utils.h _hard.h _ligand.h _SHAPE.h _soft.h _fold.h _loops.h
ViennaRNA/multibranch ViennaRNA/interior
ViennaRNA/fold.h ViennaRNA/alifold.h ViennaRNA/hairpin_loops.h
_loops.h _loops.h
Data Structures
struct vrna_param_s
The datastructure that contains temperature scaled energy parameters. More...
struct vrna_exp_param_s
The data structure that contains temperature scaled Boltzmann weights of the energy parameters. More...
Typedefs
Generated by Doxygen
476 File Documentation
Functions
Generated by Doxygen
17.50 ViennaRNA/part_func.h File Reference 477
ViennaRNA/part_func.h
ViennaRNA/equilibrium ViennaRNA/boltzmann
ViennaRNA/centroid.h
_probs.h _sampling.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/part_func.h
ViennaRNA/alifold.h
Functions
Generated by Doxygen
478 File Documentation
Sample a secondary structure from the Boltzmann ensemble according its probability.
char pbacktrack_circ (char sequence)
Sample a secondary structure of a circular RNA from the Boltzmann ensemble according its probability.
void free_pf_arrays (void)
Free arrays for the partition function recursions.
void update_pf_params (int length)
Recalculate energy parameters.
void update_pf_params_par (int length, vrna_exp_param_t parameters)
Recalculate energy parameters.
FLT_OR_DBL export_bppm (void)
Get a pointer to the base pair probability array
Accessing the base pair probabilities for a pair (i,j) is achieved by.
int get_pf_arrays (short S_p, short S1_p, char ptype_p, FLT_OR_DBL qb_p, FLT_OR_DBL qm-
_p, FLT_OR_DBL q1k_p, FLT_OR_DBL qln_p)
Get the pointers to (almost) all relavant computation arrays used in partition function computation.
double get_subseq_F (int i, int j)
Get the free energy of a subsequence from the q[] array.
double mean_bp_distance (int length)
Get the mean base pair distance of the last partition function computation.
double mean_bp_distance_pr (int length, FLT_OR_DBL pr)
Get the mean base pair distance in the thermodynamic ensemble.
vrna_plist_t stackProb (double cutoff)
Get the probability of stacks.
void init_pf_fold (int length)
Allocate space for pf_fold()
char centroid (int length, double dist)
char get_centroid_struct_gquad_pr (int length, double dist)
double mean_bp_dist (int length)
double expLoopEnergy (int u1, int u2, int type, int type2, short si1, short sj1, short sp1, short sq1)
double expHairpinEnergy (int u, int type, short si1, short sj1, const char string)
Variables
int st_back
Flag indicating that auxilary arrays are needed throughout the computations. This is essential for stochastic back-
tracking.
Find out whether partition function computations are using single precision floating points.
See also
FLT_OR_DBL
Returns
Generated by Doxygen
17.50 ViennaRNA/part_func.h File Reference 479
Deprecated This function is deprecated and should not be used anymore as it is not threadsafe!
See also
get_centroid_struct_pl(), get_centroid_struct_pr()
Deprecated This function is deprecated and should not be used anymore as it is not threadsafe!
See also
Deprecated This function is not threadsafe and should not be used anymore. Use mean_bp_distance() instead!
17.50.2.7 double expLoopEnergy ( int u1, int u2, int type, int type2, short si1, short sj1, short sp1, short sq1 )
Generated by Doxygen
480 File Documentation
17.50.2.8 double expHairpinEnergy ( int u, int type, short si1, short sj1, const char string )
ViennaRNA/part_func_co.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Data Structures
struct vrna_dimer_pf_s
Data structure returned by vrna_pf_dimer() More...
struct vrna_dimer_conc_s
Data structure for concentration dependency computations. More...
Typedefs
Generated by Doxygen
17.51 ViennaRNA/part_func_co.h File Reference 481
Functions
Variables
int mirnatog
Toggles no intrabp in 2nd mol.
double F_monomer [2]
Free energies of the two monomers.
Generated by Doxygen
482 File Documentation
This is the cofold partition function folding. The second molecule starts at the cut_point nucleotide.
Note
OpenMP: Since this function relies on the global parameters do_backtrack, dangles, temperature and pf_-
scale it is not threadsafe according to concurrent changes in these variables! Use co_pf_fold_par() instead to
circumvent this issue.
Parameters
Returns
17.51.2.2 vrna_dimer_pf_t co_pf_fold_par ( char sequence, char structure, vrna_exp_param_t parameters, int
calculate_bppm, int is_constrained )
This is the cofold partition function folding. The second molecule starts at the cut_point nucleotide.
See also
get_boltzmann_factors(), co_pf_fold()
Parameters
Generated by Doxygen
17.51 ViennaRNA/part_func_co.h File Reference 483
Returns
Deprecated { This function is deprecated and will be removed soon!} use assign_plist_from_pr() instead!
17.51.2.4 void compute_probabilities ( double FAB, double FEA, double FEB, vrna_plist_t prAB, vrna_plist_t prA,
vrna_plist_t prB, int Alength )
Given the pair probabilities and free energies (in the null model) for a dimer AB and the two constituent monomers A
and B, compute the conditional pair probabilities given that a dimer AB actually forms. Null model pair probabilities
are given as a list as produced by assign_plist_from_pr(), the dimer probabilities 'prAB' are modified in place.
Parameters
17.51.2.5 vrna_dimer_conc_t get_concentrations ( double FEAB, double FEAA, double FEBB, double FEA, double FEB,
double startconc )
Given two start monomer concentrations a and b, compute the concentrations in thermodynamic equilibrium of all
dimers and the monomers.
This function takes an array 'startconc' of input concentrations with alternating entries for the initial concentrations
of molecules A and B (terminated by two zeroes), then computes the resulting equilibrium concentrations from the
free energies for the dimers. Dimer free energies should be the dimer-only free energies, i.e. the FcAB entries from
the vrna_dimer_pf_t struct.
Generated by Doxygen
484 File Documentation
Parameters
Returns
Deprecated This function is deprecated and will be removed soon! The base pair probability array is available
through the vrna_fold_compound_t data structure, and its associated vrna_mx_pf_t member.
See also
vrna_idx_row_wise()
Returns
Deprecated This function will be removed for the new API soon! See vrna_pf_dimer(), vrna_fold_compound(), and
vrna_fold_compound_free() for an alternative
This function recalculates all energy parameters given the current model settings.
Generated by Doxygen
17.52 ViennaRNA/part_func_up.h File Reference 485
Parameters
This function recalculates all energy parameters given the current model settings. It's second argument can either
be NULL or a data structure containing the precomputed Boltzmann factors. In the first scenario, the necessary
data structure will be created automatically according to the current global model settings, i.e. this mode might not
be threadsafe. However, if the provided data structure is not NULL, threadsafety for the model parameters dangles,
pf_scale and temperature is regained, since their values are taken from this data structure during subsequent
calculations.
Parameters
ViennaRNA/part_func_up.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Functions
pu_contrib pf_unstru (char sequence, int max_w)
Calculate the partition function over all unpaired regions of a maximal length.
interact pf_interact (const char s1, const char s2, pu_contrib p_c, pu_contrib p_c2, int max_w, char
cstruc, int incr3, int incr5)
Calculates the probability of a local interaction between two sequences.
void free_interact (interact pin)
Frees the output of function pf_interact().
void free_pu_contrib_struct (pu_contrib pu)
Frees the output of function pf_unstru().
Generated by Doxygen
486 File Documentation
Find a vector of perturbation energies that minimizes the discripancies between predicted and observed pairing
probabilities and the amount of neccessary adjustments.
ViennaRNA/perturbation
_fold.h
data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/constraints.h ViennaRNA/dp_matrices.h ViennaRNA/grammar.h ViennaRNA/params.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/perturbation
_fold.h
ViennaRNA/constraints.h
ViennaRNA/data_structures.h
ViennaRNA/exterior
ViennaRNA/part_func.h ViennaRNA/gquad.h ViennaRNA/2Dfold.h ViennaRNA/LPfold.h ViennaRNA/MEA.h ViennaRNA/part_func_co.h ViennaRNA/subopt.h ViennaRNA/eval.h ViennaRNA/walk.h ViennaRNA/cofold.h ViennaRNA/utils.h
_loops.h
ViennaRNA/interior ViennaRNA/multibranch
ViennaRNA/alifold.h ViennaRNA/fold.h ViennaRNA/hairpin_loops.h
_loops.h _loops.h
Macros
#define VRNA_OBJECTIVE_FUNCTION_QUADRATIC 0
Use the sum of squared aberrations as objective function.
#define VRNA_OBJECTIVE_FUNCTION_ABSOLUTE 1
Use the sum of absolute aberrations as objective function.
#define VRNA_MINIMIZER_DEFAULT 0
Use a custom implementation of the gradient descent algorithm to minimize the objective function.
#define VRNA_MINIMIZER_CONJUGATE_FR 1
Use the GNU Scientific Library implementation of the Fletcher-Reeves conjugate gradient algorithm to minimize the
objective function.
#define VRNA_MINIMIZER_CONJUGATE_PR 2
Use the GNU Scientific Library implementation of the Polak-Ribiere conjugate gradient algorithm to minimize the
objective function.
#define VRNA_MINIMIZER_VECTOR_BFGS 3
Use the GNU Scientific Library implementation of the vector Broyden-Fletcher-Goldfarb-Shanno algorithm to minimize
the objective function.
#define VRNA_MINIMIZER_VECTOR_BFGS2 4
Use the GNU Scientific Library implementation of the vector Broyden-Fletcher-Goldfarb-Shanno algorithm to minimize
the objective function.
#define VRNA_MINIMIZER_STEEPEST_DESCENT 5
Use the GNU Scientific Library implementation of the steepest descent algorithm to minimize the objective function.
Generated by Doxygen
17.54 ViennaRNA/plot_aln.h File Reference 487
Typedefs
Functions
Find a vector of perturbation energies that minimizes the discripancies between predicted and observed pairing
probabilities and the amount of neccessary adjustments.
This graph shows which files directly or indirectly include this file:
ViennaRNA/plot_aln.h
ViennaRNA/PS_dot.h
Functions
int PS_color_aln (const char structure, const char filename, const char seqs[ ], const char names[ ])
Produce PostScript sequence alignment color-annotated by consensus structure.
int aliPS_color_aln (const char structure, const char filename, const char seqs[ ], const char names[ ])
Generated by Doxygen
488 File Documentation
ViennaRNA/plot_layouts.h
ViennaRNA/data_structures.h ViennaRNA/naview.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/plot_layouts.h
ViennaRNA/plot_structure.h
ViennaRNA/PS_dot.h
Data Structures
struct COORDINATE
this is a workarround for the SWIG Perl Wrapper RNA plot function that returns an array of type COORDINATE
#define VRNA_PLOT_TYPE_SIMPLE 0
Definition of Plot type simple
#define VRNA_PLOT_TYPE_NAVIEW 1
Definition of Plot type Naview
#define VRNA_PLOT_TYPE_CIRCULAR 2
Definition of Plot type Circular
int rna_plot_type
Switch for changing the secondary structure layout algorithm.
int simple_xy_coordinates (short pair_table, float X, float Y)
Calculate nucleotide coordinates for secondary structure plot the Simple way
int simple_circplot_coordinates (short pair_table, float x, float y)
Calculate nucleotide coordinates for Circular Plot
Generated by Doxygen
17.56 ViennaRNA/plot_structure.h File Reference 489
ViennaRNA/plot_structure.h
ViennaRNA/plot_layouts.h
ViennaRNA/naview.h ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/dp_matrices.h ViennaRNA/params.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/plot_structure.h
ViennaRNA/PS_dot.h
Functions
int vrna_file_PS_rnaplot (const char seq, const char structure, const char file, vrna_md_t md_p)
Produce a secondary structure graph in PostScript and write it to 'filename'.
int vrna_file_PS_rnaplot_a (const char seq, const char structure, const char file, const char pre, const
char post, vrna_md_t md_p)
Produce a secondary structure graph in PostScript including additional annotation macros and write it to 'filename'.
int gmlRNA (char string, char structure, char ssfile, char option)
Produce a secondary structure graph in Graph Meta Language (gml) and write it to a file.
int ssv_rna_plot (char string, char structure, char ssfile)
Produce a secondary structure graph in SStructView format.
int svg_rna_plot (char string, char structure, char ssfile)
Produce a secondary structure plot in SVG format and write it to a file.
Generated by Doxygen
490 File Documentation
ViennaRNA/profiledist.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Functions
float profile_edit_distance (const float T1, const float T2)
Align the 2 probability profiles T1, T2
.
float Make_bp_profile_bppm (FLT_OR_DBL bppm, int length)
condense pair probability matrix into a vector containing probabilities for unpaired, upstream paired and downstream
paired.
void print_bppm (const float T)
print string representation of probability profile
void free_profile (float T)
free space allocated in Make_bp_profile
float Make_bp_profile (int length)
This is like a Needleman-Wunsch alignment, we should really use affine gap-costs ala Gotoh
Generated by Doxygen
17.58 ViennaRNA/PS_dot.h File Reference 491
condense pair probability matrix into a vector containing probabilities for unpaired, upstream paired and downstream
paired.
Parameters
bppm A pointer to the base pair probability matrix
length The length of the sequence
Returns
The bp profile
Note
See also
Make_bp_profile_bppm()
Deprecated This function is deprecated and will be removed soon! See Make_bp_profile_bppm() for a replacement
Various functions for plotting RNA secondary structures, dot-plots and other visualizations.
ViennaRNA/PS_dot.h
ViennaRNA/plot_structure.h ViennaRNA/plot_aln.h
ViennaRNA/plot_layouts.h
ViennaRNA/naview.h ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Generated by Doxygen
492 File Documentation
Data Structures
struct vrna_dotplot_auxdata_t
int PS_dot_plot_list (char seq, char filename, plist pl, plist mf, char comment)
Produce a postscript dot-plot from two pair lists.
int PS_dot_plot (char string, char file)
Produce postscript dot-plot.
Various functions for plotting RNA secondary structures, dot-plots and other visualizations.
Functions
This graph shows which files directly or indirectly include this file:
ViennaRNA/ribo.h
ViennaRNA/alifold.h
Generated by Doxygen
17.61 ViennaRNA/RNAstruct.h File Reference 493
Functions
Functions
Generated by Doxygen
494 File Documentation
Variables
Example:
General utility- and helper-functions for RNA sequence and structure strings used throughout the ViennaRNA Pack-
age.
ViennaRNA/string_utils.h
stdarg.h ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Generated by Doxygen
17.62 ViennaRNA/string_utils.h File Reference 495
This graph shows which files directly or indirectly include this file:
ViennaRNA/string_utils.h
ViennaRNA/utils.h
ViennaRNA/interior ViennaRNA/multibranch
ViennaRNA/hairpin_loops.h ViennaRNA/pair_mat.h
_loops.h _loops.h
ViennaRNA/loop_energies.h
Functions
Generated by Doxygen
496 File Documentation
General utility- and helper-functions for RNA sequence and structure strings used throughout the ViennaRNA Pack-
age.
Generated by Doxygen
17.63 ViennaRNA/stringdist.h File Reference 497
17.62.2.5 int hamming_bound ( const char s1, const char s2, int n )
ViennaRNA/stringdist.h
ViennaRNA/dist_vars.h
Functions
Parameters
string
Generated by Doxygen
498 File Documentation
Returns
Parameters
T1
T2
Returns
Various utility- and helper-functions for secondary structure parsing, converting, etc.
ViennaRNA/structure
_utils.h
stdio.h ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/structure
_utils.h
ViennaRNA/utils.h
ViennaRNA/interior ViennaRNA/multibranch
ViennaRNA/hairpin_loops.h ViennaRNA/pair_mat.h
_loops.h _loops.h
ViennaRNA/loop_energies.h
Generated by Doxygen
17.64 ViennaRNA/structure_utils.h File Reference 499
Data Structures
struct vrna_hx_s
Data structure representing an entry of a helix list.
Generated by Doxygen
500 File Documentation
Various utility- and helper-functions for secondary structure parsing, converting, etc.
This module provides interfaces that deal with additional structured domains in the folding grammar.
This graph shows which files directly or indirectly include this file:
ViennaRNA/structured
_domains.h
ViennaRNA/data_structures.h
ViennaRNA/exterior
ViennaRNA/part_func.h ViennaRNA/cofold.h ViennaRNA/eval.h ViennaRNA/constraints.h ViennaRNA/2Dfold.h ViennaRNA/gquad.h ViennaRNA/LPfold.h ViennaRNA/MEA.h ViennaRNA/part_func_co.h ViennaRNA/subopt.h ViennaRNA/utils.h
_loops.h
ViennaRNA/interior ViennaRNA/multibranch
ViennaRNA/alifold.h ViennaRNA/fold.h ViennaRNA/hairpin_loops.h
_loops.h _loops.h
Data Structures
struct vrna_structured_domains_s
This module provides interfaces that deal with additional structured domains in the folding grammar.
Generated by Doxygen
17.66 ViennaRNA/subopt.h File Reference 501
ViennaRNA/subopt.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Data Structures
struct vrna_subopt_sol_s
Solution element from subopt.c.
Macros
#define MAXDOS 1000
Maximum density of states discretization for subopt.
Typedefs
typedef struct vrna_subopt_sol_s vrna_subopt_solution_t
Typename for the subopt solution list repesenting data structure vrna_subopt_sol_s.
typedef void( vrna_subopt_callback) (const char stucture, float energy, void data)
Callback for vrna_subopt_cb()
typedef struct vrna_subopt_sol_s SOLUTION
Backward compatibility typedef for vrna_subopt_sol_s.
Functions
vrna_subopt_solution_t vrna_subopt (vrna_fold_compound_t vc, int delta, int sorted, FILE fp)
Returns list of subopt structures or writes to fp.
void vrna_subopt_cb (vrna_fold_compound_t vc, int delta, vrna_subopt_callback cb, void data)
Generate suboptimal structures within an energy band arround the MFE.
vrna_subopt_solution_t vrna_subopt_zuker (vrna_fold_compound_t vc)
Compute Zuker type suboptimal structures.
SOLUTION subopt (char seq, char structure, int delta, FILE fp)
Returns list of subopt structures or writes to fp.
SOLUTION subopt_par (char seq, char structure, vrna_param_t parameters, int delta, int is_-
constrained, int is_circular, FILE fp)
Returns list of subopt structures or writes to fp.
SOLUTION subopt_circ (char seq, char sequence, int delta, FILE fp)
Returns list of circular subopt structures or writes to fp.
SOLUTION zukersubopt (const char string)
Compute Zuker type suboptimal structures.
SOLUTION zukersubopt_par (const char string, vrna_param_t parameters)
Compute Zuker type suboptimal structures.
Generated by Doxygen
502 File Documentation
Variables
double print_energy
printing threshold for use with logML
int subopt_sorted
Sort output by energy.
int density_of_states [MAXDOS+1]
The Density of States.
ViennaRNA/treedist.h
ViennaRNA/dist_vars.h
Functions
Tree make_tree (char struc)
Constructs a Tree ( essentially the postorder list ) of the structure 'struc', for use in tree_edit_distance().
float tree_edit_distance (Tree T1, Tree T2)
Calculates the edit distance of the two trees.
void print_tree (Tree t)
Print a tree (mainly for debugging)
void free_tree (Tree t)
Free the memory allocated for Tree t.
Generated by Doxygen
17.68 ViennaRNA/units.h File Reference 503
Constructs a Tree ( essentially the postorder list ) of the structure 'struc', for use in tree_edit_distance().
Parameters
struc may be any rooted structure representation.
Returns
Parameters
T1
T2
Returns
Parameters
t
Generated by Doxygen
504 File Documentation
Functions to modify unstructured domains, e.g. to incorporate ligands binding to unpaired stretches.
ViennaRNA/unstructured
_domains.h
ViennaRNA/data_structures.h
ViennaRNA/structured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/unstructured
_domains.h
ViennaRNA/data_structures.h
ViennaRNA/exterior
ViennaRNA/part_func.h ViennaRNA/constraints.h ViennaRNA/cofold.h ViennaRNA/2Dfold.h ViennaRNA/gquad.h ViennaRNA/LPfold.h ViennaRNA/MEA.h ViennaRNA/part_func_co.h ViennaRNA/subopt.h ViennaRNA/eval.h ViennaRNA/walk.h ViennaRNA/utils.h
_loops.h
ViennaRNA/interior ViennaRNA/multibranch
ViennaRNA/alifold.h ViennaRNA/fold.h ViennaRNA/hairpin_loops.h
_loops.h _loops.h
Data Structures
struct vrna_unstructured_domain_s
Data structure to store all functionality for ligand binding. More...
struct vrna_unstructured_domain_motif_s
Generated by Doxygen
17.69 ViennaRNA/unstructured_domains.h File Reference 505
Macros
#define VRNA_UNSTRUCTURED_DOMAIN_EXT_LOOP 1U
Flag to indicate ligand bound to unpiared stretch in the exterior loop.
#define VRNA_UNSTRUCTURED_DOMAIN_HP_LOOP 2U
Flag to indicate ligand bound to unpaired stretch in a hairpin loop.
#define VRNA_UNSTRUCTURED_DOMAIN_INT_LOOP 4U
Flag to indicate ligand bound to unpiared stretch in an interior loop.
#define VRNA_UNSTRUCTURED_DOMAIN_MB_LOOP 8U
Flag to indicate ligand bound to unpiared stretch in a multibranch loop.
#define VRNA_UNSTRUCTURED_DOMAIN_MOTIF 16U
Flag to indicate ligand binding without additional unbound nucleotides (motif-only)
#define VRNA_UNSTRUCTURED_DOMAIN_ALL_LOOPS (VRNA_UNSTRUCTURED_DOMAIN_EXT_L-
OOP | VRNA_UNSTRUCTURED_DOMAIN_HP_LOOP | VRNA_UNSTRUCTURED_DOMAIN_INT_LOOP |
VRNA_UNSTRUCTURED_DOMAIN_MB_LOOP)
Flag to indicate ligand bound to unpiared stretch in any loop (convenience macro)
Typedefs
Functions
void vrna_ud_add_motif (vrna_fold_compound_t vc, const char motif, double motif_en, unsigned int loop-
_type)
Add an unstructured domain motif, e.g. for ligand binding.
int vrna_ud_get_motif_size_at (vrna_fold_compound_t vc, int i, unsigned int loop_type)
Get a list of unique motif sizes that start at a certain position within the sequence.
void vrna_ud_remove (vrna_fold_compound_t vc)
Remove ligand binding to unpaired stretches.
void vrna_ud_set_data (vrna_fold_compound_t vc, void data, vrna_callback_free_auxdata free_cb)
Attach an auxiliary data structure.
Generated by Doxygen
506 File Documentation
Functions to modify unstructured domains, e.g. to incorporate ligands binding to unpaired stretches.
SWIG Wrapper Notes This function is attached as method ud_set_prob_cb() to objects of type fold_compound
ViennaRNA/utils.h
ViennaRNA/structure
ViennaRNA/string_utils.h ViennaRNA/file_utils.h
_utils.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
This graph shows which files directly or indirectly include this file:
ViennaRNA/utils.h
ViennaRNA/interior ViennaRNA/multibranch
ViennaRNA/hairpin_loops.h ViennaRNA/pair_mat.h
_loops.h _loops.h
ViennaRNA/loop_energies.h
Generated by Doxygen
17.70 ViennaRNA/utils.h File Reference 507
Functions
#define VRNA_INPUT_ERROR 1U
Output flag of get_input_line(): "An ERROR has occured, maybe EOF".
#define VRNA_INPUT_QUIT 2U
Output flag of get_input_line(): "the user requested quitting the program".
#define VRNA_INPUT_MISC 4U
Output flag of get_input_line(): "something was read".
#define VRNA_INPUT_FASTA_HEADER 8U
Input/Output flag of get_input_line():
if used as input option this tells get_input_line() that the data to be read should comply with the FASTA format.
#define VRNA_INPUT_CONSTRAINT 32U
Input flag for get_input_line():
Tell get_input_line() that we assume to read a structure constraint.
#define VRNA_INPUT_NO_TRUNCATION 256U
Input switch for get_input_line(): "do not trunkate the line by eliminating white spaces at end of line".
#define VRNA_INPUT_NO_REST 512U
Input switch for vrna_file_fasta_read_record(): "do fill rest array".
#define VRNA_INPUT_NO_SPAN 1024U
Input switch for vrna_file_fasta_read_record(): "never allow data to span more than one line".
#define VRNA_INPUT_NOSKIP_BLANK_LINES 2048U
Input switch for vrna_file_fasta_read_record(): "do not skip empty lines".
#define VRNA_INPUT_BLANK_LINE 4096U
Output flag for vrna_file_fasta_read_record(): "read an empty line".
#define VRNA_INPUT_NOSKIP_COMMENTS 128U
Input switch for get_input_line(): "do not skip comment lines".
Generated by Doxygen
508 File Documentation
Generated by Doxygen
17.70 ViennaRNA/utils.h File Reference 509
Returns a pointer to the resulting string. The necessary memory is allocated and should be released using free()
when the string is no longer needed.
Parameters
fp A file pointer to the stream where the function should read from
Returns
There will also be a ruler (scale line) printed that helps orientation of the sequence positions
(usually this is used to ask for user input) There will also be a ruler (scale line) printed that helps orientation of the
sequence positions
Generated by Doxygen
510 File Documentation
Generated by Doxygen
17.71 ViennaRNA/walk.h File Reference 511
Inefficient cp
Get a timestamp.
Methods to generate particular paths such as gradient or random walks through the energy landscape of an RNA
sequence.
ViennaRNA/walk.h
ViennaRNA/neighbor.h
ViennaRNA/data_structures.h
ViennaRNA/structured ViennaRNA/unstructured
ViennaRNA/params.h ViennaRNA/dp_matrices.h ViennaRNA/constraints.h ViennaRNA/grammar.h
_domains.h _domains.h
limits.h
Macros
#define VRNA_PATH_STEEPEST_DESCENT 128
Option flag to request a steepest descent / gradient path.
#define VRNA_PATH_RANDOM 256
Option flag to request a random walk path.
#define VRNA_PATH_NO_TRANSITION_OUTPUT 512
Option flag to omit returning the transition path.
#define VRNA_PATH_DEFAULT (VRNA_PATH_STEEPEST_DESCENT | VRNA_MOVESET_DEFAULT)
Option flag to request defaults (steepest descent / default move set)
Functions
vrna_move_t vrna_path (vrna_fold_compound_t vc, short pt, unsigned int steps, unsigned int options)
Compute a path, store the final structure, and return a list of transition moves from the start to the final structure.
vrna_move_t vrna_path_gradient (vrna_fold_compound_t vc, short pt, unsigned int options)
Compute a steepest descent / gradient path, store the final structure, and return a list of transition moves from the
start to the final structure.
vrna_move_t vrna_path_random (vrna_fold_compound_t vc, short pt, unsigned int steps, unsigned int
options)
Generate a random walk / path of a given length, store the final structure, and return a list of transition moves from
the start to the final structure.
Generated by Doxygen
512 File Documentation
Methods to generate particular paths such as gradient or random walks through the energy landscape of an RNA
sequence.
Generated by Doxygen
Bibliography
[1] S.H. Bernhart, I.L. Hofacker, S. Will, A.R. Gruber, and P.F. Stadler. RNAalifold: Improved consensus structure
prediction for RNA alignments. BMC bioinformatics, 9(1):474, 2008. 213
[2] S.H. Bernhart, H. Tafer, U. Mckstein, C. Flamm, P.F. Stadler, and I.L. Hofacker. Partition function and base
pairing probabilities of RNA heterodimers. Algorithms for Molecular Biology, 1(1):3, 2006. 306
[3] R.E. Bruccoleri and G. Heinrich. An improved algorithm for nucleic acid secondary structure display. Computer
applications in the biosciences: CABIOS, 4(1):167173, 1988. 392
[4] Katherine E. Deigan, Tian W. Li, David H. Mathews, and Kevin M. Weeks. Accurate SHAPE-directed RNA
structure determination. PNAS, 106:97102, 2009. 257
[5] Christoph Flamm, Ivo L Hofacker, Sebastian Maurer-Stroh, Peter F Stadler, and Martin Zehl. Design of multi-
stable RNA molecules. RNA, 7(02):254265, 2001. 351, 352
[6] W. Fontana, P.F. Stadler, E.G. Bornberg-Bauer, T. Griesmacher, I.L. Hofacker, M. Tacker, P. Tarazona, E.D.
Weinberger, and P. Schuster. RNA folding and combinatory landscapes. Physical review E, 47(3):2083, 1993.
11
[7] I.L. Hofacker, M. Fekete, and P.F. Stadler. Secondary structure prediction for aligned RNA sequences. Journal
of molecular biology, 319(5):10591066, 2002. 213
[8] I.L. Hofacker, W. Fontana, P.F. Stadler, L.S. Bonhoeffer, M. Tacker, and P. Schuster. Fast folding and comparison
of RNA secondary structures. Monatshefte fr Chemie/Chemical Monthly, 125(2):167188, 1994. 2
[9] I.L. Hofacker and P.F. Stadler. Memory efficient folding algorithms for circular RNA secondary structures.
Bioinformatics, 22(10):11721176, 2006. 182, 188, 219, 223, 294
[10] Ronny Lorenz, Stephan H. Bernhart, Christian Hner zu Siederdissen, Hakim Tafer, Christoph Flamm, Peter F.
Stadler, and Ivo L. Hofacker. ViennaRNA package 2.0. Algorithms for Molecular Biology, 6(1):26, 2011. 2
[11] Ronny Lorenz, Christoph Flamm, and Ivo L. Hofacker. 2d projections of RNA folding landscapes. In Ivo
Grosse, Steffen Neumann, Stefan Posch, Falk Schreiber, and Peter F. Stadler, editors, German Conference
on Bioinformatics 2009, volume 157 of Lecture Notes in Informatics, pages 1120, Bonn, September 2009.
Gesellschaft f. Informatik. 228, 230
[12] Ronny Lorenz, Ivo L. Hofacker, and Peter F. Stadler. RNA folding with hard and soft constraints. Algorithms for
Molecular Biology, 11(1):113, 2016. 138
[13] Ronny Lorenz, Dominik Luntzer, Ivo L. Hofacker, Peter F. Stadler, and Michael T. Wolfinger. Shape directed
rna folding. Bioinformatics, 32(1):145147, 2016. 256
[14] D.H. Mathews, M.D. Disney, J.L. Childs, S.J. Schroeder, M. Zuker, and D.H. Turner. Incorporating chemical
modification constraints into a dynamic programming algorithm for prediction of RNA secondary structure.
Proceedings of the National Academy of Sciences of the United States of America, 101(19):7287, 2004. 323
[15] J.S. McCaskill. The equilibrium partition function and base pair binding probabilities for RNA secondary struc-
ture. Biopolymers, 29(6-7):11051119, 1990. 185
[16] Joe Sawada. A fast algorithm to generate necklaces with fixed content. Theoretical Computer Science,
301(1):477489, 2003. 283
514 BIBLIOGRAPHY
[17] B.A. Shapiro. An algorithm for comparing multiple RNA secondary structures. Computer applications in the
biosciences: CABIOS, 4(3):387393, 1988. 11
[18] B.A. Shapiro and K. Zhang. Comparing multiple RNA secondary structures using tree comparisons. Computer
applications in the biosciences: CABIOS, 6(4):309318, 1990. 13
[19] D.H. Turner and D.H. Mathews. NNDB: The nearest neighbor parameter database for predicting stability of
nucleic acid secondary structure. Nucleic Acids Research, 38(suppl 1):D280D282, 2010. 323
[20] Stefan Washietl, Ivo L. Hofacker, Peter F. Stadler, and Manolis Kellis. RNA folding with soft constraints: rec-
onciliation of probing data and thermodynamics secondary structure prediction. Nucleic Acids Research,
40(10):42614272, 2012. 263
[21] S. Wuchty, W. Fontana, I. L. Hofacker, and P. Schuster. Complete suboptimal folding of RNA and the stability
of secondary structures. Biopolymers, 49(2):145165, February 1999. 200
[22] Kourosh Zarringhalam, Michelle M. Meyer, Ivan Dotu, Jeffrey H. Chuang, and Peter Clote. Integrating chemical
footprinting data into RNA secondary structure prediction. PLOS ONE, 7(10), 2012. 258
[23] M. Zuker. On finding all suboptimal foldings of an RNA molecule. Science, 244(4900):4852, April 1989. 197
[24] M. Zuker and P. Stiegler. Optimal computer folding of large RNA sequences using thermodynamics and auxil-
iary information. Nucleic acids research, 9(1):133148, 1981. 182, 293
Generated by Doxygen
Index
canonicalBPonly cons_seq
Fine-tuning of the implemented models, 122 vrna_fc_s, 336
centroid constrain, 277
part_func.h, 479 constrain_ptypes
centroid.h constraints_hard.h, 429
get_centroid_struct_pl, 419 Constraining the RNA folding grammar, 146
get_centroid_struct_pr, 419 VRNA_CONSTRAINT_FILE, 149
circalifold VRNA_CONSTRAINT_SOFT_MFE, 149
MFE Consensus Structures for Sequence Align- VRNA_CONSTRAINT_SOFT_PF, 149
ment(s), 220 VRNA_DECOMP_EXT_EXT_EXT, 156
circfold VRNA_DECOMP_EXT_EXT_STEM1, 157
MFE Structures of single Nucleic Acid Sequences, VRNA_DECOMP_EXT_EXT_STEM, 156
296 VRNA_DECOMP_EXT_EXT, 155
Classified Dynamic Programming variants, 227 VRNA_DECOMP_EXT_STEM_EXT, 156
co_pf_fold VRNA_DECOMP_EXT_STEM, 155
part_func_co.h, 482 VRNA_DECOMP_EXT_UP, 155
co_pf_fold_par VRNA_DECOMP_ML_COAXIAL_ENC, 154
part_func_co.h, 482 VRNA_DECOMP_ML_COAXIAL, 154
cofold VRNA_DECOMP_ML_ML_ML, 151
MFE Structures of two hybridized Sequences, 300 VRNA_DECOMP_ML_ML_STEM, 153
cofold_par VRNA_DECOMP_ML_ML, 152
MFE Structures of two hybridized Sequences, 301 VRNA_DECOMP_ML_STEM, 152
commands.h VRNA_DECOMP_ML_UP, 153
VRNA_CMD_PARSE_DEFAULTS, 422 VRNA_DECOMP_PAIR_HP, 150
VRNA_CMD_PARSE_HC, 422 VRNA_DECOMP_PAIR_IL, 150
VRNA_CMD_PARSE_SC, 422 VRNA_DECOMP_PAIR_ML, 151
VRNA_CMD_PARSE_SD, 422 vrna_constraints_add, 157
VRNA_CMD_PARSE_UD, 422 vrna_message_constraint_options, 158
vrna_commands_apply, 423 vrna_message_constraint_options_all, 159
vrna_commands_free, 424 constraints_SHAPE.h
vrna_file_commands_apply, 423 vrna_sc_SHAPE_parse_method, 431
vrna_file_commands_read, 422 constraints_hard.h
Comparative structure prediction, 212 constrain_ptypes, 429
alloc_sequence_arrays, 216 print_tty_constraint, 429
cv_fact, 217 print_tty_constraint_full, 429
encode_ali_sequence, 216 VRNA_CONSTRAINT_DB_ANG_BRACK, 428
energy_of_alistruct, 213 VRNA_CONSTRAINT_NO_HEADER, 428
free_sequence_arrays, 216 vrna_hc_add_data, 428
get_alipf_arrays, 214 convert_parameter_file
get_mpi, 215 Converting Energy Parameter Files, 329
nc_fact, 217 Converting Energy Parameter Files, 325
update_alifold_params, 215 convert_parameter_file, 329
vrna_aln_mpi, 215 VRNA_CONVERT_OUTPUT_ALL, 326
Complex structured modules, 269 VRNA_CONVERT_OUTPUT_BULGE, 327
Compute the centroid structure, 207 VRNA_CONVERT_OUTPUT_DANGLE3, 327
vrna_centroid, 207 VRNA_CONVERT_OUTPUT_DANGLE5, 327
vrna_centroid_from_plist, 207 VRNA_CONVERT_OUTPUT_DUMP, 328
vrna_centroid_from_probs, 208 VRNA_CONVERT_OUTPUT_HP, 326
Compute the Density of States, 241 VRNA_CONVERT_OUTPUT_INT_11, 327
density_of_states, 241 VRNA_CONVERT_OUTPUT_INT_21, 327
Compute the structure with maximum expected accu- VRNA_CONVERT_OUTPUT_INT_22, 327
racy (MEA), 206 VRNA_CONVERT_OUTPUT_INT, 328
MEA, 206 VRNA_CONVERT_OUTPUT_MISC, 328
compute_BPdifferences VRNA_CONVERT_OUTPUT_MM_EXT, 327
Parsing, converting, comparing secondary struc- VRNA_CONVERT_OUTPUT_MM_HP, 326
tures, 373 VRNA_CONVERT_OUTPUT_MM_INT_1N, 326
compute_probabilities VRNA_CONVERT_OUTPUT_MM_INT_23, 326
part_func_co.h, 483 VRNA_CONVERT_OUTPUT_MM_INT, 326
Generated by Doxygen
INDEX 517
Generated by Doxygen
518 INDEX
Generated by Doxygen
INDEX 519
Generated by Doxygen
520 INDEX
Generated by Doxygen
INDEX 521
Generated by Doxygen
522 INDEX
Generated by Doxygen
INDEX 523
Generated by Doxygen
524 INDEX
Generated by Doxygen
INDEX 525
Generated by Doxygen
526 INDEX
Suboptimal structures within an energy band arround the Calculating MFE representatives of a Distance
MFE, 199 Based Partitioning, 232
subopt, 201 TwoDfoldList
subopt_circ, 201 Calculating MFE representatives of a Distance
vrna_subopt, 200 Based Partitioning, 234
vrna_subopt_cb, 200 TwoDpfold_pbacktrack
Suboptimals and representative structures, 196 2Dpfold.h, 411
svg_rna_plot TwoDpfold_pbacktrack5
Functions for Creating RNA Secondary Structures 2Dpfold.h, 412
Plots, Dot-Plots, and More, 390 TwoDpfold_vars, 399
swString, 398 TwoDpfoldList
2Dpfold.h, 411
TURN type
energy_const.h, 441 vrna_fc_s, 334
temperature
Fine-tuning of the implemented models, 120 unexpand_Full
tetra_loop Parsing, converting, comparing secondary struc-
Fine-tuning of the implemented models, 121 tures, 364
The Dynamic Programming Matrices, 345 unexpand_aligned_F
VRNA_MX_2DFOLD, 347 Parsing, converting, comparing secondary struc-
VRNA_MX_DEFAULT, 347 tures, 365
VRNA_MX_WINDOW, 347 unpack_structure
vrna_mx_add, 348 Parsing, converting, comparing secondary struc-
vrna_mx_mfe_free, 348 tures, 371
vrna_mx_pf_free, 349 Unstructured domains, 137
vrna_mx_type_e, 347 vrna_ud_add_motif, 141
The Fold Compound, 330 vrna_ud_remove, 141
VRNA_FC_TYPE_COMPARATIVE, 341 vrna_ud_set_data, 142
VRNA_FC_TYPE_SINGLE, 341 vrna_ud_set_exp_prod_rule_cb, 143
VRNA_OPTION_EVAL_ONLY, 339 vrna_ud_set_prod_rule_cb, 142
VRNA_OPTION_MFE, 339 unstructured_domains.h
VRNA_OPTION_PF, 339 vrna_ud_set_prob_cb, 506
VRNA_STATUS_MFE_POST, 338 unweight
VRNA_STATUS_MFE_PRE, 338 Parsing, converting, comparing secondary struc-
VRNA_STATUS_PF_POST, 339 tures, 364
VRNA_STATUS_PF_PRE, 339 update_alifold_params
vrna_callback_free_auxdata, 340 Comparative structure prediction, 215
vrna_callback_recursion_status, 340 update_co_pf_params
vrna_fc_type_e, 340 part_func_co.h, 484
vrna_fold_compound, 341 update_co_pf_params_par
vrna_fold_compound_add_auxdata, 343 part_func_co.h, 485
vrna_fold_compound_add_callback, 344 update_cofold_params
vrna_fold_compound_comparative, 342 MFE Structures of two hybridized Sequences, 301
vrna_fold_compound_free, 343 update_cofold_params_par
The RNA folding grammar, 93 MFE Structures of two hybridized Sequences, 301
The RNA secondary structure landscape, 180 update_fold_params
time_stamp MFE Structures of single Nucleic Acid Sequences,
utils.h, 511 297
Tree, 398 update_fold_params_par
tree_edit_distance MFE Structures of single Nucleic Acid Sequences,
treedist.h, 503 297
treedist.h update_pf_params
free_tree, 503 Partition function and equilibrium properties, 192
make_tree, 503 update_pf_params_par
tree_edit_distance, 503 Partition function and equilibrium properties, 192
TwoDfold_backtrack_f5 urn
Calculating MFE representatives of a Distance utils.h, 510
Based Partitioning, 235 Utilities, 280
TwoDfold_vars, 230 get_input_line, 289
Generated by Doxygen
INDEX 527
Generated by Doxygen
528 INDEX
Generated by Doxygen
INDEX 529
Generated by Doxygen
530 INDEX
Generated by Doxygen
INDEX 531
vrna_callback_free_auxdata vrna_db_unpack
The Fold Compound, 340 Parsing, converting, comparing secondary struc-
vrna_callback_hc_evaluate tures, 366
Hard constraints, 166 vrna_dimer_conc_s, 306
vrna_callback_recursion_status vrna_dimer_pf_s, 306
The Fold Compound, 340 vrna_dotplot_auxdata_t, 400
vrna_callback_sc_backtrack vrna_enumerate_necklaces
Soft constraints, 173 Utilities, 283
vrna_callback_sc_energy vrna_eval_covar_structure
Soft constraints, 172 Free energy evaluation, 68
vrna_callback_sc_exp_energy vrna_eval_hp_loop
Soft constraints, 173 Process and evaluate individual loops, 87
vrna_centroid vrna_eval_int_loop
Compute the centroid structure, 207 Process and evaluate individual loops, 91
vrna_centroid_from_plist vrna_eval_loop_pt
Compute the centroid structure, 207 Free energy evaluation, 75
vrna_centroid_from_probs vrna_eval_move
Compute the centroid structure, 208 Free energy evaluation, 76
vrna_circalifold vrna_eval_move_pt
MFE Consensus Structures for Sequence Align- Free energy evaluation, 76
ment(s), 219 vrna_eval_structure
vrna_circfold Free energy evaluation, 68
MFE Structures of single Nucleic Acid Sequences, vrna_eval_structure_pt
294 Free energy evaluation, 72
vrna_cofold vrna_eval_structure_pt_simple
MFE Structures of two hybridized Sequences, 300 Free energy evaluation, 72
vrna_color_s, 275 vrna_eval_structure_pt_simple_v
vrna_command_s, 400 Free energy evaluation, 75
vrna_commands_apply vrna_eval_structure_pt_simple_verbose
commands.h, 423 Free energy evaluation, 74
vrna_commands_free vrna_eval_structure_pt_v
commands.h, 424 Free energy evaluation, 73
vrna_constraints_add vrna_eval_structure_pt_verbose
Constraining the RNA folding grammar, 157 Free energy evaluation, 73
vrna_convert_energy vrna_eval_structure_simple
Functions to convert between various units, 394 Free energy evaluation, 69
vrna_convert_temperature vrna_eval_structure_simple_v
Functions to convert between various units, 394 Free energy evaluation, 71
vrna_cpair_s, 275 vrna_eval_structure_simple_verbose
vrna_cut_point_insert Free energy evaluation, 71
Parsing, converting, and comparing sequences, vrna_eval_structure_v
359 Free energy evaluation, 70
vrna_cut_point_remove vrna_eval_structure_verbose
Parsing, converting, and comparing sequences, Free energy evaluation, 70
359 vrna_exp_E_hp_loop
vrna_data_linear_s, 275 Process and evaluate individual loops, 90
vrna_db_from_bp_stack vrna_exp_param_s, 125
Parsing, converting, comparing secondary struc- alpha, 126
tures, 368 id, 126
vrna_db_from_plist vrna_exp_params
Parsing, converting, comparing secondary struc- Energy parameters, 127
tures, 370 vrna_exp_params_comparative
vrna_db_from_ptable Energy parameters, 128
Parsing, converting, comparing secondary struc- vrna_exp_params_copy
tures, 367 Energy parameters, 128
vrna_db_pack vrna_exp_params_rescale
Parsing, converting, comparing secondary struc- Energy parameters, 129
tures, 365 vrna_exp_params_reset
Generated by Doxygen
532 INDEX
Generated by Doxygen
INDEX 533
Generated by Doxygen
534 INDEX
Generated by Doxygen
INDEX 535
Generated by Doxygen
536 INDEX
Parsing, converting, and comparing sequences, Suboptimal structures sensu Stiegler et al. 1984 /
357 Zuker et al. 1989, 198
vrna_strdup_printf zukersubopt_par
Parsing, converting, and comparing sequences, Suboptimal structures sensu Stiegler et al. 1984 /
355 Zuker et al. 1989, 198
vrna_strdup_vprintf
Parsing, converting, and comparing sequences,
356
vrna_structured_domains_s, 406
vrna_subopt
Suboptimal structures within an energy band ar-
round the MFE, 200
vrna_subopt_cb
Suboptimal structures within an energy band ar-
round the MFE, 200
vrna_subopt_sol_s, 406
vrna_subopt_zuker
Suboptimal structures sensu Stiegler et al. 1984 /
Zuker et al. 1989, 197
vrna_time_stamp
Utilities, 289
vrna_ud_add_motif
Unstructured domains, 141
vrna_ud_remove
Unstructured domains, 141
vrna_ud_set_data
Unstructured domains, 142
vrna_ud_set_exp_prod_rule_cb
Unstructured domains, 143
vrna_ud_set_prob_cb
unstructured_domains.h, 506
vrna_ud_set_prod_rule_cb
Unstructured domains, 142
vrna_unit_energy_e
Functions to convert between various units, 393
vrna_unit_temperature_e
Functions to convert between various units, 393
vrna_unstructured_domain_motif_s, 406
vrna_unstructured_domain_s, 140
prod_cb, 141
vrna_urn
Utilities, 288
warn_user
utils.h, 509
write_parameter_file
Reading/Writing Energy Parameter Sets from/to
File, 323
xrealloc
utils.h, 510
xrna_plot
Functions for Creating RNA Secondary Structures
Plots, Dot-Plots, and More, 390
xsubi
Utilities, 292
zukersubopt
Generated by Doxygen