Skip to content

Commit 40316bf

Browse files
authored
Merge pull request #210 from h-2/size_sum
[misc] db size
2 parents 2453f18 + 93e9847 commit 40316bf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/search_algo.hpp

+15
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
#include <bio/alphabet/aminoacid/aa27.hpp>
3939
#include <bio/io/seq/reader.hpp>
40+
#include <bio/ranges/container/concatenated_sequences.hpp>
4041
#include <bio/ranges/views/complement.hpp>
4142
#include <bio/ranges/views/translate_join.hpp>
4243
#if __cpp_lib_ranges <= 202106L
@@ -273,12 +274,26 @@ void loadDbIndexFromDisk(
273274
globalHolder.transSbjSeqs = globalHolder.indexFile.seqs | sbjTransView<c_origSbjAlph, c_transAlph, c_redAlph>;
274275
globalHolder.redSbjSeqs = globalHolder.transSbjSeqs | redView<c_transAlph, c_redAlph>;
275276

277+
size_t searchSpaceSize = 0ull;
278+
279+
if (options.verbosity == 2)
280+
{
281+
searchSpaceSize = bio::meta::overloaded{[]<typename T>(bio::ranges::concatenated_sequences<T> const & seqs)
282+
{ return seqs.concat_size(); },
283+
[](auto const & seqs)
284+
{
285+
auto v = seqs | std::views::transform(std::ranges::size);
286+
return std::reduce(v.begin(), v.end(), 0ull);
287+
}}(globalHolder.transSbjSeqs);
288+
}
289+
276290
double finish = sysTime() - start;
277291
myPrint(options, 1, " done.\n");
278292

279293
myPrint(options, 2, " # original subjects: ", globalHolder.indexFile.seqs.size(), "\n");
280294
myPrint(options, 2, " # translated subjects: ", globalHolder.transSbjSeqs.size(), "\n");
281295
myPrint(options, 2, " # reduced subjects: ", globalHolder.redSbjSeqs.size(), "\n");
296+
myPrint(options, 2, " size of search space: ", searchSpaceSize, "\n");
282297
bool const indexHasSTaxIDs = globalHolder.indexFile.sTaxIds.size() == globalHolder.indexFile.seqs.size();
283298
myPrint(options, 2, " has taxonomic IDs: ", indexHasSTaxIDs, "\n");
284299
bool const indexHasTaxTree = globalHolder.indexFile.taxonNames.size() >= globalHolder.indexFile.seqs.size();

0 commit comments

Comments
 (0)