Skip to content

Commit d0ec5da

Browse files
committed
added defaults
1 parent bac555e commit d0ec5da

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

include/kreeq.h

+9
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,15 @@ class DBG : public Kmap<DBG, UserInputKreeq, uint64_t, DBGkmer, DBGkmer32> { //
167167

168168
DBG(UserInputKreeq& userInput) : Kmap{userInput}, userInput(userInput) {
169169
DBextension = "kreeq";
170+
171+
if (userInput.kmerDepth == -1) {
172+
if (userInput.travAlgorithm == "best-first") {
173+
this->userInput.kmerDepth = userInput.kmerLen; // unidirectional search
174+
this->userInput.maxSpan = userInput.kmerLen;
175+
}
176+
else if (userInput.travAlgorithm == "traversal")
177+
this->userInput.kmerDepth = std::ceil((float)userInput.kmerLen/2); // kmer search is in both directions
178+
}
170179
}
171180

172181
~DBG(){

src/subgraph.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,8 @@ bool DBG::DBGsubgraphFromSegment(InSegment *inSegment, std::array<uint16_t, 2> m
289289

290290
void DBG::searchGraph() {
291291
if (userInput.travAlgorithm == "best-first") {
292-
if (this->userInput.kmerDepth == -1)
293-
userInput.kmerDepth = userInput.kmerLen; // unidirectional search
294292
bestFirst();
295293
}else if (userInput.travAlgorithm == "traversal") {
296-
if (userInput.kmerDepth == -1)
297-
userInput.kmerDepth = std::ceil((float)userInput.kmerLen/2); // kmer search is in both directions
298294
traversal();
299295
}else{
300296
fprintf(stderr, "Cannot find input algorithm (%s). Terminating.\n", userInput.travAlgorithm.c_str());

0 commit comments

Comments
 (0)