Skip to content

Commit

Permalink
*** empty log message ***
Browse files Browse the repository at this point in the history
  • Loading branch information
langmead committed Sep 8, 2009
1 parent f33f363 commit 4f02e10
Show file tree
Hide file tree
Showing 38 changed files with 1,008 additions and 814 deletions.
43 changes: 43 additions & 0 deletions aligner.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ class UnpairedAlignerV2 : public Aligner {
vector<String<Dna5> >& os,
bool rangeMode,
bool verbose,
bool quiet,
int maxBts,
ChunkPool *pool,
int *btCnt = NULL,
Expand All @@ -346,6 +347,8 @@ class UnpairedAlignerV2 : public Aligner {
params_(params),
rchase_(rchase),
driver_(driver),
verbose_(verbose),
quiet_(quiet),
maxBts_(maxBts),
pool_(pool),
btCnt_(btCnt),
Expand Down Expand Up @@ -374,6 +377,15 @@ class UnpairedAlignerV2 : public Aligner {
metrics_->nextRead(patsrc->bufa().patFw);
}
pool_->reset(&patsrc->bufa().name, patsrc->patid());
if(patsrc->bufa().length() < 4) {
if(!quiet_) {
cerr << "Warning: Skipping read " << patsrc->bufa().name
<< " because it is less than 4 characters long" << endl;
}
this->done = true;
sinkPt_->finishRead(*patsrc_, true, true);
return;
}
driver_->setQuery(patsrc, NULL);
this->done = driver_->done;
doneFirst_ = false;
Expand Down Expand Up @@ -508,6 +520,9 @@ class UnpairedAlignerV2 : public Aligner {
// Range-finding state
TDriver* driver_;

bool verbose_; // be talkative
bool quiet_; // don't print informational/warning info

const int maxBts_;
ChunkPool *pool_;
int *btCnt_;
Expand Down Expand Up @@ -548,6 +563,7 @@ class PairedBWAlignerV1 : public Aligner {
const BitPairReference* refs,
bool rangeMode,
bool verbose,
bool quiet,
int maxBts,
ChunkPool *pool,
int *btCnt) :
Expand All @@ -572,6 +588,7 @@ class PairedBWAlignerV1 : public Aligner {
fw1_(fw1), fw2_(fw2),
rchase_(rchase),
verbose_(verbose),
quiet_(quiet),
maxBts_(maxBts),
pool_(pool),
btCnt_(btCnt),
Expand Down Expand Up @@ -654,6 +671,15 @@ class PairedBWAlignerV1 : public Aligner {
// Give all of the drivers pointers to the relevant read info
patsrc_ = patsrc;
pool_->reset(&patsrc->bufa().name, patsrc->patid());
if(patsrc->bufa().length() < 4 || patsrc->bufb().length() < 4) {
if(!quiet_) {
cerr << "Warning: Skipping pair " << patsrc->bufa().name
<< " because a mate is less than 4 characters long" << endl;
}
this->done = true;
sinkPt_->finishRead(*patsrc_, true, true);
return;
}
driver1Fw_->setQuery(patsrc, NULL);
driver1Rc_->setQuery(patsrc, NULL);
driver2Fw_->setQuery(patsrc, NULL);
Expand Down Expand Up @@ -1327,6 +1353,8 @@ class PairedBWAlignerV1 : public Aligner {

// true -> be talkative
bool verbose_;
// true -> suppress warnings
bool quiet_;

int maxBts_;
ChunkPool *pool_;
Expand Down Expand Up @@ -1451,6 +1479,7 @@ class PairedBWAlignerV2 : public Aligner {
const BitPairReference* refs,
bool rangeMode,
bool verbose,
bool quiet,
int maxBts,
ChunkPool *pool,
int *btCnt) :
Expand All @@ -1477,6 +1506,8 @@ class PairedBWAlignerV2 : public Aligner {
rchase_(rchase),
driver_(driver),
pool_(pool),
verbose_(verbose),
quiet_(quiet),
maxBts_(maxBts),
btCnt_(btCnt)
{
Expand Down Expand Up @@ -1512,6 +1543,15 @@ class PairedBWAlignerV2 : public Aligner {
// Give all of the drivers pointers to the relevant read info
patsrc_ = patsrc;
pool_->reset(&patsrc->bufa().name, patsrc->patid());
if(patsrc->bufa().length() < 4 || patsrc->bufb().length() < 4) {
if(!quiet_) {
cerr << "Warning: Skipping pair " << patsrc->bufa().name
<< " because a mate is less than 4 characters long" << endl;
}
this->done = true;
sinkPt_->finishRead(*patsrc_, true, true);
return;
}
driver_->setQuery(patsrc, NULL);
qlen1_ = patsrc_->bufa().length();
qlen2_ = patsrc_->bufb().length();
Expand Down Expand Up @@ -1934,6 +1974,9 @@ class PairedBWAlignerV2 : public Aligner {
// Pool for distributing chunks of best-first path descriptor memory
ChunkPool *pool_;

bool verbose_;
bool quiet_;

int maxBts_; // maximum allowed # backtracks
int *btCnt_; // current backtrack count

Expand Down
12 changes: 9 additions & 3 deletions aligner_0mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class UnpairedExactAlignerV1Factory : public AlignerFactory {
bool strandFix,
bool rangeMode,
bool verbose,
bool quiet,
uint32_t seed) :
ebwtFw_(ebwtFw),
ebwtBw_(ebwtBw),
Expand All @@ -55,6 +56,7 @@ class UnpairedExactAlignerV1Factory : public AlignerFactory {
strandFix_(strandFix),
rangeMode_(rangeMode),
verbose_(verbose),
quiet_(quiet),
seed_(seed)
{
assert(ebwtFw.isInMemory());
Expand Down Expand Up @@ -107,7 +109,7 @@ class UnpairedExactAlignerV1Factory : public AlignerFactory {
return new UnpairedAlignerV2<EbwtRangeSource>(
params, dr, rchase,
sink_, sinkPtFactory_, sinkPt, os_, rangeMode_, verbose_,
INT_MAX, pool_, NULL, NULL);
quiet_, INT_MAX, pool_, NULL, NULL);
}

private:
Expand All @@ -127,6 +129,7 @@ class UnpairedExactAlignerV1Factory : public AlignerFactory {
bool strandFix_;
bool rangeMode_;
bool verbose_;
bool quiet_;
uint32_t seed_;
};

Expand Down Expand Up @@ -166,6 +169,7 @@ class PairedExactAlignerV1Factory : public AlignerFactory {
bool qualOrder,
bool rangeMode,
bool verbose,
bool quiet,
uint32_t seed) :
ebwtFw_(ebwtFw),
doFw_(doFw),
Expand All @@ -192,6 +196,7 @@ class PairedExactAlignerV1Factory : public AlignerFactory {
strandFix_(strandFix),
rangeMode_(rangeMode),
verbose_(verbose),
quiet_(quiet),
seed_(seed)
{
assert(ebwtFw.isInMemory());
Expand Down Expand Up @@ -312,7 +317,7 @@ class PairedExactAlignerV1Factory : public AlignerFactory {
refAligner,
rchase, sink_, sinkPtFactory_, sinkPt, mate1fw_, mate2fw_,
peInner_, peOuter_, dontReconcile_, symCeil_, mixedThresh_,
mixedAttemptLim_, refs_, rangeMode_, verbose_,
mixedAttemptLim_, refs_, rangeMode_, verbose_, quiet_,
INT_MAX, pool_, NULL);
return al;
} else {
Expand All @@ -328,7 +333,7 @@ class PairedExactAlignerV1Factory : public AlignerFactory {
rchase, sink_, sinkPtFactory_, sinkPt,
sinkPtSe1, sinkPtSe2, mate1fw_, mate2fw_,
peInner_, peOuter_,
mixedAttemptLim_, refs_, rangeMode_, verbose_,
mixedAttemptLim_, refs_, rangeMode_, verbose_, quiet_,
INT_MAX, pool_, NULL);
delete drVec;
return al;
Expand Down Expand Up @@ -363,6 +368,7 @@ class PairedExactAlignerV1Factory : public AlignerFactory {
const bool strandFix_;
const bool rangeMode_;
const bool verbose_;
const bool quiet_;
const uint32_t seed_;
};

Expand Down
12 changes: 9 additions & 3 deletions aligner_1mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Unpaired1mmAlignerV1Factory : public AlignerFactory {
bool strandFix,
bool rangeMode,
bool verbose,
bool quiet,
uint32_t seed) :
ebwtFw_(ebwtFw),
ebwtBw_(ebwtBw),
Expand All @@ -56,6 +57,7 @@ class Unpaired1mmAlignerV1Factory : public AlignerFactory {
strandFix_(strandFix),
rangeMode_(rangeMode),
verbose_(verbose),
quiet_(quiet),
seed_(seed)
{
assert(ebwtFw.isInMemory());
Expand Down Expand Up @@ -144,7 +146,7 @@ class Unpaired1mmAlignerV1Factory : public AlignerFactory {
return new UnpairedAlignerV2<EbwtRangeSource>(
params, dr, rchase,
sink_, sinkPtFactory_, sinkPt, os_, rangeMode_, verbose_,
INT_MAX, pool_, NULL, NULL);
quiet_, INT_MAX, pool_, NULL, NULL);
}

private:
Expand All @@ -164,6 +166,7 @@ class Unpaired1mmAlignerV1Factory : public AlignerFactory {
bool strandFix_;
bool rangeMode_;
bool verbose_;
bool quiet_;
uint32_t seed_;
};

Expand Down Expand Up @@ -203,6 +206,7 @@ class Paired1mmAlignerV1Factory : public AlignerFactory {
bool strandFix,
bool rangeMode,
bool verbose,
bool quiet,
uint32_t seed) :
ebwtFw_(ebwtFw),
ebwtBw_(ebwtBw),
Expand Down Expand Up @@ -230,6 +234,7 @@ class Paired1mmAlignerV1Factory : public AlignerFactory {
strandFix_(strandFix),
rangeMode_(rangeMode),
verbose_(verbose),
quiet_(quiet),
seed_(seed)
{
assert(ebwtBw != NULL);
Expand Down Expand Up @@ -424,7 +429,7 @@ class Paired1mmAlignerV1Factory : public AlignerFactory {
refAligner, rchase,
sink_, sinkPtFactory_, sinkPt, mate1fw_, mate2fw_,
peInner_, peOuter_, dontReconcile_, symCeil_, mixedThresh_,
mixedAttemptLim_, refs_, rangeMode_, verbose_,
mixedAttemptLim_, refs_, rangeMode_, verbose_, quiet_,
INT_MAX, pool_, NULL);
delete dr1FwVec;
delete dr1RcVec;
Expand All @@ -440,7 +445,7 @@ class Paired1mmAlignerV1Factory : public AlignerFactory {
sinkPt, sinkPtSe1, sinkPtSe2,
mate1fw_, mate2fw_,
peInner_, peOuter_,
mixedAttemptLim_, refs_, rangeMode_, verbose_,
mixedAttemptLim_, refs_, rangeMode_, verbose_, quiet_,
INT_MAX, pool_, NULL);
delete dr1FwVec;
return al;
Expand Down Expand Up @@ -475,6 +480,7 @@ class Paired1mmAlignerV1Factory : public AlignerFactory {
const bool strandFix_;
const bool rangeMode_;
const bool verbose_;
const bool quiet_;
const uint32_t seed_;
};

Expand Down
12 changes: 9 additions & 3 deletions aligner_23mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Unpaired23mmAlignerV1Factory : public AlignerFactory {
bool strandFix,
bool rangeMode,
bool verbose,
bool quiet,
uint32_t seed) :
ebwtFw_(ebwtFw),
ebwtBw_(ebwtBw),
Expand All @@ -57,6 +58,7 @@ class Unpaired23mmAlignerV1Factory : public AlignerFactory {
strandFix_(strandFix),
rangeMode_(rangeMode),
verbose_(verbose),
quiet_(quiet),
seed_(seed)
{
assert(ebwtFw.isInMemory());
Expand Down Expand Up @@ -213,7 +215,7 @@ class Unpaired23mmAlignerV1Factory : public AlignerFactory {
return new UnpairedAlignerV2<EbwtRangeSource>(
params, dr, rchase,
sink_, sinkPtFactory_, sinkPt, os_, rangeMode_, verbose_,
INT_MAX, pool_, NULL, NULL);
quiet_, INT_MAX, pool_, NULL, NULL);
}

private:
Expand All @@ -234,6 +236,7 @@ class Unpaired23mmAlignerV1Factory : public AlignerFactory {
const bool strandFix_;
const bool rangeMode_;
const bool verbose_;
const bool quiet_;
uint32_t seed_;
};

Expand Down Expand Up @@ -275,6 +278,7 @@ class Paired23mmAlignerV1Factory : public AlignerFactory {
bool strandFix,
bool rangeMode,
bool verbose,
bool quiet,
uint32_t seed) :
ebwtFw_(ebwtFw),
ebwtBw_(ebwtBw),
Expand Down Expand Up @@ -303,6 +307,7 @@ class Paired23mmAlignerV1Factory : public AlignerFactory {
strandFix_(strandFix),
rangeMode_(rangeMode),
verbose_(verbose),
quiet_(quiet),
seed_(seed)
{
assert(ebwtBw != NULL);
Expand Down Expand Up @@ -621,7 +626,7 @@ class Paired23mmAlignerV1Factory : public AlignerFactory {
refAligner, rchase,
sink_, sinkPtFactory_, sinkPt, mate1fw_, mate2fw_,
peInner_, peOuter_, dontReconcile_, symCeil_, mixedThresh_,
mixedAttemptLim_, refs_, rangeMode_, verbose_,
mixedAttemptLim_, refs_, rangeMode_, verbose_, quiet_,
INT_MAX, pool_, NULL);
delete dr1FwVec;
delete dr1RcVec;
Expand All @@ -637,7 +642,7 @@ class Paired23mmAlignerV1Factory : public AlignerFactory {
sinkPt, sinkPtSe1, sinkPtSe2,
mate1fw_, mate2fw_,
peInner_, peOuter_,
mixedAttemptLim_, refs_, rangeMode_, verbose_,
mixedAttemptLim_, refs_, rangeMode_, verbose_, quiet_,
INT_MAX, pool_, NULL);
delete dr1FwVec;
return al;
Expand Down Expand Up @@ -673,6 +678,7 @@ class Paired23mmAlignerV1Factory : public AlignerFactory {
const bool strandFix_;
const bool rangeMode_;
const bool verbose_;
const bool quiet_;
const uint32_t seed_;
};

Expand Down
Loading

0 comments on commit 4f02e10

Please sign in to comment.