Skip to content

Commit ba2c33f

Browse files
committed
Fix new index-subset 8/10
1 parent 05ae20c commit ba2c33f

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

src/commons/Parameters.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ Parameters::Parameters():
198198
// indexdb
199199
PARAM_CHECK_COMPATIBLE(PARAM_CHECK_COMPATIBLE_ID, "--check-compatible", "Check compatible", "0: Always recreate index, 1: Check if recreating index is needed, 2: Fail if index is incompatible", typeid(int), (void *) &checkCompatible, "^[0-2]{1}$", MMseqsParameter::COMMAND_MISC),
200200
PARAM_SEARCH_TYPE(PARAM_SEARCH_TYPE_ID, "--search-type", "Search type", "Search type 0: auto 1: amino acid, 2: translated, 3: nucleotide, 4: translated nucleotide alignment", typeid(int), (void *) &searchType, "^[0-4]{1}"),
201-
PARAM_INDEX_SUBSET(PARAM_INDEX_SUBSET_ID, "--index-subset", "Index subset", "Create specialized index with subset of entries\n0: normal index\n1: index without headers\n2: index without prefiltering data\n4: index without aln (for cluster db)\n8: no sequence lookup (good for GPU only searches)\nFlags can be combined bit wise", typeid(int), (void *) &indexSubset, "^[0-7]{1}", MMseqsParameter::COMMAND_EXPERT),
201+
PARAM_INDEX_SUBSET(PARAM_INDEX_SUBSET_ID, "--index-subset", "Index subset", "Create specialized index with subset of entries\n0: normal index\n1: index without headers\n2: index without prefiltering data\n4: index without aln (for cluster db)\n8: no sequence lookup (good for GPU only searches)\nFlags can be combined bit wise", typeid(int), (void *) &indexSubset, "^[0-9]{1}[0-9]*$", MMseqsParameter::COMMAND_EXPERT),
202202
PARAM_INDEX_DBSUFFIX(PARAM_INDEX_DBSUFFIX_ID, "--index-dbsuffix", "Index dbsuffix", "A suffix of the db (used for cluster dbs)", typeid(std::string), (void *) &indexDbsuffix, "", MMseqsParameter::COMMAND_HIDDEN),
203203
// createdb
204204
PARAM_USE_HEADER(PARAM_USE_HEADER_ID, "--use-fasta-header", "Use fasta header", "Use the id parsed from the fasta header as the index key instead of using incrementing numeric identifiers", typeid(bool), (void *) &useHeader, ""),

src/prefiltering/PrefilteringIndexReader.cpp

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,10 @@ void PrefilteringIndexReader::createIndexFile(const std::string &outDB,
236236
IndexBuilder::fillDatabase(indexTable, &sequenceLookup,
237237
*subMat, s3, s2, &seq, dbr1, dbFrom, dbFrom + dbSize, kmerThr,
238238
maskMode, maskLowerCase, maskProb, maskNrepeats, targetSearchMode);
239-
}
240-
if (sequenceLookup == NULL) {
241-
Debug(Debug::ERROR) << "Invalid mask mode. No sequence lookup created!\n";
242-
EXIT(EXIT_FAILURE);
239+
if (sequenceLookup == NULL) {
240+
Debug(Debug::ERROR) << "Invalid mask mode. No sequence lookup created!\n";
241+
EXIT(EXIT_FAILURE);
242+
}
243243
}
244244
unsigned int keyOffset = 1000 * s;
245245
if(needKmerIndex){
@@ -267,14 +267,15 @@ void PrefilteringIndexReader::createIndexFile(const std::string &outDB,
267267
writer.alignToPageSize(SPLIT_INDX + s);
268268

269269
}
270-
// SEQCOUNT
271-
Debug(Debug::INFO) << "Write SEQCOUNT (" << (keyOffset + SEQCOUNT) << ")\n";
272-
size_t tablesize = sequenceLookup->getSequenceCount();
273-
char *tablesizePtr = (char *) &tablesize;
274-
writer.writeData(tablesizePtr, 1 * sizeof(size_t), (keyOffset + SEQCOUNT), SPLIT_INDX + s);
275-
writer.alignToPageSize(SPLIT_INDX + s);
276-
277-
if(needSequenceLookup){
270+
271+
if (needSequenceLookup) {
272+
// SEQCOUNT
273+
Debug(Debug::INFO) << "Write SEQCOUNT (" << (keyOffset + SEQCOUNT) << ")\n";
274+
size_t tablesize = sequenceLookup->getSequenceCount();
275+
char *tablesizePtr = (char *) &tablesize;
276+
writer.writeData(tablesizePtr, 1 * sizeof(size_t), (keyOffset + SEQCOUNT), SPLIT_INDX + s);
277+
writer.alignToPageSize(SPLIT_INDX + s);
278+
278279
Debug(Debug::INFO) << "Write SEQINDEXDATASIZE (" << (keyOffset + SEQINDEXDATASIZE) << ")\n";
279280
int64_t seqindexDataSize = sequenceLookup->getDataSize();
280281
char *seqindexDataSizePtr = (char *) &seqindexDataSize;
@@ -288,8 +289,9 @@ void PrefilteringIndexReader::createIndexFile(const std::string &outDB,
288289
Debug(Debug::INFO) << "Write SEQINDEXDATA (" << (keyOffset + SEQINDEXDATA) << ")\n";
289290
writer.writeData(sequenceLookup->getData(), (sequenceLookup->getDataSize() + 1) * sizeof(char), (keyOffset + SEQINDEXDATA), SPLIT_INDX + s);
290291
writer.alignToPageSize(SPLIT_INDX + s);
292+
293+
delete sequenceLookup;
291294
}
292-
delete sequenceLookup;
293295
if(indexTable != NULL){
294296
delete indexTable;
295297
}

0 commit comments

Comments
 (0)