Skip to content

Commit

Permalink
stable polymorphic version of kreeq
Browse files Browse the repository at this point in the history
gf777 committed Jun 12, 2024
1 parent 745a54e commit 2eba0e3
Showing 4 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion gfalibs
Submodule gfalibs updated 2 files
+3 −3 include/fastx.h
+2 −5 include/kmer.h
8 changes: 2 additions & 6 deletions include/kreeq.h
Original file line number Diff line number Diff line change
@@ -51,10 +51,7 @@ using parallelMap32 = phmap::parallel_flat_hash_map<uint64_t, DBGkmer32,

class DBG : public Kmap<DBG, UserInputKreeq, DBGkmer, DBGkmer32> { // CRTP

std::atomic<uint64_t> totMissingKmers{0}, totKcount{0}, totEdgeMissingKmers{0}, buffers{0};
std::atomic<bool> readingDone{false};
std::vector<std::thread> threads;
std::vector<std::future<bool>> futures;
std::atomic<uint64_t> totMissingKmers{0}, totKcount{0}, totEdgeMissingKmers{0};
UserInputKreeq userInput;

InSequencesDBG *genome;
@@ -63,8 +60,7 @@ class DBG : public Kmap<DBG, UserInputKreeq, DBGkmer, DBGkmer32> { // CRTP
parallelMap32 *DBGsubgraph = new parallelMap32;
std::vector<parallelMap32*> DBGTmpSubgraphs;
InSequences GFAsubgraph;

std::queue<std::string*> readBatches;

uint64_t totEdgeCount = 0;

public:
7 changes: 2 additions & 5 deletions src/graph-builder.cpp
Original file line number Diff line number Diff line change
@@ -39,7 +39,6 @@ bool DBG::hashSequences() {
while (true) {

{

std::unique_lock<std::mutex> lck(readMtx);

if (readingDone && readBatches.size() == 0)
@@ -56,7 +55,6 @@ bool DBG::hashSequences() {
readBatch = readBatches.front();
readBatches.pop();
len = readBatch->size();

}

if (len<k) {
@@ -222,7 +220,6 @@ bool DBG::processBuffers(uint16_t m) {
remove((userInput.prefix + "/.buf." + std::to_string(m) + ".bin").c_str());

return true;

}

bool DBG::reloadMap32(uint16_t m) {
@@ -346,8 +343,8 @@ void DBG::kunion(){ // concurrent merging of the maps that store the same hashes

std::vector<uint32_t> idx = sortedIndex(fileSizes, true); // sort by largest

// for(uint32_t i : idx)
// mergeMaps(i);
for(uint32_t i : idx)
mergeMaps(i);

dumpHighCopyKmers();

2 changes: 1 addition & 1 deletion src/input.cpp
Original file line number Diff line number Diff line change
@@ -93,7 +93,7 @@ void Input::read() {
unsigned int numFiles = userInput.inReads.size(); // number of input files

for (unsigned int i = 0; i < numFiles; ++i) // load each input file in the kmerdb
loadKmers(userInput, &knav, 'r', i);
loadKmers(userInput, knav, 'r', i);

lg.verbose("Reads loaded.");
knav.finalize();

0 comments on commit 2eba0e3

Please sign in to comment.