diff --git a/aligner_0mm.h b/aligner_0mm.h index 603f62e..7eb9de1 100644 --- a/aligner_0mm.h +++ b/aligner_0mm.h @@ -76,9 +76,9 @@ class UnpairedExactAlignerV1Factory : public AlignerFactory { const bool seeded = false; EbwtRangeSource *rFw = new EbwtRangeSource( - &ebwtFw_, true, 0xffffffff, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, true, OFF_MASK, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *rRc = new EbwtRangeSource( - &ebwtFw_, false, 0xffffffff, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, false, OFF_MASK, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); EbwtRangeSourceDriver * driverFw = new EbwtRangeSourceDriver( *params, rFw, true, false, maqPenalty_, qualOrder_, sink_, sinkPt, @@ -255,7 +255,7 @@ class PairedExactAlignerV1Factory : public AlignerFactory { TRangeSrcDr * driver2Rc = NULL; if(do1Fw) { r1Fw = new EbwtRangeSource( - &ebwtFw_, true, 0xffffffff, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, true, OFF_MASK, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); driver1Fw = new EbwtRangeSourceDriver( *params, r1Fw, true, false, maqPenalty_, qualOrder_, sink_, sinkPt, 0, // seedLen @@ -268,7 +268,7 @@ class PairedExactAlignerV1Factory : public AlignerFactory { } if(do2Fw) { r2Fw = new EbwtRangeSource( - &ebwtFw_, true, 0xffffffff, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, true, OFF_MASK, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); driver2Fw = new EbwtRangeSourceDriver( *params, r2Fw, true, false, maqPenalty_, qualOrder_, sink_, sinkPt, 0, // seedLen @@ -281,7 +281,7 @@ class PairedExactAlignerV1Factory : public AlignerFactory { } if(do1Rc) { r1Rc = new EbwtRangeSource( - &ebwtFw_, false, 0xffffffff, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, false, OFF_MASK, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); driver1Rc = new EbwtRangeSourceDriver( *params, r1Rc, false, false, maqPenalty_, qualOrder_, sink_, sinkPt, 0, // seedLen @@ -294,7 +294,7 @@ class PairedExactAlignerV1Factory : public AlignerFactory { } if(do2Rc) { r2Rc = new EbwtRangeSource( - &ebwtFw_, false, 0xffffffff, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, false, OFF_MASK, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); driver2Rc = new EbwtRangeSourceDriver( *params, r2Rc, false, false, maqPenalty_, qualOrder_, sink_, sinkPt, 0, // seedLen diff --git a/aligner_1mm.h b/aligner_1mm.h index 530464f..54bc21b 100644 --- a/aligner_1mm.h +++ b/aligner_1mm.h @@ -80,9 +80,9 @@ class Unpaired1mmAlignerV1Factory : public AlignerFactory { const bool seeded = false; EbwtRangeSource *rFw_Bw = new EbwtRangeSource( - ebwtBw_, true, 0xffffffff, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + ebwtBw_, true, OFF_MASK, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *rFw_Fw = new EbwtRangeSource( - &ebwtFw_, true, 0xffffffff, false, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, true, OFF_MASK, false, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); EbwtRangeSourceDriver * drFw_Bw = new EbwtRangeSourceDriver( *params, rFw_Bw, true, false, maqPenalty_, qualOrder_, sink_, sinkPt, @@ -110,9 +110,9 @@ class Unpaired1mmAlignerV1Factory : public AlignerFactory { } EbwtRangeSource *rRc_Fw = new EbwtRangeSource( - &ebwtFw_, false, 0xffffffff, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, false, OFF_MASK, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *rRc_Bw = new EbwtRangeSource( - ebwtBw_, false, 0xffffffff, false, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + ebwtBw_, false, OFF_MASK, false, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); EbwtRangeSourceDriver * drRc_Fw = new EbwtRangeSourceDriver( *params, rRc_Fw, false, false, maqPenalty_, qualOrder_, sink_, sinkPt, @@ -289,9 +289,9 @@ class Paired1mmAlignerV1Factory : public AlignerFactory { dr1FwVec = new TRangeSrcDrPtrVec(); if(do1Fw) { EbwtRangeSource *r1Fw_Bw = new EbwtRangeSource( - ebwtBw_, true, 0xffffffff, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + ebwtBw_, true, OFF_MASK, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *r1Fw_Fw = new EbwtRangeSource( - &ebwtFw_, true, 0xffffffff, false, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, true, OFF_MASK, false, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); EbwtRangeSourceDriver * dr1Fw_Bw = new EbwtRangeSourceDriver( *params, r1Fw_Bw, true, false, maqPenalty_, qualOrder_, sink_, sinkPt, @@ -324,9 +324,9 @@ class Paired1mmAlignerV1Factory : public AlignerFactory { } if(do1Rc) { EbwtRangeSource *r1Rc_Fw = new EbwtRangeSource( - &ebwtFw_, false, 0xffffffff, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, false, OFF_MASK, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *r1Rc_Bw = new EbwtRangeSource( - ebwtBw_, false, 0xffffffff, false, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + ebwtBw_, false, OFF_MASK, false, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); EbwtRangeSourceDriver * dr1Rc_Fw = new EbwtRangeSourceDriver( *params, r1Rc_Fw, false, false, maqPenalty_, qualOrder_, sink_, sinkPt, @@ -358,9 +358,9 @@ class Paired1mmAlignerV1Factory : public AlignerFactory { } if(do2Fw) { EbwtRangeSource *r2Fw_Bw = new EbwtRangeSource( - ebwtBw_, true, 0xffffffff, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + ebwtBw_, true, OFF_MASK, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *r2Fw_Fw = new EbwtRangeSource( - &ebwtFw_, true, 0xffffffff, false, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, true, OFF_MASK, false, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); EbwtRangeSourceDriver * dr2Fw_Bw = new EbwtRangeSourceDriver( *params, r2Fw_Bw, true, false, maqPenalty_, qualOrder_, sink_, sinkPt, @@ -392,9 +392,9 @@ class Paired1mmAlignerV1Factory : public AlignerFactory { } if(do2Rc) { EbwtRangeSource *r2Rc_Fw = new EbwtRangeSource( - &ebwtFw_, false, 0xffffffff, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, false, OFF_MASK, true, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *r2Rc_Bw = new EbwtRangeSource( - ebwtBw_, false, 0xffffffff, false, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); + ebwtBw_, false, OFF_MASK, false, verbose_, quiet_, halfAndHalf, seeded, maqPenalty_, qualOrder_); EbwtRangeSourceDriver * dr2Rc_Fw = new EbwtRangeSourceDriver( *params, r2Rc_Fw, false, false, maqPenalty_, qualOrder_, sink_, sinkPt, diff --git a/aligner_23mm.h b/aligner_23mm.h index e79b396..36a89c2 100644 --- a/aligner_23mm.h +++ b/aligner_23mm.h @@ -80,15 +80,15 @@ class Unpaired23mmAlignerV1Factory : public AlignerFactory { const bool seeded = false; EbwtRangeSource *rFw_Bw = new EbwtRangeSource( - ebwtBw_, true, 0xffffffff, true, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); + ebwtBw_, true, OFF_MASK, true, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *rFw_Fw = new EbwtRangeSource( - &ebwtFw_, true, 0xffffffff, false, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, true, OFF_MASK, false, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *rFw_BwHalf = new EbwtRangeSource( - ebwtBw_, true, 0xffffffff, false, verbose_, quiet_, 2, seeded, maqPenalty_, qualOrder_); + ebwtBw_, true, OFF_MASK, false, verbose_, quiet_, 2, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *rFw_FwHalf = NULL; if(!two_) { rFw_FwHalf = new EbwtRangeSource( - &ebwtFw_, true, 0xffffffff, false, verbose_, quiet_, 3, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, true, OFF_MASK, false, verbose_, quiet_, 3, seeded, maqPenalty_, qualOrder_); } // Driver wrapper for rFw_Bw @@ -146,15 +146,15 @@ class Unpaired23mmAlignerV1Factory : public AlignerFactory { } EbwtRangeSource *rRc_Fw = new EbwtRangeSource( - &ebwtFw_, false, 0xffffffff, true, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, false, OFF_MASK, true, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *rRc_Bw = new EbwtRangeSource( - ebwtBw_, false, 0xffffffff, false, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); + ebwtBw_, false, OFF_MASK, false, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *rRc_FwHalf = new EbwtRangeSource( - &ebwtFw_, false, 0xffffffff, false, verbose_, quiet_, 2, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, false, OFF_MASK, false, verbose_, quiet_, 2, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *rRc_BwHalf = NULL; if(!two_) { rRc_BwHalf = new EbwtRangeSource( - ebwtBw_, false, 0xffffffff, false, verbose_, quiet_, 3, seeded, maqPenalty_, qualOrder_); + ebwtBw_, false, OFF_MASK, false, verbose_, quiet_, 3, seeded, maqPenalty_, qualOrder_); } // Driver wrapper for rRc_Fw @@ -361,13 +361,13 @@ class Paired23mmAlignerV1Factory : public AlignerFactory { if(do1Fw) { EbwtRangeSource *r1Fw_Bw = new EbwtRangeSource( - ebwtBw_, true, 0xffffffff, true, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); + ebwtBw_, true, OFF_MASK, true, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *r1Fw_Fw = new EbwtRangeSource( - &ebwtFw_, true, 0xffffffff, false, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, true, OFF_MASK, false, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *r1Fw_BwHalf = new EbwtRangeSource( - ebwtBw_, true, 0xffffffff, false, verbose_, quiet_, 2, seeded, maqPenalty_, qualOrder_); + ebwtBw_, true, OFF_MASK, false, verbose_, quiet_, 2, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *r1Fw_FwHalf = two_ ? NULL : new EbwtRangeSource( - &ebwtFw_, true, 0xffffffff, false, verbose_, quiet_, 3, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, true, OFF_MASK, false, verbose_, quiet_, 3, seeded, maqPenalty_, qualOrder_); // Driver wrapper for rFw_Bw EbwtRangeSourceDriver * dr1Fw_Bw = new EbwtRangeSourceDriver( @@ -426,13 +426,13 @@ class Paired23mmAlignerV1Factory : public AlignerFactory { if(do1Rc) { EbwtRangeSource *r1Rc_Fw = new EbwtRangeSource( - &ebwtFw_, false, 0xffffffff, true, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, false, OFF_MASK, true, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *r1Rc_Bw = new EbwtRangeSource( - ebwtBw_, false, 0xffffffff, false, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); + ebwtBw_, false, OFF_MASK, false, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *r1Rc_FwHalf = new EbwtRangeSource( - &ebwtFw_, false, 0xffffffff, false, verbose_, quiet_, 2, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, false, OFF_MASK, false, verbose_, quiet_, 2, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *r1Rc_BwHalf = two_ ? NULL : new EbwtRangeSource( - ebwtBw_, false, 0xffffffff, false, verbose_, quiet_, 3, seeded, maqPenalty_, qualOrder_); + ebwtBw_, false, OFF_MASK, false, verbose_, quiet_, 3, seeded, maqPenalty_, qualOrder_); // Driver wrapper for rRc_Fw EbwtRangeSourceDriver * dr1Rc_Fw = new EbwtRangeSourceDriver( @@ -491,13 +491,13 @@ class Paired23mmAlignerV1Factory : public AlignerFactory { if(do2Fw) { EbwtRangeSource *r2Fw_Bw = new EbwtRangeSource( - ebwtBw_, true, 0xffffffff, true, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); + ebwtBw_, true, OFF_MASK, true, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *r2Fw_Fw = new EbwtRangeSource( - &ebwtFw_, true, 0xffffffff, false, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, true, OFF_MASK, false, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *r2Fw_BwHalf = new EbwtRangeSource( - ebwtBw_, true, 0xffffffff, false, verbose_, quiet_, 2, seeded, maqPenalty_, qualOrder_); + ebwtBw_, true, OFF_MASK, false, verbose_, quiet_, 2, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *r2Fw_FwHalf = two_ ? NULL : new EbwtRangeSource( - &ebwtFw_, true, 0xffffffff, false, verbose_, quiet_, 3, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, true, OFF_MASK, false, verbose_, quiet_, 3, seeded, maqPenalty_, qualOrder_); // Driver wrapper for rFw_Bw EbwtRangeSourceDriver * dr2Fw_Bw = new EbwtRangeSourceDriver( @@ -555,13 +555,13 @@ class Paired23mmAlignerV1Factory : public AlignerFactory { if(do2Rc) { EbwtRangeSource *r2Rc_Fw = new EbwtRangeSource( - &ebwtFw_, false, 0xffffffff, true, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, false, OFF_MASK, true, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *r2Rc_Bw = new EbwtRangeSource( - ebwtBw_, false, 0xffffffff, false, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); + ebwtBw_, false, OFF_MASK, false, verbose_, quiet_, 0, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *r2Rc_FwHalf = new EbwtRangeSource( - &ebwtFw_, false, 0xffffffff, false, verbose_, quiet_, 2, seeded, maqPenalty_, qualOrder_); + &ebwtFw_, false, OFF_MASK, false, verbose_, quiet_, 2, seeded, maqPenalty_, qualOrder_); EbwtRangeSource *r2Rc_BwHalf = two_ ? NULL : new EbwtRangeSource( - ebwtBw_, false, 0xffffffff, false, verbose_, quiet_, 3, seeded, maqPenalty_, qualOrder_); + ebwtBw_, false, OFF_MASK, false, verbose_, quiet_, 3, seeded, maqPenalty_, qualOrder_); // Driver wrapper for rRc_Fw EbwtRangeSourceDriver * dr2Rc_Fw = new EbwtRangeSourceDriver( diff --git a/annot.cpp b/annot.cpp index 648689f..fd88c7e 100644 --- a/annot.cpp +++ b/annot.cpp @@ -20,7 +20,7 @@ void AnnotationMap::parse() { throw 1; } while(in.peek() != EOF) { - U32Pair pos; + UPair pos; CharPair an; in >> pos.first >> pos.second >> an.first >> an.second; map_[pos] = an; diff --git a/annot.h b/annot.h index d5fd250..ab2c79a 100644 --- a/annot.h +++ b/annot.h @@ -12,6 +12,7 @@ #include #include #include +#include "btypes.h" /** * Encapsulates a sorted list of reference positions that are annotated @@ -19,10 +20,10 @@ */ class AnnotationMap { public: - typedef std::pair U32Pair; + typedef std::pair UPair; typedef std::pair CharPair; - typedef std::map AnnotMap; - typedef std::map::const_iterator Iter; + typedef std::map AnnotMap; + typedef std::map::const_iterator Iter; AnnotationMap(const char *fname) { fname_ = fname; @@ -34,7 +35,7 @@ class AnnotationMap { * new reference coordinate via the reference map supplied by the * user. */ - Iter lower_bound(const U32Pair& h) const { + Iter lower_bound(const UPair& h) const { return map_.lower_bound(h); } diff --git a/blockwise_sa.h b/blockwise_sa.h index 2dcf765..830a0a9 100644 --- a/blockwise_sa.h +++ b/blockwise_sa.h @@ -508,7 +508,7 @@ void KarkkainenBlockwiseSA::buildSamples() { VMSG_NL("Splitting and merging"); for(TIndexOffU i = 0; i < numBuckets; i++) { TIndexOffU mergedSz = bsz + 1; - assert(bucketSzs[i] == 0 || bucketReps[i] != 0xffffffff); + assert(bucketSzs[i] == 0 || bucketReps[i] != OFF_MASK); if(i < (TIndexOffU)numBuckets-1) { mergedSz = bucketSzs[(size_t)i] + bucketSzs[(size_t)i+1] + 1; } diff --git a/btypes.h b/btypes.h index ea09d79..4846434 100644 --- a/btypes.h +++ b/btypes.h @@ -8,6 +8,7 @@ #define OFF_LEN_MASK 0xc000000000000000 #define LS_SIZE 0x100000000000000 #define OFF_SIZE 8 +#define CACHE_WRAPER_BIT 0x8000000000000000 typedef uint64_t TIndexOffU; typedef int64_t TIndexOff; @@ -17,6 +18,7 @@ typedef int64_t TIndexOff; #define OFF_LEN_MASK 0xc0000000 #define LS_SIZE 0x10000000 #define OFF_SIZE 4 +#define CACHE_WRAPER_BIT 0x80000000 typedef uint32_t TIndexOffU; typedef int TIndexOff; diff --git a/ebwt.h b/ebwt.h index 14a3e66..65c0f7d 100644 --- a/ebwt.h +++ b/ebwt.h @@ -1133,7 +1133,7 @@ class Ebwt { void joinedToTextOff(TIndexOffU qlen, TIndexOffU off, TIndexOffU& tidx, TIndexOffU& textoff, TIndexOffU& tlen) const; inline bool report(const String& query, String* quals, String* name, bool color, char primer, char trimc, bool colExEnds, int snpPhred, const BitPairReference* ref, const std::vector& mmui32, const std::vector& refcs, size_t numMms, TIndexOffU off, TIndexOffU top, TIndexOffU bot, uint32_t qlen, int stratum, uint16_t cost, uint32_t patid, uint32_t seed, const EbwtSearchParams& params) const; inline bool reportChaseOne(const String& query, String* quals, String* name, bool color, char primer, char trimc, bool colExEnds, int snpPhred, const BitPairReference* ref, const std::vector& mmui32, const std::vector& refcs, size_t numMms, TIndexOffU i, TIndexOffU top, TIndexOffU bot, uint32_t qlen, int stratum, uint16_t cost, uint32_t patid, uint32_t seed, const EbwtSearchParams& params, SideLocus *l = NULL) const; - inline bool reportReconstruct(const String& query, String* quals, String* name, String& lbuf, String& 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& params, SideLocus *l = NULL) const; + inline bool reportReconstruct(const String& query, String* quals, String* name, String& lbuf, String& rbuf, const TIndexOffU *mmui32, const char* refcs, size_t numMms, TIndexOffU i, TIndexOffU top, TIndexOffU bot, uint32_t qlen, int stratum, const EbwtSearchParams& 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; @@ -2797,12 +2797,12 @@ inline bool Ebwt::reportReconstruct(const String& query, String* name, String& lbuf, String& rbuf, - const uint32_t *mmui32, + const TIndexOffU *mmui32, const char* refcs, size_t numMms, - uint32_t i, - uint32_t top, - uint32_t bot, + TIndexOffU i, + TIndexOffU top, + TIndexOffU bot, uint32_t qlen, int stratum, const EbwtSearchParams& params, @@ -2810,13 +2810,13 @@ inline bool Ebwt::reportReconstruct(const String& query, { VMSG_NL("In reportReconstruct"); assert_gt(_eh._isaLen, 0); // Must have inverse suffix array to reconstruct - uint32_t off; - uint32_t jumps = 0; + TIndexOffU off; + TIndexOffU jumps = 0; SideLocus myl; - const uint32_t offMask = this->_eh._offMask; - const uint32_t offRate = this->_eh._offRate; - const uint32_t* offs = this->_offs; - const uint32_t* isa = this->_isa; + const TIndexOffU offMask = this->_eh._offMask; + const TIndexOffU offRate = this->_eh._offRate; + const TIndexOffU* offs = this->_offs; + const TIndexOffU* isa = this->_isa; assert(isa != NULL); if(l == NULL) { l = &myl; @@ -2829,7 +2829,7 @@ inline bool Ebwt::reportReconstruct(const String& query, // Not a marked row; walk left one more char int c = rowL(*l); appendValue(lbuf, (Dna5)c); - uint32_t newi; + TIndexOffU newi; assert_lt(c, 4); assert_geq(c, 0); if(l->_fw) newi = countFwSide(*l, c); // Forward side @@ -2857,11 +2857,11 @@ inline bool Ebwt::reportReconstruct(const String& query, // check whether the seed is valid (i.e., does not straddle a // boundary between two reference seuqences) and to obtain its // extents - uint32_t tidx; // the index (id) of the reference we hit in - uint32_t textoff; // the offset of the alignment within the reference - uint32_t tlen; // length of reference seed hit in + TIndexOffU tidx; // the index (id) of the reference we hit in + TIndexOffU textoff; // the offset of the alignment within the reference + TIndexOffU tlen; // length of reference seed hit in joinedToTextOff(qlen, off, tidx, textoff, tlen); - if(tidx == 0xffffffff) { + if(tidx == OFF_MASK) { // The seed straddled a reference boundary, and so is spurious. // Return false, indicating that we shouldn't stop. return false; @@ -2878,12 +2878,12 @@ inline bool Ebwt::reportReconstruct(const String& query, } else if(jumps < textoff) { // Keep walking until we reach the end of the reference assert_neq(i, _zOff); - uint32_t diff = textoff-jumps; + TIndexOffU diff = textoff-jumps; for(size_t j = 0; j < diff; j++) { // Not a marked row; walk left one more char int c = rowL(*l); appendValue(lbuf, (Dna5)c); - uint32_t newi; + TIndexOffU newi; assert_lt(c, 4); assert_geq(c, 0); if(l->_fw) newi = countFwSide(*l, c); // Forward side @@ -2901,10 +2901,10 @@ inline bool Ebwt::reportReconstruct(const String& query, assert_eq(textoff, jumps); assert_eq(textoff, length(lbuf)); // Calculate the right-hand extent of the reference - uint32_t ref_right = off - textoff + tlen; + TIndexOffU ref_right = off - textoff + tlen; // Round the right-hand extent to the nearest ISA element that maps // to it or a character to its right - uint32_t ref_right_rounded = ref_right; + TIndexOffU ref_right_rounded = ref_right; if((ref_right_rounded & _eh._isaMask) != ref_right_rounded) { ref_right_rounded = ((ref_right_rounded >> _eh._isaRate)+1) << _eh._isaRate; } @@ -2916,14 +2916,14 @@ inline bool Ebwt::reportReconstruct(const String& query, } else { i = isa[ref_right_rounded >> _eh._isaRate]; } - uint32_t right_steps_rounded = ref_right_rounded - (off + qlen); - uint32_t right_steps = ref_right - (off + qlen); + TIndexOffU right_steps_rounded = ref_right_rounded - (off + qlen); + TIndexOffU right_steps = ref_right - (off + qlen); l->initFromRow(i, this->_eh, this->_ebwt); // update locus for(size_t j = 0; j < right_steps_rounded; j++) { // Not a marked row; walk left one more char int c = rowL(*l); appendValue(rbuf, (Dna5)c); - uint32_t newi; + TIndexOffU newi; assert_lt(c, 4); assert_geq(c, 0); if(l->_fw) newi = countFwSide(*l, c); // Forward side else newi = countBwSide(*l, c); // Backward side diff --git a/ebwt_search_backtrack.h b/ebwt_search_backtrack.h index 3766874..4445f07 100644 --- a/ebwt_search_backtrack.h +++ b/ebwt_search_backtrack.h @@ -1801,7 +1801,7 @@ class EbwtRangeSource : public RangeSource { EbwtRangeSource( const TEbwt* ebwt, bool fw, - uint32_t qualLim, + TIndexOffU qualLim, bool reportExacts, bool verbose, bool quiet, @@ -1997,8 +1997,8 @@ class EbwtRangeSource : public RangeSource { // Use the ftab to jump 'ftabChars' chars into the read // from the right uint32_t ftabOff = calcFtabOff(); - uint32_t top = ebwt.ftabHi(ftabOff); - uint32_t bot = ebwt.ftabLo(ftabOff+1); + TIndexOffU top = ebwt.ftabHi(ftabOff); + TIndexOffU bot = ebwt.ftabLo(ftabOff+1); if(qlen_ == (uint32_t)ftabChars && bot > top) { // We found a range with 0 mismatches immediately. Set // fields to indicate we found a range. @@ -2171,8 +2171,8 @@ class EbwtRangeSource : public RangeSource { // be exceeded bool curIsAlternative = (depth >= br->depth0_) && (br->ham_ + bestq <= qualLim_); - ASSERT_ONLY(uint32_t obot = br->bot_); - uint32_t otop = br->top_; + ASSERT_ONLY(TIndexOffU obot = br->bot_); + TIndexOffU otop = br->top_; // If c is 'N', then it's a mismatch if(c == 4 && depth > 0) { @@ -2267,7 +2267,7 @@ class EbwtRangeSource : public RangeSource { if(br->top_ + 1 == br->bot_) { if(metrics_ != NULL) metrics_->curBwtOps_++; br->bot_ = br->top_ = ebwt.mapLF1(br->top_, br->ltop_, c); - if(br->bot_ != 0xffffffff) br->bot_++; + if(br->bot_ != OFF_MASK) br->bot_++; } else { if(metrics_ != NULL) metrics_->curBwtOps_++; br->top_ = ebwt.mapLF(br->ltop_, c); @@ -3058,7 +3058,7 @@ class EbwtSeededRangeSourceDriver : public RangeSourceDriver { // top offset assert_gt(range().bot, range().top); assert(range().ebwt != NULL); - int64_t top = (int64_t)range().top; + TIndexOffU top = (TIndexOffU)range().top; top++; // ensure it's not 0 if(!range().ebwt->fw()) top = -top; assert(allTops_.find(top) == allTops_.end()); diff --git a/filebuf.h b/filebuf.h index 1b19ab9..b73c0b6 100644 --- a/filebuf.h +++ b/filebuf.h @@ -399,7 +399,7 @@ class BitpairOutFileBuf { static const size_t BUF_SZ = 128 * 1024; FILE *out_; int bpPtr_; - uint32_t cur_; + size_t cur_; char buf_[BUF_SZ]; // (large) input buffer }; diff --git a/range_cache.h b/range_cache.h index 176f787..cc7ceac 100644 --- a/range_cache.h +++ b/range_cache.h @@ -15,8 +15,8 @@ #include "ebwt.h" #include "row_chaser.h" -#define RANGE_NOT_SET 0xffffffff -#define RANGE_CACHE_BAD_ALLOC 0xffffffff +#define RANGE_NOT_SET OFF_MASK +#define RANGE_CACHE_BAD_ALLOC OFF_MASK /** * Manages a pool of memory used exclusively for range cache entries. @@ -32,13 +32,13 @@ */ class RangeCacheMemPool { public: - RangeCacheMemPool(uint32_t lim /* max cache size in bytes */) : + RangeCacheMemPool(TIndexOffU lim /* max cache size in bytes */) : lim_(lim >> 2 /* convert to words */), occ_(0), buf_(NULL), closed_(false) { if(lim_ > 0) { try { - buf_ = new uint32_t[lim_]; + buf_ = new TIndexOffU[lim_]; if(buf_ == NULL) throw std::bad_alloc(); } catch(std::bad_alloc& e) { cerr << "Allocation error allocating " << lim @@ -60,21 +60,21 @@ class RangeCacheMemPool { /** * Allocate numElts elements from the word pool. */ - uint32_t alloc(uint32_t numElts) { + TIndexOffU alloc(TIndexOffU numElts) { assert_gt(numElts, 0); assert_leq(occ_, lim_); - if(occ_ + numElts > lim_ || numElts >= 0x80000000) { + if(occ_ + numElts > lim_ || numElts >= CACHE_WRAPER_BIT) { return RANGE_CACHE_BAD_ALLOC; } assert_gt(lim_, 0); - uint32_t ret = occ_; + TIndexOffU ret = occ_; assert(allocs_.find(ret) == allocs_.end()); ASSERT_ONLY(allocs_.insert(ret)); // Clear the first elt so that we don't think there's already // something there #ifndef NDEBUG - for(size_t i = 0; i < numElts; i++) { - assert_eq(0xffffffff, buf_[occ_ + i]); + for(TIndexOffU i = 0; i < numElts; i++) { + assert_eq(OFF_MASK, buf_[occ_ + i]); } #endif buf_[occ_] = 0; @@ -91,13 +91,13 @@ class RangeCacheMemPool { * Turn a pool-array index into a pointer; check that it doesn't * fall outside the pool first. */ - inline uint32_t *get(uint32_t off) { + inline TIndexOffU *get(TIndexOffU off) { assert_gt(lim_, 0); assert_lt(off, lim_); assert(allocs_.find(off) != allocs_.end()); - uint32_t *ret = buf_ + off; - assert_neq(0x80000000, ret[0]); - assert_neq(0xffffffff, ret[0]); + TIndexOffU *ret = buf_ + off; + assert_neq(CACHE_WRAPER_BIT, ret[0]); + assert_neq(OFF_MASK, ret[0]); return ret; } @@ -109,12 +109,12 @@ class RangeCacheMemPool { } private: - uint32_t lim_; /// limit on number of 32-bit words to dish out in total - uint32_t occ_; /// number of occupied words - uint32_t *buf_; /// buffer of 32-bit words + TIndexOffU lim_; /// limit on number of 32-bit words to dish out in total + TIndexOffU occ_; /// number of occupied words + TIndexOffU *buf_; /// buffer of 32-bit words bool closed_; /// #ifndef NDEBUG - std::set allocs_; // elements allocated + std::set allocs_; // elements allocated #endif }; @@ -124,7 +124,6 @@ class RangeCacheMemPool { class RangeCacheEntry { typedef Ebwt > TEbwt; - typedef std::pair U32Pair; typedef RowChaser > TRowChaser; public: @@ -140,7 +139,7 @@ class RangeCacheEntry { * Create a new RangeCacheEntry from the data in the pool at 'ents'. */ RangeCacheEntry(RangeCacheMemPool& pool, TIndexOffU top, - uint32_t ent, TEbwt* ebwt, bool sanity = false) : + TIndexOffU ent, TEbwt* ebwt, bool sanity = false) : sanity_(sanity) { init(pool, top, ent, ebwt); @@ -149,21 +148,21 @@ class RangeCacheEntry { /** * Initialize a RangeCacheEntry from the data in the pool at 'ents'. */ - void init(RangeCacheMemPool& pool, TIndexOffU top, uint32_t ent, TEbwt* ebwt) { + void init(RangeCacheMemPool& pool, TIndexOffU top, TIndexOffU ent, TEbwt* ebwt) { assert(ebwt != NULL); top_ = top; ebwt_ = ebwt; - uint32_t *ents = pool.get(ent); - assert_neq(0x80000000, ents[0]); + TIndexOffU *ents = pool.get(ent); + assert_neq(CACHE_WRAPER_BIT, ents[0]); // Is hi bit set? - if((ents[0] & 0x80000000) != 0) { + if((ents[0] & CACHE_WRAPER_BIT) != 0) { // If so, the target is a wrapper and the non-hi bits // contain the # jumps - jumps_ = (ents[0] & ~0x80000000); + jumps_ = (ents[0] & ~CACHE_WRAPER_BIT); assert_gt(jumps_, 0); assert_leq(jumps_, ebwt_->_eh._len); // Get the target entry - uint32_t *dest = pool.get(ents[1]); + TIndexOffU *dest = pool.get(ents[1]); // Get the length from the target entry len_ = dest[0]; assert_leq(top_ + len_, ebwt_->_eh._len); @@ -189,16 +188,16 @@ class RangeCacheEntry { * Initialize a wrapper with given number of jumps and given target * entry index. */ - void init(RangeCacheMemPool& pool, TIndexOffU top, uint32_t jumps, - uint32_t ent, TEbwt* ebwt) + void init(RangeCacheMemPool& pool, TIndexOffU top, TIndexOffU jumps, + TIndexOffU ent, TEbwt* ebwt) { assert(ebwt != NULL); ebwt_ = ebwt; top_ = top; jumps_ = jumps; - uint32_t *ents = pool.get(ent); + TIndexOffU *ents = pool.get(ent); // Must not be a wrapper - assert_eq(0, ents[0] & 0x80000000); + assert_eq(0, ents[0] & CACHE_WRAPER_BIT); // Get the length from the target entry len_ = ents[0]; assert_gt(len_, 0); @@ -209,13 +208,13 @@ class RangeCacheEntry { assert(sanityCheckEnts()); } - uint32_t len() const { + TIndexOffU len() const { assert(ents_ != NULL); assert(ebwt_ != NULL); return len_; } - uint32_t jumps() const { + TIndexOffU jumps() const { assert(ents_ != NULL); assert(ebwt_ != NULL); return jumps_; @@ -244,7 +243,7 @@ class RangeCacheEntry { * adjust for how many jumps down the tunnel the cache entry is * situated. */ - void install(uint32_t elt, uint32_t val) { + void install(TIndexOffU elt, TIndexOffU val) { if(ents_ == NULL) { // This is not a valid cache entry; do nothing return; @@ -252,12 +251,12 @@ class RangeCacheEntry { assert(ents_ != NULL); assert(ebwt_ != NULL); assert_leq(jumps_, val); - assert_neq(0xffffffff, val); + assert_neq(OFF_MASK, val); assert_leq(top_ + len_, ebwt_->_eh._len); if(elt < len_) { val -= jumps_; if(verbose_) cout << "Installed reference offset: " << (top_ + elt) << endl; - ASSERT_ONLY(uint32_t sanity = TRowChaser::toFlatRefOff(ebwt_, 1, top_ + elt)); + ASSERT_ONLY(TIndexOffU sanity = TRowChaser::toFlatRefOff(ebwt_, 1, top_ + elt)); assert_eq(sanity, val); #ifndef NDEBUG for(size_t i = 0; i < len_; i++) { @@ -275,7 +274,7 @@ class RangeCacheEntry { /** * Get an element from the cache, adjusted for tunnel jumps. */ - inline uint32_t get(uint32_t elt) const { + inline TIndexOffU get(TIndexOffU elt) const { if(ents_ == NULL) { // This is not a valid cache entry; do nothing return RANGE_NOT_SET; @@ -285,8 +284,8 @@ class RangeCacheEntry { assert_leq(top_ + len_, ebwt_->_eh._len); if(elt < len_ && ents_[elt] != RANGE_NOT_SET) { if(verbose_) cout << "Retrieved result from cache: " << (top_ + elt) << endl; - uint32_t ret = ents_[elt] + jumps_; - ASSERT_ONLY(uint32_t sanity = TRowChaser::toFlatRefOff(ebwt_, 1, top_ + elt)); + TIndexOffU ret = ents_[elt] + jumps_; + ASSERT_ONLY(TIndexOffU sanity = TRowChaser::toFlatRefOff(ebwt_, 1, top_ + elt)); assert_eq(sanity, ret); return ret; } else { @@ -298,22 +297,22 @@ class RangeCacheEntry { /** * Check that len_ and the ents_ array both make sense. */ - static bool sanityCheckEnts(uint32_t len, uint32_t *ents, TEbwt* ebwt) { + static bool sanityCheckEnts(TIndexOffU len, TIndexOffU *ents, TEbwt* ebwt) { assert_gt(len, 0); assert_leq(len, ebwt->_eh._len); if(len < 10) { for(size_t i = 0; i < len; i++) { - if(ents[i] == 0xffffffff) continue; + if(ents[i] == OFF_MASK) continue; assert_leq(ents[i], ebwt->_eh._len); for(size_t j = i+1; j < len; j++) { - if(ents[j] == 0xffffffff) continue; + if(ents[j] == OFF_MASK) continue; assert_neq(ents[i], ents[j]); } } } else { - std::set seen; + std::set seen; for(size_t i = 0; i < len; i++) { - if(ents[i] == 0xffffffff) continue; + if(ents[i] == OFF_MASK) continue; assert(seen.find(ents[i]) == seen.end()); seen.insert(ents[i]); } @@ -331,10 +330,9 @@ class RangeCacheEntry { private: TIndexOffU top_; /// top pointer for this range - uint32_t jumps_; /// how many tunnel-jumps it is away from the requester - uint32_t len_; /// # of entries in cache entry - uint32_t *ents_; /// ptr to entries, which are flat offs within joined ref - //U32Pair *ents_; /// pointer to entries, which are tidx,toff pairs + TIndexOffU jumps_; /// how many tunnel-jumps it is away from the requester + TIndexOffU len_; /// # of entries in cache entry + TIndexOffU *ents_; /// ptr to entries, which are flat offs within joined ref TEbwt *ebwt_; /// index that alignments are in bool verbose_; /// be talkative? bool sanity_; /// do consistency checks? @@ -346,12 +344,12 @@ class RangeCacheEntry { class RangeCache { typedef Ebwt > TEbwt; - typedef std::vector TU32Vec; - typedef std::map TMap; - typedef std::map::iterator TMapItr; + typedef std::vector TUVec; + typedef std::map TMap; + typedef std::map::iterator TMapItr; public: - RangeCache(uint32_t lim, TEbwt* ebwt) : + RangeCache(size_t lim, TEbwt* ebwt) : lim_(lim), map_(), pool_(lim), closed_(false), ebwt_(ebwt), sanity_(true) { } /** @@ -381,7 +379,7 @@ class RangeCache { return ret; } else { // There is a cache entry for the given 'top' offset - uint32_t ret = itr->second; + TIndexOffU ret = itr->second; ent.init(pool_, top, ret, ebwt_); return true; // success } @@ -396,16 +394,16 @@ class RangeCache { for(TMapItr itr = map_.begin(); itr != map_.end(); itr++) { TIndexOffU top = itr->first; TIndexOffU idx = itr->second; - uint32_t jumps = 0; + TIndexOffU jumps = 0; assert_leq(top, ebwt_->_eh._len); - uint32_t *ents = pool_.get(idx); - if((ents[0] & 0x80000000) != 0) { - jumps = ents[0] & ~0x80000000; + TIndexOffU *ents = pool_.get(idx); + if((ents[0] & CACHE_WRAPER_BIT) != 0) { + jumps = ents[0] & ~CACHE_WRAPER_BIT; assert_leq(jumps, ebwt_->_eh._len); idx = ents[1]; ents = pool_.get(idx); } - uint32_t len = ents[0]; + TIndexOffU len = ents[0]; assert_leq(top + len, ebwt_->_eh._len); RangeCacheEntry::sanityCheckEnts(len, ents + 1, ebwt_); } @@ -420,14 +418,14 @@ class RangeCache { * suffixes (though longer) as the given range, and 2) has a cache * entry for it. */ - bool tunnel(uint32_t top, uint32_t bot, RangeCacheEntry& ent) { + bool tunnel(TIndexOffU top, TIndexOffU bot, RangeCacheEntry& ent) { assert_gt(bot, top); - TU32Vec tops; + TUVec tops; const TIndexOffU spread = bot - top; SideLocus tloc, bloc; SideLocus::initFromTopBot(top, bot, ebwt_->_eh, ebwt_->_ebwt, tloc, bloc); - uint32_t newtop = top, newbot = bot; - uint32_t jumps = 0; + TIndexOffU newtop = top, newbot = bot; + TIndexOffU jumps = 0; // Walk left through the tunnel while(true) { if(ebwt_->rowL(tloc) != ebwt_->rowL(bloc)) { @@ -453,23 +451,23 @@ class RangeCache { // This range, which is further to the left in the // same tunnel as the query range, has a cache // entry already, so use that - uint32_t idx = itr->second; - uint32_t *ents = pool_.get(idx); - if((ents[0] & 0x80000000) != 0) { + TIndexOffU idx = itr->second; + TIndexOffU *ents = pool_.get(idx); + if((ents[0] & CACHE_WRAPER_BIT) != 0) { // The cache entry we found was a wrapper; make // a new wrapper that points to that wrapper's // target, with the appropriate number of jumps - jumps += (ents[0] & ~0x80000000); + jumps += (ents[0] & ~CACHE_WRAPER_BIT); idx = ents[1]; } // Allocate a new wrapper - uint32_t newentIdx = pool_.alloc(2); + TIndexOffU newentIdx = pool_.alloc(2); if(newentIdx != RANGE_CACHE_BAD_ALLOC) { // We successfully made a new wrapper entry; // now populate it and install it in map_ - uint32_t *newent = pool_.get(newentIdx); // get ptr to it + TIndexOffU *newent = pool_.get(newentIdx); // get ptr to it assert_eq(0, newent[0]); - newent[0] = 0x80000000 | jumps; // set jumps + newent[0] = CACHE_WRAPER_BIT | jumps; // set jumps newent[1] = idx; // set target assert(map_.find(top) == map_.end()); map_[top] = newentIdx; @@ -493,20 +491,20 @@ class RangeCache { assert_eq(jumps, tops.size()); // Try to create a new cache entry for the leftmost range in // the tunnel (which might be the query range) - uint32_t newentIdx = pool_.alloc(spread + 1); + TIndexOffU newentIdx = pool_.alloc(spread + 1); if(newentIdx != RANGE_CACHE_BAD_ALLOC) { // Successfully allocated new range cache entry; install it - uint32_t *newent = pool_.get(newentIdx); + TIndexOffU *newent = pool_.get(newentIdx); assert_eq(0, newent[0]); // Store cache-range length in first word newent[0] = spread; - assert_lt(newent[0], 0x80000000); + assert_lt(newent[0], CACHE_WRAPER_BIT); assert_eq(spread, newent[0]); TIndexOffU entTop = top; - uint32_t jumps = 0; + TIndexOffU jumps = 0; if(tops.size() > 0) { entTop = tops.back(); - jumps = (uint32_t)tops.size(); + jumps = tops.size(); } // Cache the entry for the end of the tunnel assert(map_.find(entTop) == map_.end()); @@ -517,11 +515,11 @@ class RangeCache { if(jumps > 0) { assert_neq(entTop, top); // Cache a wrapper entry for the query range (if possible) - uint32_t wrapentIdx = pool_.alloc(2); + TIndexOffU wrapentIdx = pool_.alloc(2); if(wrapentIdx != RANGE_CACHE_BAD_ALLOC) { - uint32_t *wrapent = pool_.get(wrapentIdx); + TIndexOffU *wrapent = pool_.get(wrapentIdx); assert_eq(0, wrapent[0]); - wrapent[0] = 0x80000000 | jumps; + wrapent[0] = CACHE_WRAPER_BIT | jumps; wrapent[1] = newentIdx; assert(map_.find(top) == map_.end()); map_[top] = wrapentIdx; @@ -535,7 +533,7 @@ class RangeCache { } } - uint32_t lim_; /// Total number of key/val bytes to keep in cache + TIndexOffU lim_; /// Total number of key/val bytes to keep in cache TMap map_; /// RangeCacheMemPool pool_; /// Memory pool bool closed_; /// Out of space; no new entries diff --git a/range_chaser.h b/range_chaser.h index 5f04e55..98a4863 100644 --- a/range_chaser.h +++ b/range_chaser.h @@ -283,7 +283,7 @@ class RangeChaser { TIndexOffU bot_; /// range bottom TIndexOffU irow_; /// initial randomly-chosen row within range TIndexOffU row_; /// current row within range - UPair off_; /// calculated offset (0xffffffff if not done) + UPair off_; /// calculated offset (OFF_MASK if not done) TIndexOffU tlen_; /// length of text hit TRowChaser chaser_; /// stateful row chaser RangeCacheEntry cacheEnt_; /// current cache entry diff --git a/range_source.h b/range_source.h index b163228..79702d1 100644 --- a/range_source.h +++ b/range_source.h @@ -339,7 +339,7 @@ struct RangeState { if(num > 1 && (!fuzzy || eq.flags.quallo == lo2)) { last = false; // not the last at this pos // Sum up range sizes and do a random weighted pick - uint32_t tot = 0; + TIndexOffU tot = 0; bool candA = !eq.flags.mmA; bool candC = !eq.flags.mmC; bool candG = !eq.flags.mmG; bool candT = !eq.flags.mmT; bool candInsA = false, candInsC = false; diff --git a/refmap.cpp b/refmap.cpp index 0867791..29e3dc6 100644 --- a/refmap.cpp +++ b/refmap.cpp @@ -41,7 +41,7 @@ void ReferenceMap::parse() { if(c == '>') { // This appears to be a name line in.get(); // chop off the initial '>' - uint32_t off; + TIndexOffU off; in >> off; in.get(); // chop off tab char buf[1024]; @@ -52,7 +52,7 @@ void ReferenceMap::parse() { } continue; } - uint32_t id, off; + TIndexOffU id, off; in >> id >> off; map_.resize(map_.size()+1); map_.back().first = id; diff --git a/row_chaser.h b/row_chaser.h index 8d776ac..1a7cacc 100644 --- a/row_chaser.h +++ b/row_chaser.h @@ -177,9 +177,9 @@ class RowChaser { TIndexOffU qlen_; /// length of read; needed to convert to ref. coordinates const EbwtParams* eh_; /// eh field from index TIndexOffU row_; /// current row - uint32_t jumps_; /// # steps so far + TIndexOffU jumps_; /// # steps so far SideLocus sideloc_; /// current side locus - TIndexOffU off_; /// calculated offset (0xffffffff if not done) + TIndexOffU off_; /// calculated offset (OFF_MASK if not done) TIndexOffU tlen_; /// hit text length AlignerMetrics *metrics_; };