42 explicit file_reader(seqan3::shape
const shape, uint32_t
const window_size) :
43 minimiser_view{seqan3::views::minimiser_hash(shape,
44 seqan3::window_size{window_size},
45 seqan3::seed{adjust_seed(shape.count())})}
48 template <std::output_iterator<u
int64_t> it_t>
51 for (
auto && filename : filenames)
52 hash_into(filename, target);
55 template <std::output_iterator<u
int64_t> it_t>
56 void hash_into(
std::string const & filename, it_t target)
const
58 sequence_file_t fin{filename};
59 for (
auto && record : fin)
63 template <std::output_iterator<u
int64_t> it_t>
66 for (
auto && filename : filenames)
67 hash_into_if(filename, target, pred);
70 template <std::output_iterator<u
int64_t> it_t>
71 void hash_into_if(
std::string const & filename, it_t target,
auto && pred)
const
73 sequence_file_t fin{filename};
74 for (
auto && record : fin)
80 for (
auto && filename : filenames)
81 for_each_hash(filename, callback);
84 void for_each_hash(
std::string const & filename,
auto && callback)
const
86 sequence_file_t fin{filename};
87 for (
auto && record : fin)
92 using sequence_file_t = seqan3::sequence_file_input<dna4_traits, seqan3::fields<seqan3::field::seq>>;
93 using view_t =
decltype(seqan3::views::minimiser_hash(seqan3::shape{}, seqan3::window_size{}, seqan3::seed{}));
94 view_t minimiser_view = seqan3::views::minimiser_hash(seqan3::shape{}, seqan3::window_size{}, seqan3::seed{});
100 [[noreturn]]
void io_error(
std::string const & filepath,
int const err = errno)
const
103 oss <<
"Failed to open file: " <<
std::quoted(filepath);
115 explicit file_reader(seqan3::shape
const, uint32_t
const)
118 template <std::output_iterator<u
int64_t> it_t>
121 for (
auto && filename : filenames)
122 hash_into(filename, target);
125 template <std::output_iterator<u
int64_t> it_t>
126 void hash_into(
std::string const & filename, it_t target)
const
129 if (!fin.is_open()) [[unlikely]]
133 while (fin.read(
reinterpret_cast<char *
>(&value),
sizeof(value)))
140 template <std::output_iterator<u
int64_t> it_t>
143 for (
auto && filename : filenames)
144 hash_into_if(filename, target, pred);
147 template <std::output_iterator<u
int64_t> it_t>
148 void hash_into_if(
std::string const & filename, it_t target,
auto && pred)
const
151 if (!fin.is_open()) [[unlikely]]
155 while (fin.read(
reinterpret_cast<char *
>(&value),
sizeof(value)))
165 for (
auto && filename : filenames)
166 for_each_hash(filename, callback);
169 void for_each_hash(
std::string const & filename,
auto && callback)
const
172 if (!fin.is_open()) [[unlikely]]
176 while (fin.read(
reinterpret_cast<char *
>(&value),
sizeof(value)))