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 on_hash(filename, callback);
84 void on_hash(
std::string const & filename,
auto && callback)
const
86 sequence_file_t fin{filename};
87 for (
auto && record : fin)
88 callback(record.sequence() | minimiser_view);
93 for (
auto && filename : filenames)
94 for_each_hash(filename, callback);
97 void for_each_hash(
std::string const & filename,
auto && callback)
const
99 sequence_file_t fin{filename};
100 for (
auto && record : fin)
105 using sequence_file_t = seqan3::sequence_file_input<dna4_traits, seqan3::fields<seqan3::field::seq>>;
106 using view_t =
decltype(seqan3::views::minimiser_hash(seqan3::shape{}, seqan3::window_size{}, seqan3::seed{}));
107 view_t minimiser_view = seqan3::views::minimiser_hash(seqan3::shape{}, seqan3::window_size{}, seqan3::seed{});
121 explicit file_reader(seqan3::shape
const, uint32_t
const)
124 template <std::output_iterator<u
int64_t> it_t>
127 for (
auto && filename : filenames)
128 hash_into(filename, target);
131 template <std::output_iterator<u
int64_t> it_t>
132 void hash_into(
std::string const & filename, it_t target)
const
136 while (fin.read(
reinterpret_cast<char *
>(&value),
sizeof(value)))
143 template <std::output_iterator<u
int64_t> it_t>
146 for (
auto && filename : filenames)
147 hash_into_if(filename, target, pred);
150 template <std::output_iterator<u
int64_t> it_t>
151 void hash_into_if(
std::string const & filename, it_t target,
auto && pred)
const
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
173 while (fin.read(
reinterpret_cast<char *
>(&value),
sizeof(value)))