RNAlib-2.4.14
Utilities

Detailed Description

+ Collaboration diagram for Utilities:

Modules

 Utilities to deal with Nucleotide Alphabets
 Functions to cope with various aspects related to the nucleotide sequence alphabet.
 
 (Nucleic Acid Sequence) String Utilitites
 Functions to parse, convert, manipulate, create, and compare (nucleic acid sequence) strings.
 
 Secondary Structure Utilities
 Functions to create, parse, convert, manipulate, and compare secondary structure representations.
 
 Multiple Sequence Alignment Utilities
 Functions to extract features from and to manipulate multiple sequence alignments.
 
 Files and I/O
 Functions to parse, write, and convert various file formats and to deal with file system related issues.
 
 Plotting
 Functions for Creating Secondary Structure Plots, Dot-Plots, and More.
 
 Search Algorithms
 Implementations of various search algorithms to detect strings of objects within other strings of objects.
 
 Combinatorics Algorithms
 Implementations to solve various combinatorial aspects for strings of objects.
 
 (Abstract) Data Structures
 All datastructures and typedefs shared among the ViennaRNA Package can be found here.
 
 Messages
 Functions to print various kind of messages.
 
 Unit Conversion
 Functions to convert between various physical units.
 

Files

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 objects.
 
file  commands.h
 Parse and apply different commands that alter the behavior of secondary structure prediction and evaluation.
 
file  sequence.h
 Functions and data structures related to sequence representations ,.
 
file  units.h
 Physical Units and Functions to convert them into each other.
 
file  file_formats_msa.h
 Functions dealing with file formats for Multiple Sequence Alignments (MSA)
 
file  utils.h
 Several utilities for file handling.
 
file  utils.h
 Various utilities to assist in plotting secondary structures and consensus structures.
 
file  alignments.h
 Various utility- and helper-functions for sequence alignments and comparative structure prediction.
 
file  basic.h
 General utility- and helper-functions used throughout the ViennaRNA Package.
 
file  strings.h
 General utility- and helper-functions for RNA sequence and structure strings used throughout the ViennaRNA Package.
 
file  BoyerMoore.h
 Variants of the Boyer-Moore string search algorithm.
 
file  char_stream.h
 Implementation of a dynamic, buffered character stream.
 
file  stream_output.h
 An implementation of a buffered, ordered stream output data structure.
 

Macros

#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. More...
 
#define VRNA_INPUT_CONSTRAINT   32U
 Input flag for get_input_line():
Tell get_input_line() that we assume to read a structure constraint. More...
 
#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.
 

Functions

void * vrna_alloc (unsigned size)
 Allocate space safely. More...
 
void * vrna_realloc (void *p, unsigned size)
 Reallocate space safely. More...
 
void vrna_init_rand (void)
 Initialize seed for random number generator.
 
double vrna_urn (void)
 get a random number from [0..1] More...
 
int vrna_int_urn (int from, int to)
 Generates a pseudo random integer in a specified range. More...
 
char * vrna_time_stamp (void)
 Get a timestamp. More...
 
unsigned int get_input_line (char **string, unsigned int options)
 
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. More...
 
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. More...
 

Variables

unsigned short xsubi [3]
 Current 48 bit random number. More...
 

Macro Definition Documentation

#define VRNA_INPUT_FASTA_HEADER   8U

#include <ViennaRNA/utils/basic.h>

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.

the function will return this flag if a fasta header was read

#define VRNA_INPUT_CONSTRAINT   32U

#include <ViennaRNA/utils/basic.h>

Input flag for get_input_line():
Tell get_input_line() that we assume to read a structure constraint.

Function Documentation

void* vrna_alloc ( unsigned  size)

#include <ViennaRNA/utils/basic.h>

Allocate space safely.

Parameters
sizeThe size of the memory to be allocated in bytes
Returns
A pointer to the allocated memory
void* vrna_realloc ( void *  p,
unsigned  size 
)

#include <ViennaRNA/utils/basic.h>

Reallocate space safely.

Parameters
pA pointer to the memory region to be reallocated
sizeThe size of the memory to be allocated in bytes
Returns
A pointer to the newly allocated memory
double vrna_urn ( void  )

#include <ViennaRNA/utils/basic.h>

get a random number from [0..1]

See also
vrna_int_urn(), vrna_init_rand()
Note
Usually implemented by calling erand48().
Returns
A random number in range [0..1]
int vrna_int_urn ( int  from,
int  to 
)

#include <ViennaRNA/utils/basic.h>

Generates a pseudo random integer in a specified range.

See also
vrna_urn(), vrna_init_rand()
Parameters
fromThe first number in range
toThe last number in range
Returns
A pseudo random number in range [from, to]
char* vrna_time_stamp ( void  )

#include <ViennaRNA/utils/basic.h>

Get a timestamp.

Returns a string containing the current date in the format

Fri Mar 19 21:10:57 1993 
Returns
A string containing the timestamp
unsigned int get_input_line ( char **  string,
unsigned int  options 
)

#include <ViennaRNA/utils/basic.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_WS_SUFFIX

pass a collection of options as one value like this:

get_input_line(string, option_1 | option_2 | option_n) 

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
stringA pointer to the character array that contains the line read
optionsA collection of options for switching the functions behavior
Returns
A flag with information about what has been read
int* vrna_idx_row_wise ( unsigned int  length)

#include <ViennaRNA/utils/basic.h>

Get an index mapper array (iindx) for accessing the energy matrices, e.g. in partition function related functions.

Access of a position "(i,j)" is then accomplished by using

(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
lengthThe length of the RNA sequence
Returns
The mapper array
int* vrna_idx_col_wise ( unsigned int  length)

#include <ViennaRNA/utils/basic.h>

Get an index mapper array (indx) for accessing the energy matrices, e.g. in MFE related functions.

Access of a position "(i,j)" is then accomplished by using

(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
lengthThe length of the RNA sequence
Returns
The mapper array

Variable Documentation

unsigned short xsubi[3]

#include <ViennaRNA/utils/basic.h>

Current 48 bit random number.

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()