Skip to content

Commit

Permalink
Merge pull request #58 from jaebeom-kim/master
Browse files Browse the repository at this point in the history
Record the Metabuli commit used for database creation
  • Loading branch information
jaebeom-kim authored Mar 20, 2024
2 parents 77ea100 + 6eeb7e5 commit 4305aa5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/commons/IndexCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include "NcbiTaxonomy.cpp"
#include "common.h"

extern const char *version;

IndexCreator::IndexCreator(const LocalParameters & par) {
// Parameters
threadNum = par.threads;
Expand Down Expand Up @@ -1050,6 +1052,7 @@ void IndexCreator::writeDbParameters() {
}
fprintf(handle, "DB_name\t%s\n", dbName.c_str());
fprintf(handle, "Creation_date\t%s\n", dbDate.c_str());
fprintf(handle, "Metabuli commit used to create the DB\t%s\n", version);
fprintf(handle, "Reduced_alphabet\t%d\n", reducedAA);
fprintf(handle, "Spaced_kmer_mask\t%s\n", spaceMask.c_str());
fprintf(handle, "Accession_level\t%d\n", accessionLevel);
Expand Down
4 changes: 3 additions & 1 deletion src/commons/LocalParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <iomanip>
#include "DistanceCalculator.h"

extern const char *version;

LocalParameters::LocalParameters() :
Parameters(),
VIRUS_TAX_ID(VIRUS_TAX_ID_ID,
Expand Down Expand Up @@ -419,7 +421,7 @@ void LocalParameters::printParameters(const std::string &module, int argc, const
std::stringstream ss;
ss << std::boolalpha;

ss << std::setw(maxWidth) << std::left << "Metabuli Version:" << "\t" << "1.0.2" << "\n";
ss << std::setw(maxWidth) << std::left << "Metabuli Version (commit):" << "\t" << version << "\n";

for (size_t i = 0; i < par.size(); i++) {
if (par[i]->category & MMseqsParameter::COMMAND_HIDDEN) {
Expand Down
3 changes: 3 additions & 0 deletions src/workflow/add_to_library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ int addToLibrary(int argc, const char **argv, const Command &command){
if (par.taxonomyPath == "DBDIR/taxonomy/") par.taxonomyPath = dbDir + "/taxonomy/";
if (par.libraryPath == "DBDIR/library/") par.libraryPath = dbDir + "/library/";



// If the library directory does not exist, create it
if (!FileUtil::directoryExists(par.libraryPath.c_str())) {
FileUtil::makeDir(par.libraryPath.c_str());
}


// Load taxonomy
NcbiTaxonomy * taxonomy = loadTaxonomy(dbDir, par.taxonomyPath);

Expand Down

0 comments on commit 4305aa5

Please sign in to comment.