1 #ifndef __VIENNA_RNA_PACKAGE_UTILS_H__
2 #define __VIENNA_RNA_PACKAGE_UTILS_H__
12 #define VRNA_INPUT_ERROR 1U
16 #define VRNA_INPUT_QUIT 2U
20 #define VRNA_INPUT_MISC 4U
28 #define VRNA_INPUT_FASTA_HEADER 8U
34 #define VRNA_INPUT_SEQUENCE 16U
40 #define VRNA_INPUT_CONSTRAINT 32U
46 #define VRNA_INPUT_NO_TRUNCATION 256U
51 #define VRNA_INPUT_NO_REST 512U
56 #define VRNA_INPUT_NO_SPAN 1024U
61 #define VRNA_INPUT_NOSKIP_BLANK_LINES 2048U
66 #define VRNA_INPUT_BLANK_LINE 4096U
71 #define VRNA_INPUT_NOSKIP_COMMENTS 128U
76 #define VRNA_INPUT_COMMENT 8192U
84 #define VRNA_CONSTRAINT_PIPE 1U
88 #define VRNA_CONSTRAINT_DOT 2U
92 #define VRNA_CONSTRAINT_X 4U
96 #define VRNA_CONSTRAINT_ANG_BRACK 8U
100 #define VRNA_CONSTRAINT_RND_BRACK 16U
104 #define VRNA_CONSTRAINT_MULTILINE 32U
108 #define VRNA_CONSTRAINT_NO_HEADER 64U
112 #define VRNA_CONSTRAINT_ALL 128U
116 #define VRNA_CONSTRAINT_G 256U
128 #define VRNA_OPTION_MULTILINE 32U
134 #define MIN2(A, B) ((A) < (B) ? (A) : (B))
138 #define MAX2(A, B) ((A) > (B) ? (A) : (B))
142 #define MIN3(A, B, C) (MIN2( (MIN2((A),(B))) ,(C)))
146 #define MAX3(A, B, C) (MAX2( (MAX2((A),(B))) ,(C)))
152 #define XSTR(s) STR(s)
158 #ifndef FILENAME_MAX_LENGTH
165 #define FILENAME_MAX_LENGTH 80
172 #define FILENAME_ID_LENGTH 42
179 char *strdup(
const char *s);
185 #define space(S) calloc(1,(S))
195 void *
space(
unsigned size) ;
216 void nrerror(
const char message[]);
240 extern unsigned short xsubi[3];
259 void filecopy(FILE *from, FILE *to);
290 int hamming(
const char *s1,
const char *s2);
316 int skip_comment_lines(
char **line);
339 unsigned int options);
341 unsigned int get_multi_input_line(
char **
string,
342 unsigned int options);
399 unsigned int options);
416 char *extract_record_rest_structure(
const char **lines,
418 unsigned int option);
455 short *make_pair_table_pk(
const char *structure);
494 int bp_distance(
const char *str1,
586 void getConstraint(
char **cstruc,
588 unsigned int option);
606 unsigned int idx_type);
608 unsigned int *make_referenceBP_array(
short *reference_pt,
611 unsigned int *compute_BPdifferences(
short *pt1,
int * make_loop_index_pt(short *pt)
Compute the "base pair" distance between two secondary structures s1 and s2.
void * space(unsigned size)
Allocate space safely.
void warn_user(const char message[])
Print a warning message.
char * time_stamp(void)
Get a timestamp.
char * unpack_structure(const char *packed)
Unpack secondary structure previously packed with pack_structure()
char * get_line(FILE *fp)
Read a line of arbitrary length from a stream.
short * make_pair_table_snoop(const char *structure)
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.
void constrain_ptypes(const char *constraint, unsigned int length, char *ptype, int *BP, int min_loop_size, unsigned int idx_type)
Insert constraining pair types according to constraint structure string.
short * copy_pair_table(const short *pt)
Get an exact copy of a pair table.
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.
void str_DNA2RNA(char *sequence)
Convert a DNA input sequence to RNA alphabet.
char * pack_structure(const char *struc)
Pack secondary secondary structure, 5:1 compression using base 3 encoding.
void print_tty_constraint(unsigned int option)
Print structure constraint characters to stdout. (constraint support is specified by option parameter...
int * get_indx(unsigned int length)
Get an index mapper array (indx) for accessing the energy matrices, e.g. in MFE related functions...
unsigned int read_record(char **header, char **sequence, char ***rest, unsigned int options)
Get a data record from stdin.
void print_tty_constraint_full(void)
Print structure constraint characters to stdout (full constraint support)
int hamming_bound(const char *s1, const char *s2, int n)
Calculate hamming distance between two sequences up to a specified length.
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.
short * alimake_pair_table(const char *structure)
short * make_pair_table(const char *structure)
Create a pair table of a secondary structure.
void print_tty_input_seq_str(const char *s)
Print a line with a user defined string and a ruler to stdout.
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.