Skip to content

Commit

Permalink
Fix prefilter not correctly masking extended dbtype for comparision
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Sep 21, 2021
1 parent e3ce460 commit be11943
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/commons/Parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -1118,12 +1118,14 @@ class Parameters {
static std::vector<std::string> findMissingTaxDbFiles(const std::string &filename);
static void printTaxDbError(const std::string &filename, const std::vector<std::string>& missingFiles);

static const uint32_t DBTYPE_MASK = 0x0000FFFF;

static bool isEqualDbtype(const int type1, const int type2) {
return ((type1 & 0x0000FFFF) == (type2 & 0x0000FFFF));
return ((type1 & DBTYPE_MASK) == (type2 & DBTYPE_MASK));
}

static const char* getDbTypeName(int dbtype) {
switch (dbtype & 0x0000FFFF) {
switch (dbtype & DBTYPE_MASK) {
case DBTYPE_AMINO_ACIDS: return "Aminoacid";
case DBTYPE_NUCLEOTIDES: return "Nucleotide";
case DBTYPE_HMM_PROFILE: return "Profile";
Expand Down
2 changes: 1 addition & 1 deletion src/prefiltering/Prefiltering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Prefiltering::Prefiltering(const std::string &queryDB,
sameQTDB = isSameQTDB();

// init the substitution matrices
switch (querySeqType & 0x7FFFFFFF) {
switch (querySeqType & Parameters::DBTYPE_MASK) {
case Parameters::DBTYPE_NUCLEOTIDES:
kmerSubMat = getSubstitutionMatrix(scoringMatrixFile, par.alphabetSize, 1.0, false, true);
ungappedSubMat = kmerSubMat;
Expand Down

0 comments on commit be11943

Please sign in to comment.