Commit eea39090 authored by Aaron Quinlan's avatar Aaron Quinlan
Browse files

Merge pull request #4 from nkindlon/master

ifdef'd out DualQueue and removed usages of it to fix compiler errors wi...
parents f7ec24d4 a12d9422
......@@ -280,7 +280,7 @@ void InputStreamMgr::readZipChunk()
size_t numCharsRead = read(_tmpZipBuf, (size_t)SCAN_BUFFER_SIZE);
_saveDataStr.append(_tmpZipBuf);
_numBytesInBuffer = _saveDataStr.size();
if (numCharsRead < SCAN_BUFFER_SIZE) {
if ((int)numCharsRead < SCAN_BUFFER_SIZE) {
_streamFinished = true;
}
return;
......
......@@ -103,7 +103,8 @@ void FileRecordMgr::close(){
}
bool FileRecordMgr::eof(){
return _storedRecords.empty() && _fileReader->eof() ? true: false;
return _fileReader->eof();
// return _storedRecords.empty() && _fileReader->eof() ? true: false;
}
Record *FileRecordMgr::allocateAndGetNextRecord()
......@@ -235,6 +236,9 @@ void FileRecordMgr::allocateFileReader()
}
}
#ifdef false
Record *FileRecordMgr::allocateAndGetNextMergedRecord(WANT_STRAND_TYPE desiredStrand, int maxDistance) {
RecordKeyList recList;
if (!allocateAndGetNextMergedRecord(recList, desiredStrand, maxDistance)) {
......@@ -403,4 +407,4 @@ void FileRecordMgr::deleteAllMergedItemsButKey(RecordKeyList &recList) {
}
recList.clearList();
}
#endif
......@@ -13,7 +13,7 @@ using namespace std;
#include <string>
#include "QuickString.h"
#include <set>
#include "DualQueue.h"
//#include "DualQueue.h"
//include headers for all FileReader and derivative classes.
#include "Context.h"
......@@ -80,7 +80,7 @@ public:
Record *allocateAndGetNextRecord();
void deleteRecord(const Record *);
#ifdef false
//////////////////////////////////////////////////////////////////////////////////
//
// MERGED RECORDS
......@@ -121,7 +121,7 @@ public:
// END MERGED RECORDS
//
//////////////////////////////////////////////////////////////////////////////////
#endif
//File statistics
unsigned long getTotalRecordLength() const { return _totalRecordLength; } //sum of length of all returned records
......@@ -161,7 +161,7 @@ private:
int _prevChromId;
//members for handling merged records
DualQueue<Record *, DualQueueAscending > _storedRecords;
// DualQueue<Record *, DualQueueAscending > _storedRecords;
bool _mustBeForward;
bool _mustBeReverse;
......@@ -178,11 +178,6 @@ private:
void testInputSortOrder(Record *record);
void assignChromId(Record *);
void sortError(const Record *record, bool genomeFileError);
void deleteAllMergedItemsButKey(RecordKeyList &recList);
void addToStorage(Record *record);
Record *tryToTakeFromStorage();
Record *tryToTakeFromStorage(bool strand);
void testBufferedMgr() const {
if (_bufStreamMgr == NULL) {
cerr << "Error: attempted to access type information for file " << _context->getInputFileName(_contextFileIdx) << " before it was opened." << endl;
......@@ -190,6 +185,12 @@ private:
}
}
#ifdef false
void deleteAllMergedItemsButKey(RecordKeyList &recList);
void addToStorage(Record *record);
Record *tryToTakeFromStorage();
Record *tryToTakeFromStorage(bool strand);
#endif
};
......
......@@ -197,20 +197,20 @@ bool NewChromSweep::next(RecordKeyList &next) {
void NewChromSweep::nextRecord(bool query) {
if (query) {
if (!_context->getUseMergedIntervals()) {
// if (!_context->getUseMergedIntervals()) {
_currQueryRec = _queryFRM->allocateAndGetNextRecord();
} else {
_currQueryRec = _queryFRM->allocateAndGetNextMergedRecord(_context->getSameStrand() ? FileRecordMgr::SAME_STRAND_EITHER : FileRecordMgr::ANY_STRAND);
}
// } else {
// _currQueryRec = _queryFRM->allocateAndGetNextMergedRecord(_context->getSameStrand() ? FileRecordMgr::SAME_STRAND_EITHER : FileRecordMgr::ANY_STRAND);
// }
if (_currQueryRec != NULL) {
_queryRecordsTotalLength += (unsigned long)(_currQueryRec->getEndPos() - _currQueryRec->getStartPos());
}
} else { //database
if (!_context->getUseMergedIntervals()) {
// if (!_context->getUseMergedIntervals()) {
_currDatabaseRec = _databaseFRM->allocateAndGetNextRecord();
} else {
_currDatabaseRec = _databaseFRM->allocateAndGetNextMergedRecord(_context->getSameStrand() ? FileRecordMgr::SAME_STRAND_EITHER : FileRecordMgr::ANY_STRAND);
}
// } else {
// _currDatabaseRec = _databaseFRM->allocateAndGetNextMergedRecord(_context->getSameStrand() ? FileRecordMgr::SAME_STRAND_EITHER : FileRecordMgr::ANY_STRAND);
// }
if (_currDatabaseRec != NULL) {
_databaseRecordsTotalLength += (unsigned long)(_currDatabaseRec->getEndPos() - _currDatabaseRec->getStartPos());
}
......
......@@ -4,7 +4,7 @@
* Created on: Jan 29, 2013
* Author: nek3d
*/
#ifdef false
#ifndef DUALQUEUE_H_
#define DUALQUEUE_H_
......@@ -121,3 +121,4 @@ private:
#endif /* DUALQUEUE_H_ */
#endif
......@@ -91,7 +91,7 @@ rm obs exp
# Test that we get the requested number of records
############################################################
echo " sample.new.t07...\c"
echo " 10" > exp
echo "10" > exp
$BT sample -i mainFile.bed -n 10 | wc -l > obs
check obs exp
#rm obs exp
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment