RNAlib-2.2.3
string_utils.h
Go to the documentation of this file.
1 #ifndef VIENNA_RNA_PACKAGE_STRING_UTILS_H
2 #define VIENNA_RNA_PACKAGE_STRING_UTILS_H
3 
4 /* make this interface backward compatible with RNAlib < 2.2.0 */
5 #define VRNA_BACKWARD_COMPAT
6 
7 #ifdef DEPRECATION_WARNINGS
8 # ifdef __GNUC__
9 # define DEPRECATED(func) func __attribute__ ((deprecated))
10 # else
11 # define DEPRECATED(func) func
12 # endif
13 #else
14 # define DEPRECATED(func) func
15 #endif
16 
26 
30 #define XSTR(s) STR(s)
31 
35 #define STR(s) #s
36 
37 #ifndef FILENAME_MAX_LENGTH
38 
45 #define FILENAME_MAX_LENGTH 80
46 
53 #define FILENAME_ID_LENGTH 42
54 
55 #endif
56 
57 #ifdef HAVE_CONFIG_H
58 #include <config.h>
59 #ifndef HAVE_STRDUP
60 char *strdup(const char *s);
61 #endif
62 #endif
63 
71 char *vrna_random_string(int l, const char symbols[]);
72 
80 int vrna_hamming_distance(const char *s1, const char *s2);
81 
91 int vrna_hamming_distance_bound(const char *s1, const char *s2, int n);
92 
100 void vrna_seq_toRNA(char *sequence);
101 
107 void vrna_seq_toupper(char *sequence);
108 
113 short *vrna_seq_encode( const char *sequence,
114  vrna_md_t *md);
115 
120 short *vrna_seq_encode_simple(const char *sequence,
121  vrna_md_t *md);
122 
134 int vrna_nucleotide_encode( char c,
135  vrna_md_t *md);
136 
148 char vrna_nucleotide_decode(int enc,
149  vrna_md_t *md);
150 
151 void vrna_aln_encode( const char *sequence,
152  short **S_p,
153  short **s5_p,
154  short **s3_p,
155  char **ss_p,
156  unsigned short **as_p,
157  vrna_md_t *md);
158 
170 char *vrna_cut_point_insert(const char *string,
171  int cp);
172 
185 char *vrna_cut_point_remove(const char *string,
186  int *cp);
187 
192 #ifdef VRNA_BACKWARD_COMPAT
193 
198 DEPRECATED(void str_uppercase(char *sequence));
199 
205 DEPRECATED(void str_DNA2RNA(char *sequence));
206 
212 DEPRECATED(char *random_string(int l, const char symbols[]));
213 
219 DEPRECATED(int hamming(const char *s1, const char *s2));
220 
226 DEPRECATED(int hamming_bound(const char *s1, const char *s2, int n));
227 
228 #endif
229 
230 #endif
void str_uppercase(char *sequence)
Convert an input sequence to uppercase.
short * vrna_seq_encode_simple(const char *sequence, vrna_md_t *md)
Get a numerical representation of the nucleotide sequence (simple version)
int vrna_hamming_distance(const char *s1, const char *s2)
Calculate hamming distance between two sequences.
char vrna_nucleotide_decode(int enc, vrna_md_t *md)
Decode a numerical representation of a nucleotide back into nucleotide alphabet.
int vrna_hamming_distance_bound(const char *s1, const char *s2, int n)
Calculate hamming distance between two sequences up to a specified length.
char * vrna_random_string(int l, const char symbols[])
Create a random string using characters from a specified symbol set.
void vrna_seq_toRNA(char *sequence)
Convert an input sequence (possibly containing DNA alphabet characters) to RNA alphabet.
The data structure that contains the complete model details used throughout the calculations.
Definition: model.h:187
char * vrna_cut_point_insert(const char *string, int cp)
Add a separating '&' character into a string according to cut-point position.
void str_DNA2RNA(char *sequence)
Convert a DNA input sequence to RNA alphabet.
char * vrna_cut_point_remove(const char *string, int *cp)
Remove a separating '&' character from a string.
int hamming(const char *s1, const char *s2)
Calculate hamming distance between two sequences.
char * random_string(int l, const char symbols[])
Create a random string using characters from a specified symbol set.
int vrna_nucleotide_encode(char c, vrna_md_t *md)
Encode a nucleotide character to numerical value.
short * vrna_seq_encode(const char *sequence, vrna_md_t *md)
Get a numerical representation of the nucleotide sequence.
void vrna_seq_toupper(char *sequence)
Convert an input sequence to uppercase.
int hamming_bound(const char *s1, const char *s2, int n)
Calculate hamming distance between two sequences up to a specified length.