From 15f7d8e7a7ccc982a3d3d03a71e06f708c504cae Mon Sep 17 00:00:00 2001 From: AlphaSquad Date: Wed, 7 Apr 2021 14:25:02 +0200 Subject: [PATCH] Fixed debug and protected the privates --- UnitigGraph.cpp | 2 +- UnitigGraph.h | 4 ++-- main.cpp | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/UnitigGraph.cpp b/UnitigGraph.cpp index 9fce7aa..af4daed 100644 --- a/UnitigGraph.cpp +++ b/UnitigGraph.cpp @@ -21,7 +21,7 @@ UnitigGraph::UnitigGraph() : cc_(1) // constructor of the so-called UnitigGraph // unifies all simple paths in the deBruijnGraph to a single source->sink path // all remaining nodes have either indegree != outdegree or indegree == outdegree > 1 -UnitigGraph::UnitigGraph(deBruijnGraph& dbg, std::string p, std::string logf, float error_rate, unsigned int strict, unsigned int filter, int thresh, bool l=false) : cc_(1), logfile_(logf), filter_length_(filter), thresh_(thresh), long_(l), true_(false) +UnitigGraph::UnitigGraph(deBruijnGraph& dbg, std::string p, std::string logf, float error_rate, unsigned int strict, unsigned int filter, int thresh, bool l, bool debug) : cc_(1), logfile_(logf), filter_length_(filter), thresh_(thresh), long_(l), true_(false), debug_(debug) { std::ofstream log; log.open(logfile_, std::ofstream::out | std::ofstream::app); diff --git a/UnitigGraph.h b/UnitigGraph.h index a45c0b0..88ee889 100644 --- a/UnitigGraph.h +++ b/UnitigGraph.h @@ -100,7 +100,7 @@ typedef std::vector Connected_Component; // to distinguish from regular class UnitigGraph { public: // create a UnitigGraph from a dBg and its unbalanced vertices - UnitigGraph(deBruijnGraph&, std::string, std::string, float, unsigned int, unsigned int, int, bool); + UnitigGraph(deBruijnGraph&, std::string, std::string, float, unsigned int, unsigned int, int, bool, bool); UnitigGraph(); // debug ~UnitigGraph(); void set_debug(); @@ -109,7 +109,6 @@ class UnitigGraph { void printGraph(std::ostream&, unsigned int cc); void dijkstra(UEdge seed, bool residual, bool local, unsigned int cc); std::vector greedy(UEdge seed, bool residual, bool local, unsigned int cc); - bool debug_; private: void connectUnbalanced(Vertex*, unsigned int*, std::string, deBruijnGraph&, float, float threshold); std::vector > addNeighbours(std::string& curr, const std::vector&, const std::vector&, deBruijnGraph&, unsigned int*, UVertex&, float threshold, float error); @@ -164,6 +163,7 @@ class UnitigGraph { int thresh_; bool long_; bool true_; + bool debug_; }; diff --git a/main.cpp b/main.cpp index a45bc6e..3675d0e 100644 --- a/main.cpp +++ b/main.cpp @@ -87,8 +87,7 @@ int main (int argc, char* argv[]) logfile << "Building deBruijnGraph took " << (clock() - t)/1000000. << " seconds." << std::endl; logfile.close(); t = clock(); - UnitigGraph ug = UnitigGraph(*dbg, cov, log, e, strict, filter, thresh, l); //argv[2] is k - ug.debug_ = debug; + UnitigGraph ug = UnitigGraph(*dbg, cov, log, e, strict, filter, thresh, l, debug); //argv[2] is k delete dbg; if (true_flow) {