1 #ifndef __VIENNA_RNA_PACKAGE_UTILS_H__
2 #define __VIENNA_RNA_PACKAGE_UTILS_H__
17 #define PRIVATE static
20 #define DEPRECATED(func) func __attribute__ ((deprecated))
22 #define DEPRECATED(func) func
28 #define VRNA_INPUT_ERROR 1U
32 #define VRNA_INPUT_QUIT 2U
36 #define VRNA_INPUT_MISC 4U
44 #define VRNA_INPUT_FASTA_HEADER 8U
50 #define VRNA_INPUT_SEQUENCE 16U
56 #define VRNA_INPUT_CONSTRAINT 32U
62 #define VRNA_INPUT_NO_TRUNCATION 256U
67 #define VRNA_INPUT_NO_REST 512U
72 #define VRNA_INPUT_NO_SPAN 1024U
77 #define VRNA_INPUT_NOSKIP_BLANK_LINES 2048U
82 #define VRNA_INPUT_BLANK_LINE 4096U
87 #define VRNA_INPUT_NOSKIP_COMMENTS 128U
92 #define VRNA_INPUT_COMMENT 8192U
100 #define VRNA_CONSTRAINT_PIPE 1U
104 #define VRNA_CONSTRAINT_DOT 2U
108 #define VRNA_CONSTRAINT_X 4U
112 #define VRNA_CONSTRAINT_ANG_BRACK 8U
116 #define VRNA_CONSTRAINT_RND_BRACK 16U
120 #define VRNA_CONSTRAINT_MULTILINE 32U
124 #define VRNA_CONSTRAINT_NO_HEADER 64U
128 #define VRNA_CONSTRAINT_ALL 128U
132 #define VRNA_CONSTRAINT_G 256U
144 #define VRNA_OPTION_MULTILINE 32U
150 #define MIN2(A, B) ((A) < (B) ? (A) : (B))
154 #define MAX2(A, B) ((A) > (B) ? (A) : (B))
158 #define MIN3(A, B, C) (MIN2( (MIN2((A),(B))) ,(C)))
162 #define MAX3(A, B, C) (MAX2( (MAX2((A),(B))) ,(C)))
168 #define XSTR(s) STR(s)
174 #ifndef FILENAME_MAX_LENGTH
181 #define FILENAME_MAX_LENGTH 80
188 #define FILENAME_ID_LENGTH 42
195 char *strdup(
const char *s);
201 #define space(S) calloc(1,(S))
211 void *
space(
unsigned size) ;
232 void nrerror(
const char message[]);
256 extern unsigned short xsubi[3];
275 void filecopy(FILE *from, FILE *to);
306 int hamming(
const char *s1,
const char *s2);
353 unsigned int options);
435 short *vrna_seq_encode_simple(
const char *sequence,
model_detailsT *md);
440 void vrna_ali_encode(
const char *sequence,
445 unsigned short **as_p,
459 DEPRECATED(
char *get_ptypes(
const short *S,
461 unsigned int idx_type));
463 int *get_pscores(
const short *
const* S,
466 float **distance_matrix,
void * space(unsigned size)
Allocate space safely.
char * vrna_get_ptypes(const short *S, model_detailsT *md)
Get an array of the numerical encoding for each possible base pair (i,j)
short * vrna_seq_encode(const char *sequence, model_detailsT *md)
Get the integer encoding of the sequence according to the model details and encoding type...
void warn_user(const char message[])
Print a warning message.
char * time_stamp(void)
Get a timestamp.
char * get_line(FILE *fp)
Read a line of arbitrary length from a stream.
int int_urn(int from, int to)
Generates a pseudo random integer in a specified range.
void print_tty_input_seq(void)
Print a line to stdout that asks for an input sequence.
unsigned int get_input_line(char **string, unsigned int options)
char * random_string(int l, const char symbols[])
Create a random string using characters from a specified symbol set.
All datastructures and typedefs shared among the Vienna RNA Package can be found here.
void str_DNA2RNA(char *sequence)
Convert a DNA input sequence to RNA alphabet.
Various utility- and helper-functions for secondary structure parsing, converting, etc.
int * get_indx(unsigned int length)
Get an index mapper array (indx) for accessing the energy matrices, e.g. in MFE related functions...
int hamming_bound(const char *s1, const char *s2, int n)
Calculate hamming distance between two sequences up to a specified length.
void fill_pair_matrices(model_detailsT *md)
Fill the base pair type encodings according to the model details.
void nrerror(const char message[])
Die with an error message.
int * get_iindx(unsigned int length)
Get an index mapper array (iindx) for accessing the energy matrices, e.g. in partition function relat...
void * xrealloc(void *p, unsigned size)
Reallocate space safely.
void print_tty_input_seq_str(const char *s)
Print a line with a user defined string and a ruler to stdout.
The data structure that contains the complete model details used throughout the calculations.
Definition: model.h:206
double urn(void)
get a random number from [0..1]
void init_rand(void)
Make random number seeds.
unsigned short xsubi[3]
Current 48 bit random number.
void str_uppercase(char *sequence)
Convert an input sequence to uppercase.
int hamming(const char *s1, const char *s2)
Calculate hamming distance between two sequences.