2727#include < fmindex-collection/fmindex-collection.h>
2828#include < fmindex-collection/occtable/all.h>
2929
30- #include < seqan3/alphabet/views/to_rank.hpp>
31- #include < seqan3/alphabet/views/translate.hpp>
32- #include < seqan3/alphabet/views/translate_join.hpp>
30+ #include < bio/io/seq/reader.hpp>
31+ #include < bio/ranges/to.hpp>
32+ #include < bio/ranges/views/convert.hpp>
33+ #include < bio/ranges/views/to_rank.hpp>
34+ #include < bio/ranges/views/translate.hpp>
35+ #include < bio/ranges/views/translate_join.hpp>
3336#include < seqan3/io/detail/misc_input.hpp>
34- #include < seqan3/io/sequence_file/input.hpp>
35- #include < seqan3/utility/views/convert.hpp>
3637
3738#include " mkindex_misc.hpp"
3839// #include "mkindex_saca.hpp"
@@ -119,24 +120,23 @@ auto loadSubjSeqsAndIds(LambdaIndexerOptions const & options)
119120 double start = sysTime ();
120121 myPrint (options, 1 , " Loading Subject Sequences and Ids..." );
121122
122- using seq_traits = std::conditional_t <seqan3::nucleotide_alphabet<TOrigAlph>,
123- seqan3::sequence_file_input_default_traits_dna,
124- seqan3::sequence_file_input_default_traits_aa>;
125- seqan3::sequence_file_input<seq_traits, seqan3::fields<seqan3::field::id, seqan3::field::seq>> infile{
126- options.dbFile };
123+ bio::io::seq::record r{.id = std::string_view{},
124+ .seq = bio::ranges::views::char_conversion_view_t <TOrigAlph>{},
125+ .qual = std::ignore};
126+ bio::io::seq::reader reader{
127+ options.dbFile ,
128+ bio::io::seq::reader_options{.record = r, .truncate_ids = options.truncateIDs }
129+ };
127130
128131 size_t count = 0 ;
129- for (auto & [id, seq] : infile )
132+ for (auto & [id, seq, qual ] : reader )
130133 {
131134 if (options.hasSTaxIds )
132135 extractAccIds (id, count);
133136
134- if (options.truncateIDs )
135- ids.push_back (id | seqan3::detail::take_until (seqan3::is_space) | seqan3::ranges::to<std::string>());
136- else
137- ids.push_back (std::move (id));
137+ ids.push_back (id);
138138
139- originalSeqs.push_back (std::move ( seq) );
139+ originalSeqs.push_back (seq);
140140 ++count;
141141 }
142142
@@ -301,7 +301,7 @@ auto mapTaxIDs(std::unordered_map<std::string, uint64_t> const & accToIdRank,
301301 // transparent decompressor
302302 auto vstream = seqan3::detail::make_secondary_istream (fin);
303303
304- // TODO: use seqan3 ::views::istreambuf instead, it's faster
304+ // TODO: use bio ::views::istreambuf instead, it's faster
305305 auto file_view = std::ranges::subrange<std::istreambuf_iterator<char >, std::istreambuf_iterator<char >>{
306306 std::istreambuf_iterator<char >{*vstream},
307307 std::istreambuf_iterator<char >{}};
@@ -397,7 +397,7 @@ auto parseAndStoreTaxTree(std::vector<bool> & taxIdIsPresent, LambdaIndexerOptio
397397 // transparent decompressor
398398 auto vstream = seqan3::detail::make_secondary_istream (fin);
399399
400- // TODO: use seqan3 ::views::istreambuf instead, it's faster
400+ // TODO: use bio ::views::istreambuf instead, it's faster
401401 auto file_view = std::ranges::subrange<std::istreambuf_iterator<char >, std::istreambuf_iterator<char >>{
402402 std::istreambuf_iterator<char >{*vstream},
403403 std::istreambuf_iterator<char >{}};
@@ -412,7 +412,7 @@ auto parseAndStoreTaxTree(std::vector<bool> & taxIdIsPresent, LambdaIndexerOptio
412412 while (std::ranges::begin (file_view) != std::ranges::end (file_view))
413413 {
414414 // read line
415- buf = file_view | std::views::take_while (not_eol) | seqan3 ::ranges::to<std::string>();
415+ buf = file_view | std::views::take_while (not_eol) | bio ::ranges::to<std::string>();
416416
417417 uint32_t n = 0 ;
418418 uint32_t parent = 0 ;
@@ -603,7 +603,7 @@ auto parseAndStoreTaxTree(std::vector<bool> & taxIdIsPresent, LambdaIndexerOptio
603603 while (std::ranges::begin (file_view2) != std::ranges::end (file_view2))
604604 {
605605 // read line
606- buf = file_view2 | std::views::take_while (not_eol) | seqan3 ::ranges::to<std::string>();
606+ buf = file_view2 | std::views::take_while (not_eol) | bio ::ranges::to<std::string>();
607607
608608 uint32_t taxId = 0 ;
609609
@@ -668,15 +668,15 @@ auto parseAndStoreTaxTree(std::vector<bool> & taxIdIsPresent, LambdaIndexerOptio
668668template <bool is_bi, typename TStringSet>
669669auto generateIndex (TStringSet & seqs, LambdaIndexerOptions const & options)
670670{
671- using TRedAlph = seqan3 ::range_innermost_value_t <TStringSet>;
672- using TIndexSpec = IndexSpec<seqan3::alphabet_size <TRedAlph>>;
671+ using TRedAlph = bio::ranges ::range_innermost_value_t <TStringSet>;
672+ using TIndexSpec = IndexSpec<bio::alphabet::size <TRedAlph>>;
673673 using TIndex = std::
674674 conditional_t <is_bi, fmindex_collection::BiFMIndex<TIndexSpec>, fmindex_collection::ReverseFMIndex<TIndexSpec>>;
675675
676676 myPrint (options, 1 , " Generating Index..." );
677677 double s = sysTime ();
678678
679- TIndex index{seqs | seqan3 ::views::to_rank | fmindex_collection::add_sentinels, 5 };
679+ TIndex index{seqs | bio ::views::to_rank | fmindex_collection::add_sentinels, 5 };
680680
681681 double e = sysTime () - s;
682682 myPrint (options, 1 , " done.\n " );
0 commit comments