327 { 0, 2, 2, 2, 2, 1, 1},
328 { 2, 0, 2, 2, 2,
INF,
INF},
329 { 2, 2, 0, 1, 2,
INF,
INF},
330 { 2, 2, 1, 0, 2,
INF,
INF},
331 { 2, 2, 2, 2, 0,
INF,
INF},
337 { 0, 100, 5, 5, 75, 5, 5},
338 { 100, 0, 8, 8, 8,
INF,
INF},
339 { 5, 8, 0, 3, 8,
INF,
INF},
340 { 5, 8, 3, 0, 8,
INF,
INF},
341 { 75, 8, 8, 8, 0,
INF,
INF},
346 The lower matrix uses the costs given in \cite shapiro:1990.
347 All distance functions use the following global variables:
352 \copybrief cost_matrix
357 \copybrief edit_backtrack
362 \copybrief aligned_line
364 \see utils.h, dist_vars.h and stringdist.h
for more details
366 <h3>Functions
for Tree Edit Distances</h3>
384 \see dist_vars.h and treedist.h
for prototypes and more detailed descriptions
386 <h3>Functions
for String Alignment</h3>
399 \see dist_vars.h and stringdist.h
for prototypes and more detailed descriptions
401 <h3>Functions
for Comparison of Base Pair Probabilities</h3>
403 For comparison of base pair probability matrices, the matrices are first
404 condensed into probability profiles which are the compared by alignment.
418 \see ProfileDist.h
for prototypes and more details of the above functions
420 \ref mp_utils
"Next Page: Utilities"
422 \page mp_utils Utilities - Odds and Ends
426 <h3>Table of Contents</h3>
438 \section utils_ss Producing secondary structure graphs
491 Two low-level functions provide direct access to the graph lauyouting
502 int naview_xy_coordinates (
short *pair_table,
506 \copybrief naview_xy_coordinates()
508 \see PS_dot.h and naview.h
for more detailed descriptions.
512 <a href=
"#toc">Table of Contents</a>
516 \section utils_dot Producing (colored) dot plots for base pair probabilities
519 int PS_color_dot_plot (
char *
string,
523 \copybrief PS_color_dot_plot()
526 int PS_color_dot_plot_turn (
char *seq,
531 \copybrief PS_color_dot_plot_turn()
543 int PS_dot_plot_turn (
char *seq,
548 \copybrief PS_dot_plot_turn()
550 \see PS_dot.h for more detailed descriptions.
552 \section utils_aln Producing (colored) alignments
556 const
char *structure,
557 const
char *filename,
561 \copybrief PS_color_aln()
565 <a href="
#toc">Table of Contents</a>
569 \section utils_seq RNA sequence related utilities
571 Several functions provide useful applications to RNA sequences
575 const char symbols[])
597 <a href=
"#toc">Table of Contents</a>
601 \section utils_struc RNA secondary structure related utilities
625 <a href=
"#toc">Table of Contents</a>
629 \section utils_misc Miscellaneous Utilities
658 const char *constraint,
663 unsigned int idx_type)
677 unsigned int options);
692 void nrerror (
const char message[])
702 unsigned short xsubi[3];
717 void *
space (
unsigned size)
727 \see utils.h
for a complete overview and detailed description of the utility functions
731 <a href=
"#toc">Table of Contents</a>
735 \ref mp_example
"Next Page: Examples"
737 \page mp_example Example - A Small Example Program
739 The following program exercises most commonly used functions of the library.
740 The program folds two sequences
using both the mfe and partition
function
741 algorithms and calculates the tree edit and profile distance of the
742 resulting structures and base pairing probabilities.
761 char *seq1=
"CGCAGGGAUACCCGCG", *seq2=
"GCGCCCAUAGGGACGC",
762 *struct1,* struct2,* xstruc;
763 float e1, e2, tree_dist, string_dist, profile_dist, kT;
772 struct1 = (
char* )
space(
sizeof(
char)*(strlen(seq1)+1));
773 e1 =
fold(seq1, struct1);
775 struct2 = (
char* )
space(
sizeof(
char)*(strlen(seq2)+1));
776 e2 =
fold(seq2, struct2);
796 printf(
"%s\n%s %3.2f\n", aligned_line[0], aligned_line[1], tree_dist);
801 printf(
"%s mfe=%5.2f\n%s mfe=%5.2f dist=%3.2f\n",
802 aligned_line[0], e1, aligned_line[1], e2, string_dist);
807 pf_scale = exp(-e1/kT/strlen(seq1));
823 printf(
"%s free energy=%5.2f\n%s free energy=%5.2f dist=%3.2f\n",
824 aligned_line[0], e1, aligned_line[1], e2, profile_dist);
830 In a typical Unix environment you would compile
this program
using:
832 cc ${OPENMP_CFLAGS} -c example.c -I${hpath}
836 cc ${OPENMP_CFLAGS} -o example -L${lpath} -lRNA -lm
838 where \e ${hpath} and \e ${lpath} point to the location of the header
839 files and library, respectively.
840 \note As
default, the RNAlib is compiled with build-in \e OpenMP multithreading
841 support. Thus, when linking your own
object files to the library you have to pass
842 the compiler specific \e ${OPENMP_CFLAGS} (e.g.
'-fopenmp' for \b gcc) even
if your code does not
843 use openmp specific code. However, in that
case the \e OpenMP flags may be ommited when compiling