Skip to content

Commit

Permalink
Move valid_dna array to commonFunc.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
bkille committed Aug 19, 2023
1 parent fd4794e commit 565756b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 55 deletions.
52 changes: 0 additions & 52 deletions src/common/rkmh.hpp

This file was deleted.

22 changes: 19 additions & 3 deletions src/map/include/commonFunc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

//Own includes
#include "map/include/map_parameters.hpp"
#include "common/rkmh.hpp"

//External includes
#include "common/murmur3.h"
Expand Down Expand Up @@ -72,8 +71,25 @@ namespace skch {
dest[length - i - 1] = base;
}
}
// Crazy hack char table to test for canonical bases
constexpr int valid_dna[127] = {
1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 0, 1, 0, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 0, 1, 0, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1
};

/**
/**
* @brief convert DNA or AA alphabets to upper case, converting non-canonical DNA bases to N
* @param[in] seq pointer to input sequence
* @param[in] len length of input sequence
Expand All @@ -84,7 +100,7 @@ namespace skch {
seq[i] -= 32;
}

if (rkmh::valid_dna[seq[i]]) {
if (valid_dna[seq[i]]) {
seq[i] = 'N';
}
}
Expand Down

0 comments on commit 565756b

Please sign in to comment.