Skip to content

Commit

Permalink
added defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
gf777 committed Jul 4, 2024
1 parent bac555e commit d0ec5da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 9 additions & 0 deletions include/kreeq.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,15 @@ class DBG : public Kmap<DBG, UserInputKreeq, uint64_t, DBGkmer, DBGkmer32> { //

DBG(UserInputKreeq& userInput) : Kmap{userInput}, userInput(userInput) {
DBextension = "kreeq";

if (userInput.kmerDepth == -1) {
if (userInput.travAlgorithm == "best-first") {
this->userInput.kmerDepth = userInput.kmerLen; // unidirectional search
this->userInput.maxSpan = userInput.kmerLen;
}
else if (userInput.travAlgorithm == "traversal")
this->userInput.kmerDepth = std::ceil((float)userInput.kmerLen/2); // kmer search is in both directions
}
}

~DBG(){
Expand Down
4 changes: 0 additions & 4 deletions src/subgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,8 @@ bool DBG::DBGsubgraphFromSegment(InSegment *inSegment, std::array<uint16_t, 2> m

void DBG::searchGraph() {
if (userInput.travAlgorithm == "best-first") {
if (this->userInput.kmerDepth == -1)
userInput.kmerDepth = userInput.kmerLen; // unidirectional search
bestFirst();
}else if (userInput.travAlgorithm == "traversal") {
if (userInput.kmerDepth == -1)
userInput.kmerDepth = std::ceil((float)userInput.kmerLen/2); // kmer search is in both directions
traversal();
}else{
fprintf(stderr, "Cannot find input algorithm (%s). Terminating.\n", userInput.travAlgorithm.c_str());
Expand Down

0 comments on commit d0ec5da

Please sign in to comment.