RNAblueprint-1.3.2
|
Dependency Graph which holds all structural constraints. More...
Public Member Functions | |
DependencyGraph (std::vector< std::string > structures, std::string constraints, R rand) | |
Constructor for the Dependency graph. More... | |
DependencyGraph (std::vector< std::string > structures, std::string constraints, unsigned long seed) | |
constructor for the Dependency graph using a predefined random number generator with the given seed. More... | |
DependencyGraph (std::vector< std::string > structures, std::string constraints) | |
constructor for the Dependency graph using a predefined random number generator with a clock generated seed. More... | |
DependencyGraph (std::vector< std::string > structures, R rand) | |
constructor for the Dependency graph without any sequence constraints. More... | |
DependencyGraph (std::vector< std::string > structures) | |
constructor for the Dependency graph using a predefined random number generator with a clock generated seed and an empty string as sequence constraints. More... | |
DependencyGraph (const DependencyGraph ©) | |
Copy constructor which sets a new random seed in the copy sampled from the old generator. More... | |
~DependencyGraph () | |
Destructor for the dependency graph object. More... | |
void | set_history_size (unsigned int size) |
Set the maximum number of previous sampled sequences to memorize (Default: 100). More... | |
std::string | get_graphml () |
Returns the root graph in GraphML format as a string. More... | |
std::string | get_graphml (int connected_component_ID) |
Returns the connected component graph with the connected_component_ID in GraphML format as a string. More... | |
std::string | get_sequence () |
Get the current RNA sequence as a string. More... | |
SolutionSizeType | set_sequence (std::string sequence) |
Allows you to set a initial sequence as starting point for your optimization. More... | |
bool | revert_sequence () |
Reverts the sequence to the previous one. More... | |
bool | revert_sequence (unsigned int jump) |
Reverts the sequence to a previous one being (jump) steps in the history;. More... | |
std::vector< std::string > | get_history () |
Returns the history of previous sampled sequences at this point. More... | |
SolutionSizeType | sample () |
Resets all bases in the whole dependency graph and samples a new sequence randomly. More... | |
SolutionSizeType | sample (int position) |
Resets and samples only the smallest subgraph(s) possible containing the vertex at the given position in the sequence. More... | |
SolutionSizeType | sample (int start, int end) |
Resets only the smallest subgraph(s) possible containing the vertices from position start to end. More... | |
SolutionSizeType | sample_plocal (int min_num_pos, int max_num_pos) |
Randomly chooses one path (either top-level a connected component, or within a block, etc.) with the given size and samples all positions. More... | |
SolutionSizeType | sample_plocal () |
Randomly chooses one path (either top-level a connected component, or within a block, etc.) and samples all positions. More... | |
SolutionSizeType | sample_clocal (int min_num_pos, int max_num_pos) |
Randomly chooses a connected component with the given size and samples a new sequence for the whole component. More... | |
SolutionSizeType | sample_clocal (int connected_component_ID) |
Takes the connected component with the specified ID and samples a new sequence for the whole component. More... | |
SolutionSizeType | sample_clocal () |
Takes a random connected component and samples a new sequence for the whole component. More... | |
SolutionSizeType | number_of_sequences () |
Returns the amount of solutions given the dependency graph and sequence constraints. More... | |
SolutionSizeType | number_of_sequences (int connected_component_ID) |
Returns the amount of solutions for the connected component with the given ID. More... | |
int | number_of_connected_components () |
Returns the number of connected components into which the dependency graph was decomposed. More... | |
std::vector< int > | component_vertices (int connected_component_ID) |
Returns a vector with all the vertices in this component of the given ID. More... | |
std::vector< int > | articulation_vertices () |
Returns a list of vertices specified as articulation vertices. More... | |
std::vector< int > | articulation_vertices (int connected_component_ID) |
Returns a list of vertices in the specified connected component specified as articulation vertices. More... | |
unsigned int | max_number_of_dimensions () |
Returns the maximal number of dimensions of all dynamic programming tables. More... | |
Private Attributes | |
detail::DependencyGraph< R > * | g |
Pointer to the internal dependency graph object. More... | |
Dependency Graph which holds all structural constraints.
This graph is used to generate valid sequences compatible to the input structures
Definition at line 192 of file RNAblueprint.h.
design::DependencyGraph< R >::DependencyGraph | ( | std::vector< std::string > | structures, |
std::string | constraints, | ||
R | rand | ||
) |
Constructor for the Dependency graph.
structures | vector of string structures in dot-bracket notation. |
constraints | string containing the sequence constraints in IUPAC notation. Can also be a empty string! |
rand | random number generator of your choice. Supported at the moment is only std::mt19937, but as it is templated, it can easily be extended to support more generators. |
std::exception | if input is invalid or construction fails an exception is thrown. |
design::DependencyGraph< R >::DependencyGraph | ( | std::vector< std::string > | structures, |
std::string | constraints, | ||
unsigned long | seed | ||
) |
constructor for the Dependency graph using a predefined random number generator with the given seed.
structures | vector of string structures in dot-bracket notation. |
constraints | string containing the sequence constraints in IUPAC notation. Can also be a empty string! |
seed | unsigned long to be used as seed of the random number generator. |
std::exception | if input is invalid or construction fails an exception is thrown. |
design::DependencyGraph< R >::DependencyGraph | ( | std::vector< std::string > | structures, |
std::string | constraints | ||
) |
constructor for the Dependency graph using a predefined random number generator with a clock generated seed.
structures | vector of string structures in dot-bracket notation. |
constraints | string containing the sequence constraints in IUPAC notation. Can also be a empty string! |
std::exception | if input is invalid or construction fails an exception is thrown. |
design::DependencyGraph< R >::DependencyGraph | ( | std::vector< std::string > | structures, |
R | rand | ||
) |
constructor for the Dependency graph without any sequence constraints.
structures | vector of string structures in dot-bracket notation. |
rand | random number generator of your choice. Supported at the moment is only std::mt19937, but as it is templated, it can easily be extended to support more generators. |
std::exception | if input is invalid or construction fails an exception is thrown. |
design::DependencyGraph< R >::DependencyGraph | ( | std::vector< std::string > | structures | ) |
constructor for the Dependency graph using a predefined random number generator with a clock generated seed and an empty string as sequence constraints.
structures | vector of string structures in dot-bracket notation. |
std::exception | if input is invalid or construction fails an exception is thrown. |
design::DependencyGraph< R >::DependencyGraph | ( | const DependencyGraph< R > & | copy | ) |
Copy constructor which sets a new random seed in the copy sampled from the old generator.
design::DependencyGraph< R >::~DependencyGraph | ( | ) |
Destructor for the dependency graph object.
std::vector< int > design::DependencyGraph< R >::articulation_vertices | ( | ) |
Returns a list of vertices specified as articulation vertices.
These articulation vertices are also known as cut points or attachment points and also include cycle opening cuts.
std::vector< int > design::DependencyGraph< R >::articulation_vertices | ( | int | connected_component_ID | ) |
Returns a list of vertices in the specified connected component specified as articulation vertices.
These articulation vertices include cut points, articulation points and also a cycle opening cuts.
connected_component_ID | integer specifying the connected component with its ID [ 0, number_of_connected_components() ). |
std::out_of_range | if connected_component_ID is invalid. |
std::vector<int> design::DependencyGraph< R >::component_vertices | ( | int | connected_component_ID | ) |
Returns a vector with all the vertices in this component of the given ID.
connected_component_ID | integer specifying the connected component with its ID [ 0, number_of_connected_components() ). |
std::out_of_range | if connected_component_ID is invalid. |
std::string design::DependencyGraph< R >::get_graphml | ( | ) |
Returns the root graph in GraphML format as a string.
Get the dependency graph in the XML based GraphML format for further analysis or visualization.
std::string design::DependencyGraph< R >::get_graphml | ( | int | connected_component_ID | ) |
Returns the connected component graph with the connected_component_ID in GraphML format as a string.
Get the graph for a specific connected component in the XML based GraphML format for further analysis or visualization.
connected_component_ID | integer specifying the connected component with its ID [ 0, number_of_connected_components() ). |
std::out_of_range | if connected_component_ID is invalid. |
std::vector< std::string > design::DependencyGraph< R >::get_history | ( | ) |
Returns the history of previous sampled sequences at this point.
std::string design::DependencyGraph< R >::get_sequence | ( | ) |
Get the current RNA sequence as a string.
This sequence is only N directly after construction. You need to call either set or sample a initial sequence to avoid this behavior.
unsigned int design::DependencyGraph< R >::max_number_of_dimensions | ( | ) |
Returns the maximal number of dimensions of all dynamic programming tables.
This value is a great measure for the complexity of the graph coloring approach for the chosen input constraints.
int design::DependencyGraph< R >::number_of_connected_components | ( | ) |
Returns the number of connected components into which the dependency graph was decomposed.
SolutionSizeType design::DependencyGraph< R >::number_of_sequences | ( | ) |
Returns the amount of solutions given the dependency graph and sequence constraints.
Number of sequences is the total amount of sequences possible for the given structural and sequence constraints. This defines the size of the solution space.
SolutionSizeType design::DependencyGraph< R >::number_of_sequences | ( | int | connected_component_ID | ) |
Returns the amount of solutions for the connected component with the given ID.
Number of sequences is the total amount of sequences possible for the given connected component.
connected_component_ID | integer specifying the connected component with its ID [ 0, number_of_connected_components() ). |
std::out_of_range | if connected_component_ID is invalid. |
bool design::DependencyGraph< R >::revert_sequence | ( | ) |
Reverts the sequence to the previous one.
This sets the dependency graph to the previous sampled sequence state.
bool design::DependencyGraph< R >::revert_sequence | ( | unsigned int | jump | ) |
Reverts the sequence to a previous one being (jump) steps in the history;.
jump | integer specifying the length of the time-jump. 2 would for example revert the sequence to the one before the previous one. |
SolutionSizeType design::DependencyGraph< R >::sample | ( | ) |
Resets all bases in the whole dependency graph and samples a new sequence randomly.
Call get_sequence() after you sampled a new sequence. It is not possible to retrieve the previous sequence with this move.
SolutionSizeType design::DependencyGraph< R >::sample | ( | int | position | ) |
Resets and samples only the smallest subgraph(s) possible containing the vertex at the given position in the sequence.
This way you can optimize by targeted sampling at the given positions. All positions dependent on the chosen one will also be sampled. If your position is a articulation vertex, the whole connected component will be re-sampled. Else, in case of being a non-articulation vertex, only the smallest path containing the vertex will be sampled.
position | integer specifying the position to re-sample [ 0, N ) |
SolutionSizeType design::DependencyGraph< R >::sample | ( | int | start, |
int | end | ||
) |
Resets only the smallest subgraph(s) possible containing the vertices from position start to end.
This way you can optimize by targeted sampling at the given positions. All positions dependent on the chosen ones will also be sampled. If your positions contain articulation vertices, the whole connected components will be re-sampled. Else, in case of being only non-articulation vertex, only the smallest paths containing the vertices will be sampled. Positions for start and end are inclusive [ start, end ]
start | integer specifying the first position to re-sample [ 0, N ) |
end | integer specifying the last position to re-sample [ 0, N ) |
SolutionSizeType design::DependencyGraph< R >::sample_clocal | ( | ) |
Takes a random connected component and samples a new sequence for the whole component.
SolutionSizeType design::DependencyGraph< R >::sample_clocal | ( | int | connected_component_ID | ) |
Takes the connected component with the specified ID and samples a new sequence for the whole component.
connected_component_ID | integer specifying the connected component with its ID [ 0, number_of_connected_components() ). |
std::out_of_range | if connected_component_ID is invalid. |
SolutionSizeType design::DependencyGraph< R >::sample_clocal | ( | int | min_num_pos, |
int | max_num_pos | ||
) |
Randomly chooses a connected component with the given size and samples a new sequence for the whole component.
This is a more global way of sampling a new sequence as it exchanges a much bigger graph object. min_num_pos, max_num_pos set the minimal/maximal number of sampled positions, e.g., for [ 3, 5 ] only connected components with minimal 3 and maximal 5 vertices will be chosen for sampling.
min_num_pos | integer specifying the minimal size of the component to re-sample [ 1, N ) |
max_num_pos | integer specifying the maximal size of the component to re-sample [ 1, N ). 0 defines infinity. |
SolutionSizeType design::DependencyGraph< R >::sample_plocal | ( | ) |
Randomly chooses one path (either top-level a connected component, or within a block, etc.) and samples all positions.
SolutionSizeType design::DependencyGraph< R >::sample_plocal | ( | int | min_num_pos, |
int | max_num_pos | ||
) |
Randomly chooses one path (either top-level a connected component, or within a block, etc.) with the given size and samples all positions.
Articulation vertices such as cut points or articulation points will stay the same. Therefore it is guaranteed that the sampling is correct, even if we only sample a small local piece of a more complex graph object. min_num_pos and max_num_pos set the minimal/maximal number of sampled positions, e.g., for [ 3, 5 ] only paths with minimal 3 and maximal 5 non-articulation vertices will be chosen for sampling.
min_num_pos | integer specifying the minimal size of the component to re-sample [ 1, N ) |
max_num_pos | integer specifying the maximal size of the component to re-sample [ 1, N ). 0 defines infinity. |
void design::DependencyGraph< R >::set_history_size | ( | unsigned int | size | ) |
Set the maximum number of previous sampled sequences to memorize (Default: 100).
A history of all sampled sequences is stored within the dependency graph object. Use this function to set the size of the storage stack (Minimum: 1).
size | integer to set the size (>0) of the history storage container. |
SolutionSizeType design::DependencyGraph< R >::set_sequence | ( | std::string | sequence | ) |
Allows you to set a initial sequence as starting point for your optimization.
Only real bases are allowed and the sequence has to fulfill all structural constraints, otherwise an error is thrown.
sequence | string containing the sequence constraints in IUPAC notation. Only [AUGC] are allowed as bases. |
std::exception | if input string contains invalid characters or constraints cannot be fulfilled. |
|
private |
Pointer to the internal dependency graph object.
Definition at line 448 of file RNAblueprint.h.