fastq_to_fasta
A template for creation of SeqAn3 apps, with a FASTQ to FASTA example app.
upgrade_index.hpp
Go to the documentation of this file.
1 // --------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2022, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2022, 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 
8 #pragma once
9 
12 
13 namespace raptor
14 {
15 
16 template <bool compressed>
17 void upgrade_index(upgrade_arguments const & arguments)
18 {
19  constexpr seqan3::data_layout layout =
20  compressed ? seqan3::data_layout::compressed : seqan3::data_layout::uncompressed;
21  seqan3::interleaved_bloom_filter<layout> original_index{};
22 
23  if (arguments.parts == 1u)
24  {
25  std::ifstream is{arguments.in_file, std::ios::binary};
26  cereal::BinaryInputArchive iarchive{is};
27  iarchive(original_index);
28  store_index(arguments.out_file, std::move(original_index), arguments);
29  }
30  else
31  {
32  for (size_t part : std::views::iota(0u, arguments.parts))
33  {
34  std::filesystem::path in_file{arguments.in_file};
35  in_file += "_" + std::to_string(part);
36 
37  std::ifstream is{in_file, std::ios::binary};
38  cereal::BinaryInputArchive iarchive{is};
39  iarchive(original_index);
40 
41  std::filesystem::path out_file{arguments.out_file};
42  out_file += "_" + std::to_string(part);
43  store_index(out_file, std::move(original_index), arguments);
44  }
45  }
46 }
47 
48 } // namespace raptor
Definition: adjust_seed.hpp:13
void upgrade_index(upgrade_arguments const &arguments)
Definition: upgrade_index.hpp:17
Definition: upgrade_arguments.hpp:19
uint8_t parts
Definition: upgrade_arguments.hpp:23
std::filesystem::path in_file
Definition: upgrade_arguments.hpp:27
std::filesystem::path out_file
Definition: upgrade_arguments.hpp:28