Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 9542bcaa9036f585f56048cb12c4eee8d12319c0
Author: Benjamin Buchfink <buchfink@gmail.com>
Date:   Sat Mar 18 11:17:52 2023 +0100

    Fixed PAF bug.

commit e6563b3dd023bd7bd4c81c7bce8ba7b655a635f0
Author: Benjamin Buchfink <buchfink@gmail.com>
Date:   Sat Mar 18 10:47:09 2023 +0100

    Fixed unaligned bug.

commit 285afd5f33b8a58eb2d1d2cf3afff08063446f94
Author: Benjamin Buchfink <buchfink@gmail.com>
Date:   Sat Mar 18 10:16:15 2023 +0100

    Fixed macOS compiler error.

commit 7dd350e04eb5626090313fe1af6d79e73711c6cc
Author: Benjamin Buchfink <buchfink@gmail.com>
Date:   Thu Mar 16 09:35:22 2023 +0100

    Added switch to disable tls.

commit 39c80484883ccbc31c439da1f37f5ef6dedb42f3
Merge: a11f8eda 21a32fc
Author: Benjamin Buchfink <buchfink@gmail.com>
Date:   Wed Mar 15 11:50:28 2023 +0100

    Merge branch 'master' into dev

commit a11f8eda395a1d7055d243346c1d786572c9343e
Author: Benjamin Buchfink <buchfink@gmail.com>
Date:   Wed Mar 15 11:49:23 2023 +0100

    Disable sse for building blast.

commit 857e96f539089474a66b37e35033ffcabd3bb8b3
Author: Benjamin Buchfink <buchfink@gmail.com>
Date:   Tue Mar 14 12:54:52 2023 +0100

    Fixed error.

commit f8b3c28075c6a7a0bf2764389696de372dd8aa59
Author: Benjamin Buchfink <buchfink@gmail.com>
Date:   Tue Mar 14 12:52:36 2023 +0100

    Removed iostream includes.

commit 24c930eed464fe08be2ab61f93042ce1a0fc804c
Author: Benjamin Buchfink <buchfink@gmail.com>
Date:   Tue Mar 14 11:29:03 2023 +0100

    Added new dispatch code.

commit b18d9e16043fc57122c095c91b29c0dcbf5f4b69
Author: Benjamin Buchfink <buchfink@gmail.com>
Date:   Tue Mar 14 10:57:10 2023 +0100

    Added new dispatch code.

commit f1b05d05d0948f99f30c3e854b522546940d115e
Author: Benjamin Buchfink <buchfink@gmail.com>
Date:   Mon Mar 13 17:22:15 2023 +0100

    Added new dispatch code.

commit 8c66829f0df52eabaffe58215c730dae2af8b521
Author: Benjamin Buchfink <buchfink@gmail.com>
Date:   Mon Mar 13 12:25:46 2023 +0100

    Added new dispatch code.

commit edb9ede545536c05ec47c16734a67a7c68b38033
Merge: 6b1658e2 c71b49c6
Author: Benjamin Buchfink <buchfink@gmail.com>
Date:   Mon Mar 13 09:55:35 2023 +0100

    Merge branch 'dev' of https://github.com/bbuchfink/diamond_dev into dev

commit c71b49c6d16f6134b7068aa896be7961de02bce3
Author: Benjamin Buchfink <buchfink@gmail.com>
Date:   Fri Mar 10 15:23:18 2023 +0100

    Handle non-x86 case.
  • Loading branch information
bbuchfink committed Mar 18, 2023
1 parent 21a32fc commit 0540f86
Show file tree
Hide file tree
Showing 102 changed files with 735 additions and 545 deletions.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ option(WITH_AVX512 "WITH_AVX512" OFF)
option(WITH_DNA "WITH_DNA" OFF)
option(WITH_MCL "WITH_MCL" OFF)
option(WITH_MIMALLOC "WITH_MIMALLOC" OFF)
option(USE_TLS "USE_TLS" OFF)
set(MAX_SHAPE_LEN 19)
set(BLAST_INCLUDE_DIR "" CACHE STRING "BLAST_INCLUDE_DIR")
set(BLAST_LIBRARY_DIR "" CACHE STRING "BLAST_LIBRARY_DIR")
Expand All @@ -45,6 +46,10 @@ if(STRICT_BAND)
add_definitions(-DSTRICT_BAND)
endif()

if(USE_TLS)
add_definitions(-DUSE_TLS)
endif()

if(SINGLE_THREADED)
add_definitions(-DSINGLE_THREADED)
endif()
Expand Down Expand Up @@ -148,7 +153,7 @@ endif()

set(DISPATCH_OBJECTS
"src/dp/swipe/banded_3frame_swipe.cpp"
"src/search/stage2.cpp"
"src/search/stage1_2.cpp"
"src/tools/benchmark.cpp"
"src/dp/swipe/swipe_wrapper.cpp"
"src/masking/tantan.cpp"
Expand All @@ -175,6 +180,8 @@ if(X86)
add_library(arch_avx512 OBJECT ${DISPATCH_OBJECTS})
target_include_directories(arch_avx512 PRIVATE "${CMAKE_SOURCE_DIR}/src/lib")
endif()
add_definitions(-DWITH_AVX2)
add_definitions(-DWITH_SSE4_1)
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
target_compile_options(arch_sse4_1 PUBLIC -DDISPATCH_ARCH=ARCH_SSE4_1 -DARCH_ID=1 -D__SSSE3__ -D__SSE4_1__ -D__POPCNT__ -DEigen=Eigen_SSE4_1)
target_compile_options(arch_avx2 PUBLIC -DDISPATCH_ARCH=ARCH_AVX2 -DARCH_ID=2 /arch:AVX2 -D__SSSE3__ -D__SSE4_1__ -D__POPCNT__ -DEigen=Eigen_AVX2)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ADD . .

RUN git clone https://github.com/ncbi/ncbi-cxx-toolkit-public.git
WORKDIR ncbi-cxx-toolkit-public
RUN ./cmake-configure --without-debug --with-projects="objtools/blast/seqdb_reader;objtools/blast/blastdb_format" --with-build-root=build
RUN ./cmake-configure --without-debug --with-projects="objtools/blast/seqdb_reader;objtools/blast/blastdb_format" --with-build-root=build --with-features="-SSE"
WORKDIR build/build
RUN make -j4
RUN cp /opt/diamond/ncbi-cxx-toolkit-public/build/inc/ncbiconf_unix.h /opt/diamond/ncbi-cxx-toolkit-public/include
Expand Down
8 changes: 8 additions & 0 deletions src/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[2.1.6]
- Fixed compatibility issues on older systems without support for AVX2.
- Fixed linker errors when compiled with `-DX86=OFF`.
- Fixed a compiler error on macOS systems.
- Fixed a bug that could cause missing tags in the XML output format and
unaligned queries not to be reported correctly.
- Fixed a bug that caused the PAF output format not to work correctly.

[2.1.5]
- Disabled the use of frequency based seed masking when using the linear-time
search feature with respect to the targets.
Expand Down
4 changes: 2 additions & 2 deletions src/align/align.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ TextBuffer* legacy_pipeline(const HitIterator::Hits& hits, Search::Config& cfg,

QueryMapper *mapper = new ExtensionPipeline::BandedSwipe::Pipeline(hits.query, hits.begin, hits.end, dp_stat, cfg);

task_timer timer("Initializing mapper", UINT_MAX);
TaskTimer timer("Initializing mapper", UINT_MAX);
mapper->init();
timer.finish();
mapper->run(stat, cfg);
Expand Down Expand Up @@ -293,7 +293,7 @@ void align_queries(Consumer* output_file, Search::Config& cfg)
const int64_t mem_limit = Util::String::interpret_number(config.memory_limit.get("16G"));

pair<BlockId, BlockId> query_range;
task_timer timer(nullptr, 3);
TaskTimer timer(nullptr, 3);

if (!cfg.blocked_processing && !cfg.iterated())
cfg.db->init_random_access(cfg.current_query_block, 0, false);
Expand Down
2 changes: 1 addition & 1 deletion src/align/extend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ pair<vector<Match>, Stats> extend(
}

pair<vector<Match>, Stats> extend(BlockId query_id, Search::Hit* begin, Search::Hit* end, const Search::Config &cfg, Statistics &stat, DP::Flags flags) {
task_timer timer(flag_any(flags, DP::Flags::PARALLEL) ? config.target_parallel_verbosity : UINT_MAX);
TaskTimer timer(flag_any(flags, DP::Flags::PARALLEL) ? config.target_parallel_verbosity : UINT_MAX);
timer.go("Loading seed hits");
SeedHitList l = load_hits(begin, end, cfg.target->seqs());
stat.inc(Statistics::TARGET_HITS0, l.target_block_ids.size());
Expand Down
2 changes: 1 addition & 1 deletion src/align/extend_chunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pair<vector<Target>, Stats> extend(BlockId query_id,
static const Loc GAPPED_FILTER_MIN_QLEN = 85;
const int64_t n = seed_hits_end - seed_hits;
stat.inc(Statistics::TARGET_HITS2, n);
task_timer timer(flag_any(flags, DP::Flags::PARALLEL) ? config.target_parallel_verbosity : UINT_MAX);
TaskTimer timer(flag_any(flags, DP::Flags::PARALLEL) ? config.target_parallel_verbosity : UINT_MAX);

if (cfg.lazy_masking && !config.global_ranking_targets)
stat.inc(Statistics::MASKED_LAZY, lazy_masking(target_block_ids, target_block_ids + n, *cfg.target, cfg.target_masking));
Expand Down
2 changes: 1 addition & 1 deletion src/align/gapped_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ using std::pair;

namespace Extension {

int gapped_filter(const SeedHit &hit, const LongScoreProfile<int8_t> *query_profile, const Sequence &target, int band, int window, std::function<decltype(DP::ARCH_GENERIC::scan_diags128)> f) {
int gapped_filter(const SeedHit &hit, const LongScoreProfile<int8_t> *query_profile, const Sequence &target, int band, int window, std::function<decltype(DP::scan_diags128)> f) {
const int slen = (int)target.length();
const int d = std::max(hit.diag() - band / 2, -(slen - 1)),
j0 = std::max(hit.j - window, 0),
Expand Down
2 changes: 1 addition & 1 deletion src/align/gapped_score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ pair<vector<Target>, Stats> align(const vector<WorkTarget> &targets, const Seque
LongScoreProfile<int16_t> p;
LongScoreProfile<int8_t> p8;
const bool hauser_cbs = ::Stats::CBS::hauser(config.comp_based_stats);
task_timer timer;
TaskTimer timer;
p = DP::make_profile16(query_seq[frame], hauser_cbs ? query_cb[frame].int8.data() : nullptr, 0);
p8 = DP::make_profile8(query_seq[frame], hauser_cbs ? query_cb[frame].int8.data() : nullptr, 0);
LongScoreProfile<int16_t> p_rev(p.reverse());
Expand Down
4 changes: 2 additions & 2 deletions src/align/global_ranking/extend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void align_worker(InputFile* query_list, const TargetMap* db2block_id, const Sea
}

void extend(SequenceFile& db, TempFile& merged_query_list, BitVector& ranking_db_filter, Search::Config& cfg, Consumer& master_out) {
task_timer timer("Loading reference sequences");
TaskTimer timer("Loading reference sequences");
InputFile query_list(merged_query_list);
db.set_seqinfo_ptr(0);
cfg.target.reset(db.load_seqs(INT64_MAX, &ranking_db_filter, SequenceFile::LoadFlags::SEQS));
Expand Down Expand Up @@ -178,7 +178,7 @@ static BitVector db_filter(const Search::Config::RankingTable& table, size_t db_
}

void extend(Search::Config& cfg, Consumer& out) {
task_timer timer("Listing target sequences");
TaskTimer timer("Listing target sequences");
const BitVector filter = db_filter(*cfg.ranking_table, cfg.db->sequence_count());
timer.go("Loading target sequences");
cfg.db->set_seqinfo_ptr(0);
Expand Down
2 changes: 1 addition & 1 deletion src/align/global_ranking/table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void update_table(Search::Config& cfg) {
log_stream << "Seed hits = " << hits.size() << endl;
if (hits.size() == 0)
return;
task_timer timer("Sorting seed hits");
TaskTimer timer("Sorting seed hits");
#if _MSC_FULL_VER == 191627042
merge_sort(hits.begin(), hits.end(), config.threads_, Search::Hit::CmpQueryTarget());
#else
Expand Down
2 changes: 1 addition & 1 deletion src/align/legacy/banded_swipe_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void build_ranking_worker(PtrVector<::Target>::iterator begin, PtrVector<::Targe

void Pipeline::run(Statistics &stat, const Search::Config& cfg)
{
task_timer timer("Init banded swipe pipeline", target_parallel ? 3 : UINT_MAX);
TaskTimer timer("Init banded swipe pipeline", target_parallel ? 3 : UINT_MAX);
Config::set_option(config.padding, 32);
if (n_targets() == 0)
return;
Expand Down
2 changes: 1 addition & 1 deletion src/align/legacy/query_mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ QueryMapper::QueryMapper(size_t query_id, Search::Hit* begin, Search::Hit* end,
void QueryMapper::init()
{
if(config.log_query)
std::cout << "Query = " << metadata.query->ids()[query_id] << '\t' << query_id << std::endl;
message_stream << "Query = " << metadata.query->ids()[query_id] << '\t' << query_id << std::endl;
if (Stats::CBS::hauser(config.comp_based_stats))
for (int i = 0; i < align_mode.query_contexts; ++i)
query_cb.emplace_back(query_seq(i));
Expand Down
2 changes: 1 addition & 1 deletion src/align/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ TextBuffer* generate_output(vector<Match> &targets, const Extension::Stats& stat
std::unique_ptr<OutputFormat> f(cfg.output_format->clone());
size_t seek_pos = 0;
unsigned n_hsp = 0, hit_hsps = 0;
Output::Info info{ cfg.query->seq_info(query_block_id), !targets.empty(), cfg.db.get(), *out, stats };
Output::Info info{ cfg.query->seq_info(query_block_id), targets.empty(), cfg.db.get(), *out, stats };
TranslatedSequence query = query_seqs.translated_seq(align_mode.query_translated ? cfg.query->source_seqs()[query_block_id] : query_seqs[query_block_id], query_block_id * align_mode.query_contexts);
const char *query_title = cfg.query->ids()[query_block_id];
const double query_self_aln_score = cfg.query->has_self_aln() ? cfg.query->self_aln_score(query_block_id) : 0.0;
Expand Down
2 changes: 1 addition & 1 deletion src/align/ungapped.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ WorkTarget::WorkTarget(BlockId block_id, const Sequence& seq, int query_len, con

WorkTarget ungapped_stage(FlatArray<SeedHit>::DataIterator begin, FlatArray<SeedHit>::DataIterator end, const Sequence *query_seq, const Bias_correction *query_cb, const ::Stats::Composition& query_comp, const int16_t** query_matrix, uint32_t block_id, Statistics& stat, const Block& targets, const Mode mode) {
array<vector<DiagonalSegment>, MAX_CONTEXT> diagonal_segments;
task_timer timer;
TaskTimer timer;
const SequenceSet& ref_seqs = targets.seqs(), &ref_seqs_unmasked = targets.unmasked_seqs();
const bool masking = config.comp_based_stats == ::Stats::CBS::COMP_BASED_STATS_AND_MATRIX_ADJUST ? ::Stats::use_seg_masking(query_seq[0], ref_seqs_unmasked[block_id]) : true;
WorkTarget target(block_id, masking ? ref_seqs[block_id] : ref_seqs_unmasked[block_id], ::Stats::count_true_aa(query_seq[0]), query_comp, query_matrix);
Expand Down
2 changes: 1 addition & 1 deletion src/basic/basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "../util/util.h"
#include "../stats/standard_matrix.h"

const char* Const::version_string = "2.1.5";
const char* Const::version_string = "2.1.6";
using std::string;
using std::vector;
using std::count;
Expand Down
60 changes: 7 additions & 53 deletions src/basic/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
****/

#include <memory>
#include <iostream>
#include <cstdlib>
#include <sys/stat.h>
#include <exception>
Expand Down Expand Up @@ -50,12 +51,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
using std::thread;
using std::stringstream;
using std::endl;
using std::cerr;
using std::ostream;
using std::cout;
using std::unique_ptr;
using std::string;
using std::pair;
using std::cout;
using std::cerr;

const EMap<Sensitivity> EnumTraits<Sensitivity>::to_string = {
{ Sensitivity::FASTER, "faster" },
Expand Down Expand Up @@ -115,61 +116,14 @@ pair<double, int> block_size(int64_t memory_limit, Sensitivity s, bool lin) {
return { std::max(b, 0.001), c };
}

void print_warnings() {
if (config.sensitivity >= Sensitivity::VERY_SENSITIVE || config.verbosity == 0 || config.swipe_all)
return;
if (config.command != Config::blastp && config.command != Config::blastx && config.command != Config::blastn)
return;
const double ram = total_ram();
unsigned b = 2, c = 4;
stringstream msg;
if (config.sensitivity >= Sensitivity::SENSITIVE) {
if (ram >= 63) {
c = 1;
if(c < config.lowmem_)
msg << "use this parameter for better performance: -c1";
}
}
else {
if (ram >= 511) {
b = 12;
c = 1;
}
else if (ram >= 255) {
b = 8;
c = 1;
}
else if (ram >= 127) {
b = 5;
c = 1;
}
else if (ram >= 63) {
b = 6;
}
else if (ram >= 31) {
b = 4;
}
if ((b > 2 && b > config.chunk_size) || c < config.lowmem_) {
msg << "increase the block size for better performance using these parameters : -b" << b;
if (c != 4)
msg << " -c" << c;
}
}
if (!msg.str().empty()) {
set_color(Color::YELLOW, true);
cerr << "The host system is detected to have " << (size_t)ram << " GB of RAM. It is recommended to " << msg.str() << endl;
reset_color(true);
}
}

template<typename _t>
_t set_string_option(const string& s, const string& name, const vector<pair<string, _t>>& values) {
template<typename T>
T set_string_option(const string& s, const string& name, const vector<pair<string, T>>& values) {
if (s.empty())
return (_t)0;
return (T)0;
for (auto& i : values)
if (s == i.first)
return i.second;
throw std::runtime_error("Invalid argument for option " + name + ". Allowed values are:" + std::accumulate(values.begin(), values.end(), string(), [](const string& s, const pair<string, _t>& v) { return s + ' ' + v.first; }));
throw std::runtime_error("Invalid argument for option " + name + ". Allowed values are:" + std::accumulate(values.begin(), values.end(), string(), [](const string& s, const pair<string, T>& v) { return s + ' ' + v.first; }));
}

void Config::set_sens(Sensitivity sens) {
Expand Down
2 changes: 1 addition & 1 deletion src/basic/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct Const
{

enum {
build_version = 159,
build_version = 160,
#ifdef SINGLE_THREADED
seedp_bits = 0,
#else
Expand Down
1 change: 1 addition & 0 deletions src/chaining/greedy_align.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <map>
#include <list>
#include <set>
#include <iostream>
#include "../basic/sequence.h"
#include "../basic/match.h"
#include "../stats/score_matrix.h"
Expand Down
4 changes: 2 additions & 2 deletions src/cluster/cascaded/cascaded.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ vector<SuperBlockId> cluster(shared_ptr<SequenceFile>& db, const shared_ptr<BitV
Search::run(db, nullptr, callback, filter);

message_stream << "Finished search. #Edges: " << callback->count << endl;
task_timer timer("Allocating buffers");
TaskTimer timer("Allocating buffers");
vector<Edge> edges(callback->count);
timer.go("Loading edges");
InputFile f(callback->edge_file);
Expand Down Expand Up @@ -113,7 +113,7 @@ vector<SuperBlockId> cascaded(shared_ptr<SequenceFile>& db, bool linear) {
iota(centroids.begin(), centroids.end(), 0);

for (int i = 0; i < (int)steps.size(); i++) {
task_timer timer;
TaskTimer timer;
config.lin_stage1 = ends_with(steps[i], "_lin");
config.sensitivity = from_string<Sensitivity>(rstrip(steps[i], "_lin"));
tie(centroids, *oid_filter) = update_clustering(*oid_filter,
Expand Down
4 changes: 2 additions & 2 deletions src/cluster/cascaded/recluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ using std::pair;
namespace Cluster {

static vector<OId> recluster(shared_ptr<SequenceFile>& db, const vector<OId>& clustering, int iteration) {
task_timer timer(("*** Initializing recluster iteration " + to_string(iteration + 1)).c_str());
TaskTimer timer(("*** Initializing recluster iteration " + to_string(iteration + 1)).c_str());

FlatArray<OId> clusters;
vector<OId> centroids;
Expand Down Expand Up @@ -178,7 +178,7 @@ void recluster() {
//config.strict_gvc = true;
message_stream << "Coverage cutoff: " << config.member_cover << '%' << endl;

task_timer timer("Opening the database");
TaskTimer timer("Opening the database");
shared_ptr<SequenceFile> db(SequenceFile::auto_create({ config.database }, SequenceFile::Flags::NEED_LETTER_COUNT | SequenceFile::Flags::ACC_TO_OID_MAPPING | SequenceFile::Flags::OID_TO_ACC_MAPPING, SequenceFile::Metadata()));
config.db_size = db->letters();
timer.finish();
Expand Down
7 changes: 3 additions & 4 deletions src/cluster/cascaded/wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ using std::string;
using std::vector;
using std::ostream;
using std::ofstream;
using std::cout;
using std::numeric_limits;
using std::tuple;
using std::get;
Expand Down Expand Up @@ -67,7 +66,7 @@ struct Config {
double block_size;
std::unique_ptr<OutputFormat> output_format;
std::shared_ptr<FastaFile> centroids;
task_timer total_time;
TaskTimer total_time;
int64_t seqs_processed;
int64_t letters_processed;
std::vector<OId> centroid2oid;
Expand Down Expand Up @@ -158,8 +157,8 @@ void Cascaded::run() {
config.database.require();
init_thresholds();
config.hamming_ext = config.approx_min_id >= 50.0;
task_timer total_time;
task_timer timer("Opening the input file");
TaskTimer total_time;
TaskTimer timer("Opening the input file");
shared_ptr<SequenceFile> db(SequenceFile::auto_create({ config.database }, SequenceFile::Flags::NEED_LETTER_COUNT | SequenceFile::Flags::OID_TO_ACC_MAPPING));
if (db->type() == SequenceFile::Type::BLAST)
throw std::runtime_error("Clustering is not supported for BLAST databases.");
Expand Down
1 change: 0 additions & 1 deletion src/cluster/helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ using std::pair;
using std::endl;
using std::vector;
using std::ofstream;
using std::cout;
using std::ostream;
using std::runtime_error;
using std::string;
Expand Down
2 changes: 1 addition & 1 deletion src/cluster/incremental/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct Config {
std::unique_ptr<SequenceFile> db;
std::shared_ptr<FastaFile> centroids;
std::unique_ptr<Util::Tsv::File> output_file;
task_timer total_time;
TaskTimer total_time;
int64_t seqs_processed;
int64_t letters_processed;
std::vector<CentroidId> oid2centroid;
Expand Down
6 changes: 3 additions & 3 deletions src/cluster/incremental/run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct BestCentroid : public Consumer, public vector<OId> {

static void self_align(Block& block, Config& cfg) {
using Edge = Util::Algo::Edge<SuperBlockId>;
task_timer timer(("CLUSTER Searching " + std::to_string(block.seqs().size()) + " unaligned sequences").c_str(), cfg.message_stream);
TaskTimer timer(("CLUSTER Searching " + std::to_string(block.seqs().size()) + " unaligned sequences").c_str(), cfg.message_stream);
shared_ptr<Callback> neighbors(new Callback());
shared_ptr<BlockWrapper> unaligned_wrapper(new BlockWrapper(block));
config.self = true;
Expand Down Expand Up @@ -101,7 +101,7 @@ static void search_vs_centroids(Block& block, const int round, Config& cfg) {
cfg.message_stream << "CLUSTER searching vs. centroids sensitivity = " << to_string(cfg.sens[round])
<< " #sequences = " << block.seqs().size() << " , #centroids = " << cfg.centroids->sequence_count() << endl;
cfg.status_msg();
task_timer timer(("Searching " + std::to_string(block.seqs().size()) + " against centroid sequences (" + to_string(cfg.sens[round]) + ")").c_str(), cfg.message_stream);
TaskTimer timer(("Searching " + std::to_string(block.seqs().size()) + " against centroid sequences (" + to_string(cfg.sens[round]) + ")").c_str(), cfg.message_stream);
shared_ptr<BlockWrapper> block_wrapper(new BlockWrapper(block));
shared_ptr<BestCentroid> best_centroid(new BestCentroid(block.seqs().size()));
config.self = false;
Expand Down Expand Up @@ -147,7 +147,7 @@ void Algo::run() {
if (!config.resume.empty())
cfg.load_state();

task_timer timer("CLUSTER Opening the input file", cfg.message_stream);
TaskTimer timer("CLUSTER Opening the input file", cfg.message_stream);
const int64_t block_size = (int64_t)(cfg.block_size * 1e9), cache_limit = 0; // block_size;
config.output_format = { "edge" };
unique_ptr<Block> block;
Expand Down
Loading

0 comments on commit 0540f86

Please sign in to comment.