|
|
@@ -53,7 +53,6 @@ using namespace seqan; |
|
|
|
|
|
// From ccnt_lut.cpp, automatically generated by gen_lookup_tables.pl
|
|
|
extern uint8_t cCntLUT_4[4][4][256];
|
|
|
-extern const std::string gEbwt_ext;
|
|
|
|
|
|
static const uint64_t c_table[4] = {
|
|
|
0xffffffffffffffffllu,
|
|
|
@@ -1132,16 +1131,16 @@ class Ebwt { |
|
|
|
|
|
// Searching and reporting
|
|
|
void joinedToTextOff(TIndexOffU qlen, TIndexOffU off, TIndexOffU& tidx, TIndexOffU& textoff, TIndexOffU& tlen) const;
|
|
|
- inline bool report(const String<Dna5>& query, String<char>* quals, String<char>* name, bool color, char primer, char trimc, bool colExEnds, int snpPhred, const BitPairReference* ref, const std::vector<uint32_t>& mmui32, const std::vector<uint8_t>& refcs, size_t numMms, uint32_t off, uint32_t top, uint32_t bot, uint32_t qlen, int stratum, uint16_t cost, uint32_t patid, uint32_t seed, const EbwtSearchParams<TStr>& params) const;
|
|
|
- inline bool reportChaseOne(const String<Dna5>& query, String<char>* quals, String<char>* name, bool color, char primer, char trimc, bool colExEnds, int snpPhred, const BitPairReference* ref, const std::vector<uint32_t>& mmui32, const std::vector<uint8_t>& refcs, size_t numMms, uint32_t i, uint32_t top, uint32_t bot, uint32_t qlen, int stratum, uint16_t cost, uint32_t patid, uint32_t seed, const EbwtSearchParams<TStr>& params, SideLocus *l = NULL) const;
|
|
|
+ inline bool report(const String<Dna5>& query, String<char>* quals, String<char>* name, bool color, char primer, char trimc, bool colExEnds, int snpPhred, const BitPairReference* ref, const std::vector<uint32_t>& mmui32, const std::vector<uint8_t>& refcs, size_t numMms, TIndexOffU off, uint32_t top, uint32_t bot, uint32_t qlen, int stratum, uint16_t cost, uint32_t patid, uint32_t seed, const EbwtSearchParams<TStr>& params) const;
|
|
|
+ inline bool reportChaseOne(const String<Dna5>& query, String<char>* quals, String<char>* name, bool color, char primer, char trimc, bool colExEnds, int snpPhred, const BitPairReference* ref, const std::vector<uint32_t>& mmui32, const std::vector<uint8_t>& refcs, size_t numMms, TIndexOffU i, uint32_t top, uint32_t bot, uint32_t qlen, int stratum, uint16_t cost, uint32_t patid, uint32_t seed, const EbwtSearchParams<TStr>& params, SideLocus *l = NULL) const;
|
|
|
inline bool reportReconstruct(const String<Dna5>& query, String<char>* quals, String<char>* name, String<Dna5>& lbuf, String<Dna5>& rbuf, const uint32_t *mmui32, const char* refcs, size_t numMms, uint32_t i, uint32_t top, uint32_t bot, uint32_t qlen, int stratum, const EbwtSearchParams<TStr>& params, SideLocus *l = NULL) const;
|
|
|
inline int rowL(const SideLocus& l) const;
|
|
|
inline TIndexOffU countUpTo(const SideLocus& l, int c) const;
|
|
|
inline void countUpToEx(const SideLocus& l, TIndexOffU* pairs) const;
|
|
|
inline uint32_t countFwSide(const SideLocus& l, int c) const;
|
|
|
- inline void countFwSideEx(const SideLocus& l, uint32_t *pairs) const;
|
|
|
+ inline void countFwSideEx(const SideLocus& l, TIndexOffU *pairs) const;
|
|
|
inline uint32_t countBwSide(const SideLocus& l, int c) const;
|
|
|
- inline void countBwSideEx(const SideLocus& l, uint32_t *pairs) const;
|
|
|
+ inline void countBwSideEx(const SideLocus& l, TIndexOffU *pairs) const;
|
|
|
inline TIndexOffU mapLF(const SideLocus& l ASSERT_ONLY(, bool overrideSanity = false)) const;
|
|
|
inline void mapLFEx(const SideLocus& l, TIndexOffU *pairs ASSERT_ONLY(, bool overrideSanity = false)) const;
|
|
|
inline void mapLFEx(const SideLocus& ltop, const SideLocus& lbot, TIndexOffU *tops, TIndexOffU *bots ASSERT_ONLY(, bool overrideSanity = false)) const;
|
|
|
@@ -1301,11 +1300,11 @@ class EbwtSearchParams { |
|
|
const std::vector<uint32_t>& mmui32, // mismatch list
|
|
|
const std::vector<uint8_t>& refcs, // reference characters
|
|
|
size_t numMms, // # mismatches
|
|
|
- U32Pair h, // ref coords
|
|
|
- U32Pair mh, // mate's ref coords
|
|
|
+ UPair h, // ref coords
|
|
|
+ UPair mh, // mate's ref coords
|
|
|
bool mfw, // mate's orientation
|
|
|
uint16_t mlen, // mate length
|
|
|
- U32Pair a, // arrow pair
|
|
|
+ UPair a, // arrow pair
|
|
|
uint32_t tlen, // length of text
|
|
|
uint32_t qlen, // length of query
|
|
|
int stratum, // alignment stratum
|
|
|
@@ -1972,7 +1971,7 @@ inline static int countInU64(int c, uint64_t dw) { |
|
|
#ifdef POPCNT_CAPABILITY
|
|
|
template<typename Operation>
|
|
|
#endif
|
|
|
-inline static void countInU64Ex(uint64_t dw, uint32_t* arrs) {
|
|
|
+inline static void countInU64Ex(uint64_t dw, TIndexOffU* arrs) {
|
|
|
uint64_t c0 = c_table[0];
|
|
|
uint64_t x0 = dw ^ c0;
|
|
|
uint64_t x1 = (x0 >> 1);
|
|
|
@@ -2219,7 +2218,7 @@ inline uint32_t Ebwt<TStr>::countFwSide(const SideLocus& l, int c) const { /* ch |
|
|
* break just prior to the side.
|
|
|
*/
|
|
|
template<typename TStr>
|
|
|
-inline void Ebwt<TStr>::countFwSideEx(const SideLocus& l, uint32_t* arrs) const
|
|
|
+inline void Ebwt<TStr>::countFwSideEx(const SideLocus& l, TIndexOffU* arrs) const
|
|
|
{
|
|
|
assert_lt(l._by, (int)this->_eh._sideBwtSz);
|
|
|
assert_geq(l._by, 0);
|
|
|
@@ -2247,8 +2246,8 @@ inline void Ebwt<TStr>::countFwSideEx(const SideLocus& l, uint32_t* arrs) const |
|
|
}
|
|
|
}
|
|
|
// Now factor in the occ[] count at the side break
|
|
|
- const uint32_t *ac = reinterpret_cast<const uint32_t*>(side - 8);
|
|
|
- const uint32_t *gt = reinterpret_cast<const uint32_t*>(side + this->_eh._sideSz - 8);
|
|
|
+ const TIndexOffU *ac = reinterpret_cast<const TIndexOffU*>(side - 8);
|
|
|
+ const TIndexOffU *gt = reinterpret_cast<const TIndexOffU*>(side + this->_eh._sideSz - 8);
|
|
|
#ifndef NDEBUG
|
|
|
assert_leq(ac[0], this->_fchr[1] + this->_eh.sideBwtLen());
|
|
|
assert_leq(ac[1], this->_fchr[2]-this->_fchr[1]);
|
|
|
@@ -2324,7 +2323,7 @@ inline uint32_t Ebwt<TStr>::countBwSide(const SideLocus& l, int c) const { |
|
|
* occ[] count up to the side break.
|
|
|
*/
|
|
|
template<typename TStr>
|
|
|
-inline void Ebwt<TStr>::countBwSideEx(const SideLocus& l, uint32_t* arrs) const {
|
|
|
+inline void Ebwt<TStr>::countBwSideEx(const SideLocus& l, TIndexOffU* arrs) const {
|
|
|
assert_lt(l._by, (int)this->_eh._sideBwtSz);
|
|
|
assert_geq(l._by, 0);
|
|
|
assert_lt(l._bp, 4);
|
|
|
@@ -2346,8 +2345,8 @@ inline void Ebwt<TStr>::countBwSideEx(const SideLocus& l, uint32_t* arrs) const |
|
|
}
|
|
|
}
|
|
|
// Now factor in the occ[] count at the side break
|
|
|
- const uint32_t *ac = reinterpret_cast<const uint32_t*>(side + this->_eh._sideSz - 8);
|
|
|
- const uint32_t *gt = reinterpret_cast<const uint32_t*>(side + (2*this->_eh._sideSz) - 8);
|
|
|
+ const TIndexOffU *ac = reinterpret_cast<const TIndexOffU*>(side + this->_eh._sideSz - 8);
|
|
|
+ const TIndexOffU *gt = reinterpret_cast<const TIndexOffU*>(side + (2*this->_eh._sideSz) - 8);
|
|
|
#ifndef NDEBUG
|
|
|
assert_leq(ac[0], this->_fchr[1] + this->_eh.sideBwtLen());
|
|
|
assert_leq(ac[1], this->_fchr[2]-this->_fchr[1]);
|
|
|
@@ -2654,7 +2653,7 @@ inline bool Ebwt<TStr>::report(const String<Dna5>& query, |
|
|
const std::vector<uint32_t>& mmui32,
|
|
|
const std::vector<uint8_t>& refcs,
|
|
|
size_t numMms,
|
|
|
- uint32_t off,
|
|
|
+ TIndexOffU off,
|
|
|
uint32_t top,
|
|
|
uint32_t bot,
|
|
|
uint32_t qlen,
|
|
|
@@ -2667,11 +2666,11 @@ inline bool Ebwt<TStr>::report(const String<Dna5>& query, |
|
|
VMSG_NL("In report");
|
|
|
assert_geq(cost, (uint32_t)(stratum << 14));
|
|
|
assert_lt(off, this->_eh._len);
|
|
|
- uint32_t tidx;
|
|
|
- uint32_t textoff;
|
|
|
- uint32_t tlen;
|
|
|
+ TIndexOffU tidx;
|
|
|
+ TIndexOffU textoff;
|
|
|
+ TIndexOffU tlen;
|
|
|
joinedToTextOff(qlen, off, tidx, textoff, tlen);
|
|
|
- if(tidx == 0xffffffff) {
|
|
|
+ if(tidx == OFF_MASK) {
|
|
|
return false;
|
|
|
}
|
|
|
return params.reportHit(
|
|
|
@@ -2726,7 +2725,7 @@ inline bool Ebwt<TStr>::reportChaseOne(const String<Dna5>& query, |
|
|
const std::vector<uint32_t>& mmui32,
|
|
|
const std::vector<uint8_t>& refcs,
|
|
|
size_t numMms,
|
|
|
- uint32_t i,
|
|
|
+ TIndexOffU i,
|
|
|
uint32_t top,
|
|
|
uint32_t bot,
|
|
|
uint32_t qlen,
|
|
|
@@ -2738,13 +2737,13 @@ inline bool Ebwt<TStr>::reportChaseOne(const String<Dna5>& query, |
|
|
SideLocus *l) const
|
|
|
{
|
|
|
VMSG_NL("In reportChaseOne");
|
|
|
- uint32_t off;
|
|
|
+ TIndexOffU off;
|
|
|
uint32_t jumps = 0;
|
|
|
ASSERT_ONLY(uint32_t origi = i);
|
|
|
SideLocus myl;
|
|
|
- const uint32_t offMask = this->_eh._offMask;
|
|
|
+ const TIndexOffU offMask = this->_eh._offMask;
|
|
|
const uint32_t offRate = this->_eh._offRate;
|
|
|
- const uint32_t* offs = this->_offs;
|
|
|
+ const TIndexOffU* offs = this->_offs;
|
|
|
// If the caller didn't give us a pre-calculated (and prefetched)
|
|
|
// locus, then we have to do that now
|
|
|
if(l == NULL) {
|
|
|
@@ -2756,7 +2755,7 @@ inline bool Ebwt<TStr>::reportChaseOne(const String<Dna5>& query, |
|
|
// Walk along until we reach the next marked row to the left
|
|
|
while(((i & offMask) != i) && i != _zOff) {
|
|
|
// Not a marked row; walk left one more char
|
|
|
- uint32_t newi = mapLF(*l); // calc next row
|
|
|
+ TIndexOffU newi = mapLF(*l); // calc next row
|
|
|
assert_neq(newi, i);
|
|
|
i = newi; // update row
|
|
|
l->initFromRow(i, this->_eh, this->_ebwt); // update locus
|
|
|
@@ -4283,8 +4282,8 @@ void Ebwt<TStr>::buildToDisk(InorderBlockwiseSA<TStr>& sa, |
|
|
uint8_t *absorbFtab;
|
|
|
try {
|
|
|
VMSG_NL("Allocating ftab, absorbFtab");
|
|
|
- ftab = new uint32_t[ftabLen];
|
|
|
- memset(ftab, 0, 4 * ftabLen);
|
|
|
+ ftab = new TIndexOffU[ftabLen];
|
|
|
+ memset(ftab, 0, OFF_SIZE * ftabLen);
|
|
|
absorbFtab = new uint8_t[ftabLen];
|
|
|
memset(absorbFtab, 0, ftabLen);
|
|
|
} catch(bad_alloc &e) {
|
|
|
|
0 comments on commit
fdabf72