Skip to content

Commit

Permalink
Make unpackdb work correctly if no .lookup file is present
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Apr 24, 2023
1 parent 570e3ed commit 92d8cc3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/util/unpackdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ int unpackdb(int argc, const char **argv, const Command& command) {
Parameters& par = Parameters::getInstance();
par.parseParameters(argc, argv, command, true, 0, 0);

std::string lookupFile = par.db1 + ".lookup";
if (par.unpackNameMode == Parameters::UNPACK_NAME_ACCESSION && FileUtil::fileExists(lookupFile.c_str()) == false) {
Debug(Debug::INFO) << "No lookup file for " << FileUtil::baseName(par.db1) << " found, using key-based file naming\n";
par.unpackNameMode = Parameters::UNPACK_NAME_KEY;
}

int mode = DBReader<unsigned int>::USE_INDEX|DBReader<unsigned int>::USE_DATA;
if (par.unpackNameMode == Parameters::UNPACK_NAME_ACCESSION) {
mode |= DBReader<unsigned int>::USE_LOOKUP;
Expand Down

0 comments on commit 92d8cc3

Please sign in to comment.