Skip to content

Commit 6e3c640

Browse files
committed
Fix error when trying to build no-prefilter precomputed index
1 parent 1736bf6 commit 6e3c640

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/util/indexdb.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,6 @@ int indexdb(int argc, const char **argv, const Command &command) {
9494

9595
int splitMode = Parameters::TARGET_DB_SPLIT;
9696
par.maxResListLen = std::min(dbr.getSize(), par.maxResListLen);
97-
const bool noKmerIndex = (par.indexSubset & Parameters::INDEX_SUBSET_NO_PREFILTER) != 0;
98-
if (noKmerIndex) {
99-
par.kmerSize = 0;
100-
par.split = 1;
101-
} else {
102-
Prefiltering::setupSplit(dbr, seedSubMat->alphabetSize - 1, dbr.getDbtype(), par.threads, false, memoryLimit, 1, par.maxResListLen, par.kmerSize, par.split, splitMode);
103-
}
10497

10598
bool kScoreSet = false;
10699
for (size_t i = 0; i < par.indexdb.size(); i++) {
@@ -121,8 +114,15 @@ int indexdb(int argc, const char **argv, const Command &command) {
121114
par.maskMode = 0;
122115
}
123116

124-
// query seq type is actually unknown here, but if we pass DBTYPE_HMM_PROFILE then its +20 k-score
125-
int kmerScore = Prefiltering::getKmerThreshold(par.sensitivity, isProfileSearch, contextPseudoCnts, par.kmerScore.values, par.kmerSize);
117+
const bool noKmerIndex = (par.indexSubset & Parameters::INDEX_SUBSET_NO_PREFILTER) != 0;
118+
int kmerScore = 0;
119+
if (noKmerIndex) {
120+
par.kmerSize = 0;
121+
par.split = 1;
122+
} else {
123+
Prefiltering::setupSplit(dbr, seedSubMat->alphabetSize - 1, dbr.getDbtype(), par.threads, false, memoryLimit, 1, par.maxResListLen, par.kmerSize, par.split, splitMode);
124+
kmerScore = Prefiltering::getKmerThreshold(par.sensitivity, isProfileSearch, contextPseudoCnts, par.kmerScore.values, par.kmerSize);
125+
}
126126

127127
const std::string& baseDB = ppDB ? par.db1 + par.indexDbsuffix : par.db2;
128128
std::string indexDB = PrefilteringIndexReader::indexName(baseDB);

0 commit comments

Comments
 (0)