Raptor 3.0.0-rc.1
A fast and space-efficient pre-filter for querying very large collections of nucleotide sequences
 
build_arguments.hpp
Go to the documentation of this file.
1// --------------------------------------------------------------------------------------------------
2// Copyright (c) 2006-2023, Knut Reinert & Freie Universität Berlin
3// Copyright (c) 2016-2023, Knut Reinert & MPI für molekulare Genetik
4// This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5// shipped with this file and also available at: https://github.com/seqan/raptor/blob/main/LICENSE.md
6// --------------------------------------------------------------------------------------------------
7
13#pragma once
14
15#include <filesystem>
16#include <vector>
17
18#include <seqan3/search/kmer_index/shape.hpp>
19
23
24namespace raptor
25{
26
28{
29 // Related to k-mers
30 uint8_t kmer_size{20u};
31 uint32_t window_size{kmer_size};
32 std::string shape_string{};
33 seqan3::shape shape{seqan3::ungapped{kmer_size}};
34
35 // Related to IBF
36 std::filesystem::path out_path{"./"};
37 uint64_t bins{64};
38 mutable uint64_t bits{4096}; // Allow to change bits for each partition
39 uint64_t hash{2};
40 uint8_t parts{1u};
41 double fpr{0.05};
42 bool compressed{false};
43
44 // General arguments
46 std::filesystem::path bin_file{};
47 uint8_t threads{1u};
48 bool is_hibf{false};
49 bool input_is_minimiser{false};
50 bool verbose{false};
51
52 // Timers do not copy the stored duration upon copy construction/assignment
53 mutable timer<concurrent::yes> wall_clock_timer{};
54 mutable timer<concurrent::yes> bin_size_timer{};
55 mutable timer<concurrent::yes> index_allocation_timer{};
56 mutable timer<concurrent::yes> user_bin_io_timer{};
57 mutable timer<concurrent::yes> merge_kmers_timer{};
58 mutable timer<concurrent::yes> fill_ibf_timer{};
59 mutable timer<concurrent::yes> store_index_timer{};
60
61 void print_timings() const
62 {
63 if (!verbose)
64 return;
65 std::cerr << std::fixed << std::setprecision(2) << "============= Timings =============\n";
66 std::cerr << "Wall clock time [s]: " << wall_clock_timer.in_seconds() << '\n';
67 std::cerr << "Peak memory usage " << formatted_peak_ram() << '\n';
68 if (!is_hibf)
69 std::cerr << "Determine IBF size [s]: " << bin_size_timer.in_seconds() << '\n';
70 std::cerr << "Index allocation [s]: " << index_allocation_timer.in_seconds() << '\n';
71 std::cerr << "User bin I/O avg per thread [s]: " << user_bin_io_timer.in_seconds() / threads << '\n';
72 std::cerr << "User bin I/O sum [s]: " << user_bin_io_timer.in_seconds() << '\n';
73 if (is_hibf)
74 {
75 std::cerr << "Merge kmer sets avg per thread [s]: " << merge_kmers_timer.in_seconds() / threads << '\n';
76 std::cerr << "Merge kmer sets sum [s]: " << merge_kmers_timer.in_seconds() << '\n';
77 }
78 std::cerr << "Fill IBF avg per thread [s]: " << fill_ibf_timer.in_seconds() / threads << '\n';
79 std::cerr << "Fill IBF sum [s]: " << fill_ibf_timer.in_seconds() << '\n';
80 std::cerr << "Store index [s]: " << store_index_timer.in_seconds() << '\n';
81 }
82};
83
84} // namespace raptor
Definition: timer.hpp:30
T fixed(T... args)
Provides raptor::formatted_peak_ram.
T setprecision(T... args)
Provides raptor::window.
Definition: build_arguments.hpp:28
Provides raptor::timer.