Skip to content

Commit

Permalink
Fixed debug and protected the privates
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaSquad committed Apr 7, 2021
1 parent c6de9ce commit 15f7d8e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion UnitigGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions UnitigGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ typedef std::vector<UVertex> 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();
Expand All @@ -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<UEdge> 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<std::pair<Vertex*,std::string> > addNeighbours(std::string& curr, const std::vector<char>&, const std::vector<char>&, deBruijnGraph&, unsigned int*, UVertex&, float threshold, float error);
Expand Down Expand Up @@ -164,6 +163,7 @@ class UnitigGraph {
int thresh_;
bool long_;
bool true_;
bool debug_;

};

Expand Down
3 changes: 1 addition & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 15f7d8e

Please sign in to comment.