) * 8)))
+ {
+ #ifndef LAMBDA_LONG_PROTEIN_SUBJ_SEQS
+ std::cerr << "ERROR: Your lambda executable was built with LAMBDA_LONG_PROTEIN_SUBJ_SEQS,\n"
+ " but the index was created by an executable that was built without it.\n";
+ #else
+ std::cerr << "ERROR: Your lambda executable was built without LAMBDA_LONG_PROTEIN_SUBJ_SEQS,\n"
+ " but the index was created by an executable that was built with it.\n";
+ #endif
+ std::cerr << " You need to recreate the index or rebuild Lambda.\n";
+ return -1;
+ }
+
return 0;
}
diff --git a/src/lambda_indexer.cpp b/src/lambda_indexer.cpp
index ee5a752ba..6c8ac21f9 100644
--- a/src/lambda_indexer.cpp
+++ b/src/lambda_indexer.cpp
@@ -197,7 +197,7 @@ realMain(LambdaIndexerOptions const & options,
dumpTranslatedSeqs(translatedSeqs, options);
// see if final sequence set actually fits into index
- if (!checkIndexSize(translatedSeqs))
+ if (!checkIndexSize(translatedSeqs, BlastProgramSelector()))
return -1;
if (options.dbIndexType == DbIndexType::FM_INDEX)
@@ -246,7 +246,8 @@ realMain(LambdaIndexerOptions const & options,
{ options.indexDir + "/option:alph_original", std::string(_alphName(OrigSubjAlph
())) },
{ options.indexDir + "/option:alph_translated", std::string(_alphName(TransAlph
())) },
{ options.indexDir + "/option:alph_reduced", std::string(_alphName(TRedAlph())) },
- { options.indexDir + "/option:genetic_code", std::to_string(options.geneticCode) }
+ { options.indexDir + "/option:genetic_code", std::to_string(options.geneticCode) },
+ { options.indexDir + "/option:subj_seq_len_bits", std::to_string(sizeof(SizeTypePos_) * 8)},
})
{
std::ofstream f{std::get<0>(s).c_str(), std::ios_base::out | std::ios_base::binary};
diff --git a/src/lambda_indexer.hpp b/src/lambda_indexer.hpp
index 9eff8c779..79bd75827 100644
--- a/src/lambda_indexer.hpp
+++ b/src/lambda_indexer.hpp
@@ -276,9 +276,9 @@ dumpTranslatedSeqs(TCDStringSet> const & translatedSeqs,
// Function loadSubj()
// --------------------------------------------------------------------------
-template
+template
inline bool
-checkIndexSize(TCDStringSet> const & seqs)
+checkIndexSize(TCDStringSet> const & seqs, BlastProgramSelector const &)
{
using SAV = typename SAValue>>::Type;
uint64_t curNumSeq = length(seqs);
@@ -303,6 +303,12 @@ checkIndexSize(TCDStringSet> const & seqs)
std::cerr << "Too long sequences to be indexed:\n "
<< "length" << maxLen << " present in file, but only "
<< maxLenSeq << " supported by index.\n";
+ #ifndef LAMBDA_LONG_PROTEIN_SUBJ_SEQS
+ if (p != BlastProgram::BLASTN)
+ std::cout << "You can recompile Lambda and add -DLAMBDA_LONG_PROTEIN_SUBJ_SEQS=1 to activate\n"
+ "support for longer protein sequences.\n";
+ #endif
+
return false;
}
return true;
diff --git a/src/options.hpp b/src/options.hpp
index e92adb017..17d52e845 100644
--- a/src/options.hpp
+++ b/src/options.hpp
@@ -54,7 +54,11 @@ using SizeTypeNum_ = uint32_t;
template
struct SizeTypePosMeta_
{
+#ifdef LAMBDA_LONG_PROTEIN_SUBJ_SEQS
+ using Type = uint32_t;
+#else
using Type = uint16_t;
+#endif
};
template <>