Skip to content

Commit

Permalink
Merge changes for 1.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
svenderheld committed Jun 24, 2019
1 parent 3a1de3a commit 5aa5ec1
Show file tree
Hide file tree
Showing 10 changed files with 624 additions and 459 deletions.
3 changes: 2 additions & 1 deletion RELEASE_CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ RELEASE CHECKLIST
* Write Known Issues List (or update \bug statements in documentation)
* Remove debugging and testing code and print statements

* Bump Software Version in configure.ac

* Verify that every function appears in the Test Scripts
* Run Unit tests on final build

Expand All @@ -16,7 +18,6 @@ RELEASE CHECKLIST

* Verify that User Documentation matches current Release

* Bump Software Version
* Tag and Branch the source code repository
* Create the releasable tarball
* Push to Github
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# RNAblueprint: configure.ac

# initial information about the project
AC_INIT([RNAblueprint],[1.2.3],[s.hammer@univie.ac.at],[RNAblueprint],[https://github.com/ViennaRNA/RNAblueprint])
AC_INIT([RNAblueprint],[1.3.0],[sven@bioinf.uni-leipzig.de],[RNAblueprint],[https://github.com/ViennaRNA/RNAblueprint])

# automake initialisation (mandatory)
AC_PREREQ([2.59])
Expand Down
82 changes: 41 additions & 41 deletions lib/RNAblueprint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
#include "RNAblueprint.h"

namespace design {

void initialize_library(bool debug) {
initialize_library(debug, 0);
}

void initialize_library(bool debug, int construction_timeout) {
*detail::debug_ptr = debug;
*detail::construction_timeout_ptr = construction_timeout;
}

std::string structures_to_graphml(std::vector<std::string> structures, std::string constraints, bool decompose, unsigned long seed) {
detail::Graph graph;
// generate graph from input vector
Expand All @@ -30,14 +30,14 @@ namespace design {
ss << "Error while parsing the structures: " << std::endl << e.what();
throw std::logic_error(ss.str());
}

// set sequence constraints
try {
detail::set_constraints(graph, constraints);
} catch (std::exception& e) {
throw std::logic_error(e.what());
}

if (decompose) {
try {
std::mt19937 rand(seed);
Expand All @@ -48,23 +48,23 @@ namespace design {
throw std::logic_error(ss.str());
}
}

std::ostringstream stream;
detail::print_graph(graph, dynamic_cast<std::ostream*>(&stream));
return stream.str();
}

std::string structures_to_graphml(std::vector<std::string> structures, std::string constraints, bool decompose) {
unsigned long seed = std::chrono::system_clock::now().time_since_epoch().count();
return structures_to_graphml(structures, constraints, decompose, seed);
}

std::string structures_to_graphml(std::vector<std::string> structures, std::string constraints) {
unsigned long seed = std::chrono::system_clock::now().time_since_epoch().count();
return structures_to_graphml(structures, constraints, true, seed);
}


bool graph_is_bipartite(std::vector<std::string> structures) {
detail::Graph graph;
// generate graph from input vector
Expand All @@ -75,11 +75,11 @@ namespace design {
ss << "Error while parsing the structures: " << std::endl << e.what();
throw std::logic_error(ss.str());
}

// return if graph is bipartite
return boost::is_bipartite(graph);
}

bool sequence_structure_compatible(std::string sequence, std::vector<std::string> structures) {
detail::Graph graph;
// generate graph from input vector
Expand All @@ -90,7 +90,7 @@ namespace design {
ss << "Error while parsing the structures: " << std::endl << e.what();
throw std::logic_error(ss.str());
}

// set sequence constraints
try {
detail::set_constraints(graph, sequence);
Expand All @@ -99,7 +99,7 @@ namespace design {
}
return true;
}

std::vector<int> incompatible_sequence_positions(std::string sequence, std::string structure) {
detail::Graph graph;
// generate graph from input vector
Expand All @@ -110,7 +110,7 @@ namespace design {
ss << "Error while parsing the structures: " << std::endl << e.what();
throw std::logic_error(ss.str());
}

// set sequence constraints
return detail::set_constraints(graph, sequence, false);
}
Expand All @@ -119,33 +119,33 @@ namespace design {
DependencyGraph<R>::DependencyGraph(std::vector<std::string> structures, std::string constraints, R rand) {
g = new detail::DependencyGraph<R>(structures, constraints, rand);
}

template <>
DependencyGraph<std::mt19937>::DependencyGraph(std::vector<std::string> structures, std::string constraints, unsigned long seed) {
// initialize mersenne twister with the given seed
g = new detail::DependencyGraph<std::mt19937>(structures, constraints, std::mt19937());
g->set_seed(seed);
}

template<>
DependencyGraph<std::mt19937>::DependencyGraph(std::vector<std::string> structures, std::string constraints) {
// initialize mersenne twister and set a clock seed
g = new detail::DependencyGraph<std::mt19937>(structures, constraints, std::mt19937());
g->set_seed();
}

template <typename R>
DependencyGraph<R>::DependencyGraph(std::vector<std::string> structures, R rand) {
g = new detail::DependencyGraph<R>(structures, "", rand);
}

template<>
DependencyGraph<std::mt19937>::DependencyGraph(std::vector<std::string> structures) {
// initialize mersenne twister with a mersenne twister engine and set a clock seed
g = new detail::DependencyGraph<std::mt19937>(structures, "", std::mt19937());
g->set_seed();
}

template <typename R>
DependencyGraph<R>::DependencyGraph(const DependencyGraph& copy) {
g = new detail::DependencyGraph<R>(*copy.g);
Expand All @@ -157,17 +157,17 @@ namespace design {
DependencyGraph<R>::~DependencyGraph() {
delete g;
}

template <typename R>
void DependencyGraph<R>::set_history_size(unsigned int size) {
g->set_history_size(size);
}

template <typename R>
std::string DependencyGraph<R>::get_graphml() {
return g->get_graphml();
}

template <typename R>
std::string DependencyGraph<R>::get_graphml(int connected_component_ID) {
return g->get_graphml(connected_component_ID);
Expand All @@ -177,7 +177,7 @@ namespace design {
std::string DependencyGraph<R>::get_sequence() {
return g->get_sequence_string();
}

template <typename R>
SolutionSizeType DependencyGraph<R>::set_sequence(std::string sequence) {
return g->set_sequence_string(sequence);
Expand All @@ -187,57 +187,57 @@ namespace design {
SolutionSizeType DependencyGraph<R>::sample() {
return g->sample();
}

template <typename R>
bool DependencyGraph<R>::revert_sequence() {
return g->revert_sequence(1);
}

template <typename R>
bool DependencyGraph<R>::revert_sequence(unsigned int jump) {
return g->revert_sequence(jump);
}

template <typename R>
std::vector< std::string > DependencyGraph<R>::get_history() {
return g->get_history();
}

template <typename R>
SolutionSizeType DependencyGraph<R>::sample_plocal(int min_num_pos, int max_num_pos) {
// if local_global=-1 we will sample only actual graphs (independent of their type)
return g->sample_local_global(-1, min_num_pos, max_num_pos);
}

template <typename R>
SolutionSizeType DependencyGraph<R>::sample_plocal() {
// if local_global=-1 we will sample only actual graphs, with 0,0 we choose any
return g->sample_local_global(-1, 0, 0);
}

template <typename R>
SolutionSizeType DependencyGraph<R>::sample_clocal(int min_num_pos, int max_num_pos) {
// if local_global=1 we will sample only connected components
return g->sample_local_global(1, min_num_pos, max_num_pos);
}

template <typename R>
SolutionSizeType DependencyGraph<R>::sample_clocal(int connected_component_ID) {
// sample the connected component with the ID
return g->sample_clocal(connected_component_ID);
}

template <typename R>
SolutionSizeType DependencyGraph<R>::sample_clocal() {
// sample any component with any size
return g->sample_local_global(1, 0, 0);
}

template <typename R>
SolutionSizeType DependencyGraph<R>::sample(int position) {
return g->sample(position);
}

template <typename R>
SolutionSizeType DependencyGraph<R>::sample(int start, int end) {
return g->sample(start, end);
Expand All @@ -247,37 +247,37 @@ namespace design {
SolutionSizeType DependencyGraph<R>::number_of_sequences() {
return g->number_of_sequences();
}

template <typename R>
SolutionSizeType DependencyGraph<R>::number_of_sequences(int connected_component_ID) {
return g->number_of_sequences(connected_component_ID);
}

template <typename R>
int DependencyGraph<R>::number_of_connected_components() {
return g->number_of_connected_components();
}

template <typename R>
std::vector<int> DependencyGraph<R>::component_vertices(int connected_component_ID) {
return g->component_vertices(connected_component_ID);
}

template <typename R>
std::vector< int > DependencyGraph<R>::articulation_vertices() {
return g->articulation_vertices();
}

template <typename R>
std::vector< int > DependencyGraph<R>::articulation_vertices(int connected_component_ID) {
return g->articulation_vertices(connected_component_ID);
}

template <typename R>
unsigned int DependencyGraph<R>::max_number_of_dimensions() {
return g->max_number_of_dimensions();
}

template class DependencyGraph<std::mt19937>;

}
Loading

0 comments on commit 5aa5ec1

Please sign in to comment.