From b140696a76ac6a48f6ded643adce2865832058c8 Mon Sep 17 00:00:00 2001 From: "Bernardo J. Clavijo" Date: Fri, 6 Jan 2017 19:56:56 +0000 Subject: [PATCH] bug fix on 60-mer spectra --- src/paths/long/BuildReadQGraph.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/paths/long/BuildReadQGraph.cc b/src/paths/long/BuildReadQGraph.cc index 64ef7eb..9727737 100755 --- a/src/paths/long/BuildReadQGraph.cc +++ b/src/paths/long/BuildReadQGraph.cc @@ -1060,10 +1060,10 @@ std::vector createDictOMPRecursive(BRQ_Dict ** dict, vecbvec const OutputLog(2) << kmer_list.size() << " kmers counted, filtering..." << std::endl; (*dict) = new BRQ_Dict(kmer_list.size()); uint64_t used = 0,not_used=0; - uint64_t hist[101]; + uint64_t hist[256]; for (auto &h:hist) h=0; for (auto &knf:kmer_list) { - ++hist[std::min(100,(int)knf.count)]; + ++hist[std::min(255,(int)knf.count)]; if (knf.count >= minFreq) { (*dict)->insertEntryNoLocking(BRQ_Entry((BRQ_Kmer)knf,knf.kc)); used++; @@ -1076,7 +1076,7 @@ std::vector createDictOMPRecursive(BRQ_Dict ** dict, vecbvec const kmer_list.clear(); if (""!=workdir) { std::ofstream kff(workdir + "/small_K.freqs"); - for (auto i = 1; i < 101; i++) kff << i << ", " << hist[i] << std::endl; + for (auto i = 1; i < 256; i++) kff << i << ", " << hist[i] << std::endl; kff.close(); } @@ -1168,6 +1168,7 @@ void createDictOMPDiskBased(BRQ_Dict ** dict, vecbvec const& reads, VecPQVec con current_kmer.count=0; uint64_t used = 0,not_used=0; uint64_t hist[256]; + for (auto &h:hist) h=0; std::vector kmerlist; while (finished_files current_kmer) { - ++hist[current_kmer.count]; + ++hist[std::min(255,(int)current_kmer.count)]; if (current_kmer.count>=minFreq) { //(*dict)->insertEntryNoLocking(BRQ_Entry((BRQ_Kmer) current_kmer, current_kmer.kc)); kmerlist.push_back(current_kmer);