11 #ifndef DEPENDENCY_GRAPH_H
12 #define DEPENDENCY_GRAPH_H
20 #include <unordered_set>
27 typedef std::unordered_map< Graph*, ProbabilityMatrix> ProbabilityMatrixStorage;
31 class DependencyGraph {
33 DependencyGraph(std::vector<std::string> structures, std::string constraints, R rand);
34 std::string get_graphml();
35 std::string get_graphml(
int connected_component_ID);
39 SolutionSizeType number_of_sequences();
40 SolutionSizeType number_of_sequences(
int connected_component_ID);
41 int number_of_connected_components();
42 std::vector< int > component_vertices(
int connected_component_ID);
43 std::vector< int > articulation_vertices();
44 std::vector< int > articulation_vertices(
int connected_component_ID);
45 unsigned long set_seed(
int seed) {
49 unsigned long set_seed();
50 unsigned int max_number_of_dimensions() {
51 return max_dimensions;
53 Sequence get_sequence();
54 std::string get_sequence_string();
55 SolutionSizeType set_sequence(Sequence sequence);
56 SolutionSizeType set_sequence_string(std::string seq_str);
57 SolutionSizeType sample();
59 SolutionSizeType sample_local_global(
int graph_type,
int min_num_pos,
int max_num_pos);
60 SolutionSizeType sample_clocal(
int connected_component_ID);
61 SolutionSizeType sample(
int position);
62 SolutionSizeType sample(
int start,
int end);
63 void set_history_size(
unsigned int size);
64 bool revert_sequence(
unsigned int jump);
65 std::vector< std::string > get_history();
68 ProbabilityMatrixStorage pms;
71 std::list<Sequence> history;
72 unsigned int history_size;
74 unsigned int max_dimensions = 0;
75 void remember_sequence();
76 void calculate_probabilities(Graph& g, std::chrono::steady_clock::time_point& start_time);
77 ProbabilityFraction sample_sequence(Graph& g);
78 void reset_colors(Graph& g);
79 SolutionSizeType sample(Graph& g);
80 Graph* find_path_subgraph(Vertex v_global, Graph& g);
84 void get_subgraphs(Graph& g, std::unordered_set< Graph* >& subgraphs,
int type,
unsigned int min_size,
unsigned int max_size);
85 std::string sequence_to_string(Sequence sequence);
89 inline void check_timeout(std::chrono::steady_clock::time_point& start_time) {
90 if (*construction_timeout_ptr != 0) {
91 std::chrono::duration<double> time_span = std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::steady_clock::now() - start_time);
92 if (time_span.count() > *construction_timeout_ptr) {
94 ss <<
"Timeout: Construction of the dependency graph took longer than expected!" << std::endl <<
95 "Stopped after " << time_span.count() <<
" seconds (Timeout: " << *construction_timeout_ptr <<
" seconds)" << std::endl;
96 throw std::overflow_error( ss.str() );
This file holds all global includes, definitions and variables.
This file holds all important information for the dependency graph, its definition and often used fun...
All classes and functions for the RNA design library are under the design namespace.
This file holds the functions to sample a sequence for a certain path.
This file holds the class definitions for the Probability Matrix.