Raptor 3.0.0-rc.1
A fast and space-efficient pre-filter for querying very large collections of nucleotide sequences
 
prepare_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 uint8_t kmer_size{20u};
30 uint32_t window_size{kmer_size};
31 std::string shape_string{};
32 seqan3::shape shape{seqan3::ungapped{kmer_size}};
33 bool use_filesize_dependent_cutoff{false};
34 uint8_t kmer_count_cutoff{1u};
35
36 std::filesystem::path out_dir{"./"};
37
39 std::filesystem::path bin_file{};
40 uint8_t threads{1u};
41 bool verbose{false};
42
43 // Timers do not copy the stored duration upon copy construction/assignment
44 mutable timer<concurrent::yes> wall_clock_timer{};
45 mutable timer<concurrent::yes> compute_minimiser_timer{};
46 mutable timer<concurrent::yes> write_minimiser_timer{};
47 mutable timer<concurrent::yes> write_header_timer{};
48
49 void print_timings() const
50 {
51 if (!verbose)
52 return;
53 std::cerr << std::fixed << std::setprecision(2) << "============= Timings =============\n";
54 std::cerr << "Wall clock time [s]: " << wall_clock_timer.in_seconds() << '\n';
55 std::cerr << "Peak memory usage " << formatted_peak_ram() << '\n';
56 std::cerr << "Compute minimiser [s]: " << compute_minimiser_timer.in_seconds() / threads << '\n';
57 std::cerr << "Write minimiser files [s]: " << write_minimiser_timer.in_seconds() / threads << '\n';
58 std::cerr << "Write header files [s]: " << write_header_timer.in_seconds() / threads << '\n';
59 }
60};
61
62} // namespace raptor
Definition: timer.hpp:30
T fixed(T... args)
Provides raptor::formatted_peak_ram.
T setprecision(T... args)
Provides raptor::window.
Definition: prepare_arguments.hpp:28
Provides raptor::timer.