RNAlib-2.5.1

General utility- and helper-functions for RNA sequence and structure strings used throughout the ViennaRNA Package. More...

+ Include dependency graph for strings.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define XSTR(s)   STR(s)
 Stringify a macro after expansion.
 
#define STR(s)   #s
 Stringify a macro argument.
 
#define FILENAME_MAX_LENGTH   80
 Maximum length of filenames that are generated by our programs. More...
 
#define FILENAME_ID_LENGTH   42
 Maximum length of id taken from fasta header for filename generation. More...
 
#define VRNA_TRIM_LEADING   1U
 Trim only characters leading the string. More...
 
#define VRNA_TRIM_TRAILING   2U
 Trim only characters trailing the string. More...
 
#define VRNA_TRIM_IN_BETWEEN   4U
 Trim only characters within the string. More...
 
#define VRNA_TRIM_SUBST_BY_FIRST   8U
 Replace remaining characters after trimming with the first delimiter in list. More...
 
#define VRNA_TRIM_DEFAULT   ( VRNA_TRIM_LEADING | VRNA_TRIM_TRAILING )
 Default settings for trimming, i.e. trim leading and trailing. More...
 
#define VRNA_TRIM_ALL   ( VRNA_TRIM_DEFAULT | VRNA_TRIM_IN_BETWEEN )
 Trim characters anywhere in the string. More...
 

Functions

char * vrna_strdup_printf (const char *format,...)
 Safely create a formatted string. More...
 
char * vrna_strdup_vprintf (const char *format, va_list argp)
 Safely create a formatted string. More...
 
int vrna_strcat_printf (char **dest, const char *format,...)
 Safely append a formatted string to another string. More...
 
int vrna_strcat_vprintf (char **dest, const char *format, va_list args)
 Safely append a formatted string to another string. More...
 
unsigned int vrna_strtrim (char *string, const char *delimiters, unsigned int keep, unsigned int options)
 Trim a string by removing (multiple) occurences of a particular character. More...
 
char ** vrna_strsplit (const char *string, const char *delimiter)
 Split a string into tokens using a delimiting character. More...
 
char * vrna_random_string (int l, const char symbols[])
 Create a random string using characters from a specified symbol set. More...
 
int vrna_hamming_distance (const char *s1, const char *s2)
 Calculate hamming distance between two sequences. More...
 
int vrna_hamming_distance_bound (const char *s1, const char *s2, int n)
 Calculate hamming distance between two sequences up to a specified length. More...
 
void vrna_seq_toRNA (char *sequence)
 Convert an input sequence (possibly containing DNA alphabet characters) to RNA alphabet. More...
 
void vrna_seq_toupper (char *sequence)
 Convert an input sequence to uppercase. More...
 
void vrna_seq_reverse (char *sequence)
 Reverse a string in-place. More...
 
char * vrna_DNA_complement (const char *sequence)
 Retrieve a DNA sequence which resembles the complement of the input sequence. More...
 
char * vrna_seq_ungapped (const char *sequence)
 Remove gap characters from a nucleotide sequence. More...
 
char * vrna_cut_point_insert (const char *string, int cp)
 Add a separating '&' character into a string according to cut-point position. More...
 
char * vrna_cut_point_remove (const char *string, int *cp)
 Remove a separating '&' character from a string. More...
 
void str_uppercase (char *sequence)
 Convert an input sequence to uppercase. More...
 
void str_DNA2RNA (char *sequence)
 Convert a DNA input sequence to RNA alphabet. More...
 
char * random_string (int l, const char symbols[])
 Create a random string using characters from a specified symbol set. More...
 
int hamming (const char *s1, const char *s2)
 Calculate hamming distance between two sequences. More...
 
int hamming_bound (const char *s1, const char *s2, int n)
 Calculate hamming distance between two sequences up to a specified length. More...
 

Detailed Description

General utility- and helper-functions for RNA sequence and structure strings used throughout the ViennaRNA Package.

,

Function Documentation

◆ str_uppercase()

void str_uppercase ( char *  sequence)

Convert an input sequence to uppercase.

Deprecated:
Use vrna_seq_toupper() instead!

◆ str_DNA2RNA()

void str_DNA2RNA ( char *  sequence)

Convert a DNA input sequence to RNA alphabet.

Deprecated:
Use vrna_seq_toRNA() instead!

◆ random_string()

char * random_string ( int  l,
const char  symbols[] 
)

Create a random string using characters from a specified symbol set.

Deprecated:
Use vrna_random_string() instead!

◆ hamming()

int hamming ( const char *  s1,
const char *  s2 
)

Calculate hamming distance between two sequences.

Deprecated:
Use vrna_hamming_distance() instead!

◆ hamming_bound()

int hamming_bound ( const char *  s1,
const char *  s2,
int  n 
)

Calculate hamming distance between two sequences up to a specified length.

Deprecated:
Use vrna_hamming_distance_bound() instead!