Skip to content

Commit 073bd20

Browse files
committed
Update kreeq.cpp
1 parent 60beaaf commit 073bd20

File tree

1 file changed

+2
-33
lines changed

1 file changed

+2
-33
lines changed

src/kreeq.cpp

+2-33
Original file line numberDiff line numberDiff line change
@@ -958,39 +958,8 @@ void DBG::DBGgraphToGFA() {
958958
if (nextFrontEdges.size() == 0) { // we found a dead end
959959
break;
960960
} else if (nextFrontEdges.size() > 1) { // we found a potentially fw branching node, if true, nothing more to be done
961-
962-
uint8_t edgeCount = 0; // we need to actually check that these nodes exist in the subgraph
963-
uint8_t nextKmer[k];
964-
std::string kmer = seed.substr(baseCounter, k);
965-
966-
for (uint8_t i : nextFrontEdges) {
967-
968-
nextKmerFromString(nextKmer, &kmer, 0, isFw ? i : 3-i);
969-
bool isNextFw = isFw; // need to make sure we do not invalidate variables if we are not using this node
970-
uint64_t nextKey = hash(nextKmer, &isNextFw);
971-
// std::cout<<reverseHash(nextKey)<<std::endl;
972-
973-
auto got = DBGsubgraph->find(nextKey);
974-
975-
if (got == DBGsubgraph->end()) {
976-
auto got = residualEdges.find(nextKey); // we couldn't find the next node as it was already visited and deleted
977-
if(got != residualEdges.end()) {
978-
residualEdges[node.first] = std::make_tuple(node.second,idCounter,side);
979-
++edgeCount;
980-
}else{ // lenient version:
981-
// fprintf(stderr, "The kmer is expected in the graph but not available (%s). Terminating.\n", reverseHash(key).c_str());
982-
// exit(EXIT_FAILURE);
983-
}
984-
//
985-
}else{++edgeCount;}
986-
987-
if (edgeCount > 1) // stop checking
988-
break;
989-
}
990-
if (edgeCount > 1) { // only if the new nodes actually exist in the subgraph we should stop elongation
991-
residualEdges[node.first] = std::make_tuple(node.second,idCounter,side); // we preserve the edge information
992-
break;
993-
}
961+
residualEdges[node.first] = std::make_tuple(node.second,idCounter,side); // we preserve the edge information
962+
break;
994963
}
995964
}
996965
};

0 commit comments

Comments
 (0)