1010#include < fpgalign/build/build.hpp>
1111#include < fpgalign/colored_strings.hpp>
1212#include < fpgalign/contrib/minimiser_hash.hpp>
13+ #include < fpgalign/utility/ibf.hpp>
1314
1415namespace build
1516{
1617
17- struct dna4_traits : seqan3::sequence_file_input_default_traits_dna
18- {
19- using sequence_alphabet = seqan3::dna4;
20- };
21-
2218void ibf (config const & config, meta & meta)
2319{
2420 meta.kmer_size = config.kmer_size ;
2521 meta.window_size = config.window_size ;
2622
2723 auto get_user_bin_data = [&](size_t const user_bin_id, seqan::hibf::insert_iterator it)
2824 {
29- using sequence_file_t = seqan3::sequence_file_input<dna4_traits, seqan3::fields<seqan3::field::seq>>;
30-
31- auto minimiser_view =
32- contrib::views::minimiser_hash ({.kmer_size = config.kmer_size , .window_size = config.window_size });
25+ auto minimiser_view = contrib::views::minimiser_hash ({.kmer_size = config.kmer_size , //
26+ .window_size = config.window_size });
3327
3428 for (auto && bin_path : meta.bin_paths [user_bin_id])
3529 {
36- sequence_file_t fin{bin_path};
30+ seqfile_t fin{bin_path};
3731 for (auto && record : fin)
3832 {
3933 if (size_t const record_size = record.sequence ().size (); record_size < config.window_size )
4034 {
4135#pragma omp critical
4236 {
4337 std::cerr << colored_strings::cerr::warning << " File " << std::quoted (bin_path)
44- << " contains a sequence of length " << record_size
45- << " . This is shorter than the window size (" << config.window_size
38+ << " contains a sequence of length " << record_size << " (ID= " << record. id ()
39+ << " ) . This is shorter than the window size (" << config.window_size
4640 << " ) and will result in no k-mers being generated for this sequence. A user bin "
4741 " without k-mers will result in an error.\n " ;
4842 }
@@ -60,11 +54,7 @@ void ibf(config const & config, meta & meta)
6054
6155 seqan::hibf::interleaved_bloom_filter ibf{ibf_config};
6256
63- {
64- std::ofstream os{config.output_path .string () + " .ibf" , std::ios::binary};
65- cereal::BinaryOutputArchive oarchive{os};
66- oarchive (ibf);
67- }
57+ utility::store (ibf, config);
6858}
6959
7060} // namespace build
0 commit comments