Loading README.md +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ quick example for setting up and using the program on Linux. Installing the software on your system may be done by downloading it in binary format for immediate use: wget http://github.com/bbuchfink/diamond/releases/download/v0.9.28/diamond-linux64.tar.gz wget http://github.com/bbuchfink/diamond/releases/download/v0.9.29/diamond-linux64.tar.gz tar xzf diamond-linux64.tar.gz The extracted `diamond` binary file should be moved to a directory Loading src/ChangeLog +3 −0 Original line number Diff line number Diff line [0.9.29] - Fixed a bug that could cause taxonomy features to function incorrectly for databases created by versions 0.9.27 and 0.9.28. [0.9.28] - Fixed a bug that could cause alignment score overflows for scores > 65535 in frameshift alignment mode. - Fixed a clang compiler error. Loading src/align/align.cpp +11 −4 Original line number Diff line number Diff line Loading @@ -70,13 +70,13 @@ unique_ptr<Queue> Align_fetcher::queue_; vector<hit>::iterator Align_fetcher::it_; vector<hit>::iterator Align_fetcher::end_; void align_worker(size_t thread_id, const Parameters *params, const Metadata *metadata) void align_worker(size_t thread_id, const Parameters *params, const Metadata *metadata, const sequence *subjects, size_t subject_count) { Align_fetcher hits; Statistics stat; DpStat dp_stat; while (hits.get()) { if (hits.end == hits.begin) { if ((hits.end == hits.begin) && subjects == nullptr) { TextBuffer *buf = 0; if (!blocked_processing && *output_format != Output_format::daa && config.report_unaligned != 0) { buf = new TextBuffer; Loading @@ -98,7 +98,7 @@ void align_worker(size_t thread_id, const Parameters *params, const Metadata *me task_timer timer("Initializing mapper", hits.target_parallel ? 3 : UINT_MAX); mapper->init(); timer.finish(); mapper->run(stat); mapper->run(stat, subjects, subject_count); timer.go("Generating output"); TextBuffer *buf = 0; Loading @@ -123,6 +123,13 @@ void align_queries(Trace_pt_buffer &trace_pts, Consumer* output_file, const Para { const size_t max_size = (size_t)std::min(config.chunk_size*1e9 * 9 * 2 / config.lowmem, 2e9); pair<size_t, size_t> query_range; vector<sequence> subjects; if (config.swipe_all) { subjects.reserve(ref_seqs::get().get_length()); for (size_t i = 0; i < ref_seqs::get().get_length(); ++i) subjects.push_back(ref_seqs::get()[i]); } while (true) { task_timer timer("Loading trace points", 3); Trace_pt_list *v = new Trace_pt_list; Loading @@ -142,7 +149,7 @@ void align_queries(Trace_pt_buffer &trace_pts, Consumer* output_file, const Para threads.emplace_back(heartbeat_worker, query_range.second); size_t n_threads = config.load_balancing == Config::query_parallel ? (config.threads_align == 0 ? config.threads_ : config.threads_align) : 1; for (size_t i = 0; i < n_threads; ++i) threads.emplace_back(align_worker, i, ¶ms, &metadata); threads.emplace_back(align_worker, i, ¶ms, &metadata, subjects.empty() ? nullptr : subjects.data(), subjects.size()); for (auto &t : threads) t.join(); timer.finish(); Loading src/align/align.h +3 −3 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ namespace ExtensionPipeline { QueryMapper(params, query_id, begin, end) {} Target& target(size_t i); virtual void run(Statistics &stat); virtual void run(Statistics &stat, const sequence *subjects = nullptr, size_t subject_count = 0); virtual ~Pipeline() {} }; } Loading @@ -85,7 +85,7 @@ namespace ExtensionPipeline { Pipeline(const Parameters ¶ms, size_t query_id, Trace_pt_list::iterator begin, Trace_pt_list::iterator end) : QueryMapper(params, query_id, begin, end) {} virtual void run(Statistics &stat); virtual void run(Statistics &stat, const sequence *subjects = nullptr, size_t subject_count = 0); virtual ~Pipeline() {} }; } Loading @@ -98,7 +98,7 @@ namespace ExtensionPipeline { dp_stat(dp_stat) {} Target& target(size_t i); virtual void run(Statistics &stat); virtual void run(Statistics &stat, const sequence *subjects = nullptr, size_t subject_count = 0); void run_swipe(bool score_only); void range_ranking(); DpStat &dp_stat; Loading src/align/banded_swipe_pipeline.cpp +9 −7 Original line number Diff line number Diff line Loading @@ -154,18 +154,20 @@ void Pipeline::run_swipe(bool score_only) vector<DpTarget> vf, vr; for (size_t i = 0; i < n_targets(); ++i) target(i).add(*this, vf, vr, (int)i); list<Hsp> hsp; if (score_matrix.frame_shift()) { list<Hsp> hsp = banded_3frame_swipe(translated_query, FORWARD, vf.begin(), vf.end(), this->dp_stat, score_only, target_parallel); hsp = banded_3frame_swipe(translated_query, FORWARD, vf.begin(), vf.end(), this->dp_stat, score_only, target_parallel); hsp.splice(hsp.end(), banded_3frame_swipe(translated_query, REVERSE, vr.begin(), vr.end(), this->dp_stat, score_only, target_parallel)); } else { hsp = DP::BandedSwipe::swipe(query_seq(0), vf.begin(), vf.end(), Frame(0), query_cb[0], score_only ? 0 : DP::TRACEBACK); } while (!hsp.empty()) { list<Hsp> &l = target(hsp.begin()->swipe_target).hsps; l.splice(l.end(), hsp, hsp.begin()); } } else { DP::BandedSwipe::swipe(query_seq(0), vf.begin(), vf.end(), Frame(0), score_only ? 0 : DP::TRACEBACK); } } void build_ranking_worker(PtrVector<::Target>::iterator begin, PtrVector<::Target>::iterator end, Atomic<size_t> *next, vector<unsigned> *intervals) { PtrVector<::Target>::iterator it; Loading @@ -177,7 +179,7 @@ void build_ranking_worker(PtrVector<::Target>::iterator begin, PtrVector<::Targe } } void Pipeline::run(Statistics &stat) void Pipeline::run(Statistics &stat, const sequence *subjects, size_t subject_count) { task_timer timer("Init banded swipe pipeline", target_parallel ? 3 : UINT_MAX); Config::set_option(config.padding, 32); Loading Loading
README.md +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ quick example for setting up and using the program on Linux. Installing the software on your system may be done by downloading it in binary format for immediate use: wget http://github.com/bbuchfink/diamond/releases/download/v0.9.28/diamond-linux64.tar.gz wget http://github.com/bbuchfink/diamond/releases/download/v0.9.29/diamond-linux64.tar.gz tar xzf diamond-linux64.tar.gz The extracted `diamond` binary file should be moved to a directory Loading
src/ChangeLog +3 −0 Original line number Diff line number Diff line [0.9.29] - Fixed a bug that could cause taxonomy features to function incorrectly for databases created by versions 0.9.27 and 0.9.28. [0.9.28] - Fixed a bug that could cause alignment score overflows for scores > 65535 in frameshift alignment mode. - Fixed a clang compiler error. Loading
src/align/align.cpp +11 −4 Original line number Diff line number Diff line Loading @@ -70,13 +70,13 @@ unique_ptr<Queue> Align_fetcher::queue_; vector<hit>::iterator Align_fetcher::it_; vector<hit>::iterator Align_fetcher::end_; void align_worker(size_t thread_id, const Parameters *params, const Metadata *metadata) void align_worker(size_t thread_id, const Parameters *params, const Metadata *metadata, const sequence *subjects, size_t subject_count) { Align_fetcher hits; Statistics stat; DpStat dp_stat; while (hits.get()) { if (hits.end == hits.begin) { if ((hits.end == hits.begin) && subjects == nullptr) { TextBuffer *buf = 0; if (!blocked_processing && *output_format != Output_format::daa && config.report_unaligned != 0) { buf = new TextBuffer; Loading @@ -98,7 +98,7 @@ void align_worker(size_t thread_id, const Parameters *params, const Metadata *me task_timer timer("Initializing mapper", hits.target_parallel ? 3 : UINT_MAX); mapper->init(); timer.finish(); mapper->run(stat); mapper->run(stat, subjects, subject_count); timer.go("Generating output"); TextBuffer *buf = 0; Loading @@ -123,6 +123,13 @@ void align_queries(Trace_pt_buffer &trace_pts, Consumer* output_file, const Para { const size_t max_size = (size_t)std::min(config.chunk_size*1e9 * 9 * 2 / config.lowmem, 2e9); pair<size_t, size_t> query_range; vector<sequence> subjects; if (config.swipe_all) { subjects.reserve(ref_seqs::get().get_length()); for (size_t i = 0; i < ref_seqs::get().get_length(); ++i) subjects.push_back(ref_seqs::get()[i]); } while (true) { task_timer timer("Loading trace points", 3); Trace_pt_list *v = new Trace_pt_list; Loading @@ -142,7 +149,7 @@ void align_queries(Trace_pt_buffer &trace_pts, Consumer* output_file, const Para threads.emplace_back(heartbeat_worker, query_range.second); size_t n_threads = config.load_balancing == Config::query_parallel ? (config.threads_align == 0 ? config.threads_ : config.threads_align) : 1; for (size_t i = 0; i < n_threads; ++i) threads.emplace_back(align_worker, i, ¶ms, &metadata); threads.emplace_back(align_worker, i, ¶ms, &metadata, subjects.empty() ? nullptr : subjects.data(), subjects.size()); for (auto &t : threads) t.join(); timer.finish(); Loading
src/align/align.h +3 −3 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ namespace ExtensionPipeline { QueryMapper(params, query_id, begin, end) {} Target& target(size_t i); virtual void run(Statistics &stat); virtual void run(Statistics &stat, const sequence *subjects = nullptr, size_t subject_count = 0); virtual ~Pipeline() {} }; } Loading @@ -85,7 +85,7 @@ namespace ExtensionPipeline { Pipeline(const Parameters ¶ms, size_t query_id, Trace_pt_list::iterator begin, Trace_pt_list::iterator end) : QueryMapper(params, query_id, begin, end) {} virtual void run(Statistics &stat); virtual void run(Statistics &stat, const sequence *subjects = nullptr, size_t subject_count = 0); virtual ~Pipeline() {} }; } Loading @@ -98,7 +98,7 @@ namespace ExtensionPipeline { dp_stat(dp_stat) {} Target& target(size_t i); virtual void run(Statistics &stat); virtual void run(Statistics &stat, const sequence *subjects = nullptr, size_t subject_count = 0); void run_swipe(bool score_only); void range_ranking(); DpStat &dp_stat; Loading
src/align/banded_swipe_pipeline.cpp +9 −7 Original line number Diff line number Diff line Loading @@ -154,18 +154,20 @@ void Pipeline::run_swipe(bool score_only) vector<DpTarget> vf, vr; for (size_t i = 0; i < n_targets(); ++i) target(i).add(*this, vf, vr, (int)i); list<Hsp> hsp; if (score_matrix.frame_shift()) { list<Hsp> hsp = banded_3frame_swipe(translated_query, FORWARD, vf.begin(), vf.end(), this->dp_stat, score_only, target_parallel); hsp = banded_3frame_swipe(translated_query, FORWARD, vf.begin(), vf.end(), this->dp_stat, score_only, target_parallel); hsp.splice(hsp.end(), banded_3frame_swipe(translated_query, REVERSE, vr.begin(), vr.end(), this->dp_stat, score_only, target_parallel)); } else { hsp = DP::BandedSwipe::swipe(query_seq(0), vf.begin(), vf.end(), Frame(0), query_cb[0], score_only ? 0 : DP::TRACEBACK); } while (!hsp.empty()) { list<Hsp> &l = target(hsp.begin()->swipe_target).hsps; l.splice(l.end(), hsp, hsp.begin()); } } else { DP::BandedSwipe::swipe(query_seq(0), vf.begin(), vf.end(), Frame(0), score_only ? 0 : DP::TRACEBACK); } } void build_ranking_worker(PtrVector<::Target>::iterator begin, PtrVector<::Target>::iterator end, Atomic<size_t> *next, vector<unsigned> *intervals) { PtrVector<::Target>::iterator it; Loading @@ -177,7 +179,7 @@ void build_ranking_worker(PtrVector<::Target>::iterator begin, PtrVector<::Targe } } void Pipeline::run(Statistics &stat) void Pipeline::run(Statistics &stat, const sequence *subjects, size_t subject_count) { task_timer timer("Init banded swipe pipeline", target_parallel ? 3 : UINT_MAX); Config::set_option(config.padding, 32); Loading