RNAlib-2.4.14
|
|
Implementations to solve various combinatorial aspects for strings of objects. More...
Implementations to solve various combinatorial aspects for strings of objects.
Files | |
file | combinatorics.h |
Various implementations that deal with combinatorial aspects of objects. | |
Functions | |
unsigned int ** | vrna_enumerate_necklaces (const unsigned int *type_counts) |
Enumerate all necklaces with fixed content. More... | |
unsigned int | vrna_rotational_symmetry_num (const unsigned int *string, size_t string_length) |
Determine the order of rotational symmetry for a string of objects represented by natural numbers. More... | |
unsigned int | vrna_rotational_symmetry_pos_num (const unsigned int *string, size_t string_length, unsigned int **positions) |
Determine the order of rotational symmetry for a string of objects represented by natural numbers. More... | |
unsigned int | vrna_rotational_symmetry (const char *string) |
Determine the order of rotational symmetry for a NULL-terminated string of ASCII characters. More... | |
unsigned int | vrna_rotational_symmetry_pos (const char *string, unsigned int **positions) |
Determine the order of rotational symmetry for a NULL-terminated string of ASCII characters. More... | |
unsigned int | vrna_rotational_symmetry_db (vrna_fold_compound_t *fc, const char *structure) |
Determine the order of rotational symmetry for a dot-bracket structure. More... | |
unsigned int | vrna_rotational_symmetry_db_pos (vrna_fold_compound_t *fc, const char *structure, unsigned int **positions) |
Determine the order of rotational symmetry for a dot-bracket structure. More... | |
unsigned int ** vrna_enumerate_necklaces | ( | const unsigned int * | type_counts | ) |
#include <ViennaRNA/combinatorics.h>
Enumerate all necklaces with fixed content.
This function implements A fast algorithm to generate necklaces with fixed content as published by Joe Sawada in 2003 [19].
The function receives a list of counts (the elements on the necklace) for each type of object within a necklace. The list starts at index 0 and ends with an entry that has a count of 0. The algorithm then enumerates all non-cyclic permutations of the content, returned as a list of necklaces. This list, again, is zero-terminated, i.e. the last entry of the list is a NULL
pointer.
type_counts | A 0-terminated list of entity counts |
unsigned int vrna_rotational_symmetry_num | ( | const unsigned int * | string, |
size_t | string_length | ||
) |
#include <ViennaRNA/combinatorics.h>
Determine the order of rotational symmetry for a string of objects represented by natural numbers.
The algorithm applies a fast search of the provided string within itself, assuming the end of the string wraps around to connect with it's start. For example, a string of the form 011011
has rotational symmetry of order 2
This is a simplified version of vrna_rotational_symmetry_pos_num() that may be useful if one is only interested in the degree of rotational symmetry but not the actual set of rotational symmetric strings.
string | The string of elements encoded as natural numbers |
string_length | The length of the string |
string
is always known a-priori, so the parameter string_length
must be omitted. unsigned int vrna_rotational_symmetry_pos_num | ( | const unsigned int * | string, |
size_t | string_length, | ||
unsigned int ** | positions | ||
) |
#include <ViennaRNA/combinatorics.h>
Determine the order of rotational symmetry for a string of objects represented by natural numbers.
The algorithm applies a fast search of the provided string within itself, assuming the end of the string wraps around to connect with it's start. For example, a string of the form 011011
has rotational symmetry of order 2
If the argument positions
is not NULL
, the function stores an array of string start positions for rotational shifts that map the string back onto itself. This array has length of order of rotational symmetry, i.e. the number returned by this function. The first element positions
[0] always contains a shift value of 0
representing the trivial rotation.
positions
after a successful execution of this function.string | The string of elements encoded as natural numbers |
string_length | The length of the string |
positions | A pointer to an (undefined) list of alternative string start positions that lead to an identity mapping (may be NULL) |
string
is always known a-priori, so the parameter string_length
must be omitted. unsigned int vrna_rotational_symmetry | ( | const char * | string | ) |
#include <ViennaRNA/combinatorics.h>
Determine the order of rotational symmetry for a NULL-terminated string of ASCII characters.
The algorithm applies a fast search of the provided string within itself, assuming the end of the string wraps around to connect with it's start. For example, a string of the form AABAAB
has rotational symmetry of order 2
This is a simplified version of vrna_rotational_symmetry_pos() that may be useful if one is only interested in the degree of rotational symmetry but not the actual set of rotational symmetric strings.
string | A NULL-terminated string of characters |
unsigned int vrna_rotational_symmetry_pos | ( | const char * | string, |
unsigned int ** | positions | ||
) |
#include <ViennaRNA/combinatorics.h>
Determine the order of rotational symmetry for a NULL-terminated string of ASCII characters.
The algorithm applies a fast search of the provided string within itself, assuming the end of the string wraps around to connect with it's start. For example, a string of the form AABAAB
has rotational symmetry of order 2
If the argument positions
is not NULL
, the function stores an array of string start positions for rotational shifts that map the string back onto itself. This array has length of order of rotational symmetry, i.e. the number returned by this function. The first element positions
[0] always contains a shift value of 0
representing the trivial rotation.
positions
after a successful execution of this function.string | A NULL-terminated string of characters |
positions | A pointer to an (undefined) list of alternative string start positions that lead to an identity mapping (may be NULL) |
unsigned int vrna_rotational_symmetry_db | ( | vrna_fold_compound_t * | fc, |
const char * | structure | ||
) |
#include <ViennaRNA/combinatorics.h>
Determine the order of rotational symmetry for a dot-bracket structure.
Given a (permutation of multiple) RNA strand(s) and a particular secondary structure in dot-bracket notation, compute the degree of rotational symmetry. In case there is only a single linear RNA strand, the structure always has degree 1, as there are no rotational symmetries due to the direction of the nucleic acid sequence and the fixed positions of 5' and 3' ends. However, for circular RNAs, rotational symmetries might arise if the sequence consists of a concatenation of identical subsequences.
This is a simplified version of vrna_rotational_symmetry_db_pos() that may be useful if one is only interested in the degree of rotational symmetry but not the actual set of rotational symmetric strings.
fc | A fold_compound data structure containing the nucleic acid sequence(s), their order, and model settings |
structure | The dot-bracket structure the degree of rotational symmetry is checked for |
structure
(0 in case of any errors)fold_compound
(i.e. vrna_fold_compound_t). See vrna_rotational_symmetry_db_pos() for details. unsigned int vrna_rotational_symmetry_db_pos | ( | vrna_fold_compound_t * | fc, |
const char * | structure, | ||
unsigned int ** | positions | ||
) |
#include <ViennaRNA/combinatorics.h>
Determine the order of rotational symmetry for a dot-bracket structure.
Given a (permutation of multiple) RNA strand(s) and a particular secondary structure in dot-bracket notation, compute the degree of rotational symmetry. In case there is only a single linear RNA strand, the structure always has degree 1, as there are no rotational symmetries due to the direction of the nucleic acid sequence and the fixed positions of 5' and 3' ends. However, for circular RNAs, rotational symmetries might arise if the sequence consists of a concatenation of identical subsequences.
If the argument positions
is not NULL
, the function stores an array of string start positions for rotational shifts that map the string back onto itself. This array has length of order of rotational symmetry, i.e. the number returned by this function. The first element positions
[0] always contains a shift value of 0
representing the trivial rotation.
positions
after a successful execution of this function.fc | A fold_compound data structure containing the nucleic acid sequence(s), their order, and model settings |
structure | The dot-bracket structure the degree of rotational symmetry is checked for |
positions | A pointer to an (undefined) list of alternative string start positions that lead to an identity mapping (may be NULL) |
structure
(0 in case of any errors)fold_compound
(i.e. vrna_fold_compound_t). Thus, the first argument must be omitted. In contrast to our C-implementation, this function doesn't simply return the order of rotational symmetry of the secondary structure, but returns the list position
of cyclic permutation shifts that result in a rotationally symmetric structure. The length of the list then determines the order of rotational symmetry.