Skip to content
Snippets Groups Projects
Commit cfcb2ce0 authored by Aaron's avatar Aaron
Browse files

formatting

parent 0b51d877
No related branches found
No related tags found
No related merge requests found
......@@ -70,7 +70,6 @@ void ChromSweep::ScanCache() {
list<BED>::iterator c = _cache.begin();
while (c != _cache.end())
{
if ((_curr_qy.chrom == c->chrom) && !(after(_curr_qy, *c))) {
if (IsValidHit(_curr_qy, *c)) {
_hits.push_back(*c);
......@@ -94,7 +93,7 @@ bool ChromSweep::ChromChange()
// fast-forward the database to catch-up.
else if ((_curr_qy.chrom > _curr_db.chrom) && (!_db->Empty())) {
while (_db->GetNextBed(_curr_db, true) &&
_curr_db.chrom < _curr_qy.chrom)
_curr_db.chrom < _curr_qy.chrom)
{
}
_cache.clear();
......@@ -160,16 +159,16 @@ bool ChromSweep::Next(pair<BED, vector<BED> > &next) {
// scan the database cache for hits
ScanCache();
// advance the db until we are ahead of the query.
// update hits and cache as necessary
// update hits and cache as necessary
while (!_db->Empty() &&
_curr_qy.chrom == _curr_db.chrom &&
!(after(_curr_db, _curr_qy)))
{
if (IsValidHit(_curr_qy, _curr_db)) {
_hits.push_back(_curr_db);
}
_cache.push_back(_curr_db);
_db->GetNextBed(_curr_db, true);
}
_cache.push_back(_curr_db);
_db->GetNextBed(_curr_db, true);
}
// add the hits for this query to the pump
_results.push(make_pair(_curr_qy, _hits));
......
......@@ -65,11 +65,14 @@ private:
float _overlapFraction;
// do we care about strandedness.
bool _sameStrand, _diffStrand, _reciprocal;
// a cache of still active features from the database file\
// 2012-Oct-29: prefer LIST over VECTOR as, when _cache is large,
// the overhead of deleting from a vector is huge. Deleting from
// the front of a LIST is cheap. Thanks to Neil Kindlon (Quinlan lab)
// for the very important fix.
/*
a cache of still active features from the database file\
2012-Oct-29: prefer LIST over VECTOR as, when _cache is large,
the overhead of deleting from a vector is huge. Deleting from
the front of a LIST is cheap. Thanks to Neil Kindlon (Quinlan lab)
for the very important fix.
*/
list<BED> _cache;
// the set of hits in the database for the current query
vector<BED> _hits;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment