Skip to content
Snippets Groups Projects
Commit 8085e45a authored by nkindlon's avatar nkindlon
Browse files

Stopped BinTree from loading or getting hits for unmapped reads.

parent 8fe692c5
No related branches found
No related tags found
No related merge requests found
...@@ -85,7 +85,8 @@ bool BinTree::loadDB() ...@@ -85,7 +85,8 @@ bool BinTree::loadDB()
Record *record = NULL; Record *record = NULL;
while (!_dbFileMgr->eof()) { while (!_dbFileMgr->eof()) {
record = _dbFileMgr->allocateAndGetNextRecord(); record = _dbFileMgr->allocateAndGetNextRecord();
if (record == NULL) { //In addition to NULL records, we also don't want to add unmapped reads.
if (record == NULL || record->isUnmapped()) {
continue; continue;
} }
...@@ -111,7 +112,9 @@ void BinTree::getHits(Record *record, RecordKeyList &hitSet) ...@@ -111,7 +112,9 @@ void BinTree::getHits(Record *record, RecordKeyList &hitSet)
if (_showBinMetrics) { if (_showBinMetrics) {
return; //don't care about query entries just yet. return; //don't care about query entries just yet.
} }
if (record->isUnmapped()) {
return;
}
const QuickString &chr = record->getChrName(); const QuickString &chr = record->getChrName();
mainMapType::iterator mainIter = _mainMap.find(chr); mainMapType::iterator mainIter = _mainMap.find(chr);
if (mainIter == _mainMap.end()) { if (mainIter == _mainMap.end()) {
...@@ -169,7 +172,7 @@ void BinTree::getHits(Record *record, RecordKeyList &hitSet) ...@@ -169,7 +172,7 @@ void BinTree::getHits(Record *record, RecordKeyList &hitSet)
bool BinTree::addRecordToTree(const Record *record) bool BinTree::addRecordToTree(const Record *record)
{ {
//TBD. get chr, bin. allocate all bins and single bins as needed. // Get chr, bin. allocate all bins and single bins as needed.
const QuickString &chr = record->getChrName(); const QuickString &chr = record->getChrName();
uint32_t startPos = (uint32_t)(record->getStartPos()); uint32_t startPos = (uint32_t)(record->getStartPos());
uint32_t endPos = (uint32_t)(record->getEndPos()); uint32_t endPos = (uint32_t)(record->getEndPos());
......
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