+// ***************************************************************************
+// BamIndex.cpp (c) 2009 Derek Barnett
+// Marth Lab, Department of Biology, Boston College
+// All rights reserved.
+// ---------------------------------------------------------------------------
+// Last modified: 13 July 2010 (DB)
+// ---------------------------------------------------------------------------
+// Provides index functionality - both for the default (standardized) BAM
+// index format (.bai) as well as a BamTools-specific (nonstandard) index
+// format (.bti).
+// ***************************************************************************
+
#include <cstdio>
#include <cstdlib>
#include <algorithm>
// if block is full, get offset for next block, reset currentBlockCount
if ( currentBlockCount == d->m_blockSize ) {
-// cerr << "-------------------------------" << endl;
-// cerr << "BlockCount = " << currentBlockCount << endl;
-// cerr << endl;
-// cerr << "Storing entry: " << endl;
-// cerr << "\trefID : " << blockStartId << endl;
-// cerr << "\tpos : " << blockStartPosition << endl;
-// cerr << "\toffset : " << blockStartOffset << endl;
-//
-
d->m_indexData.push_back( BamToolsIndexEntry(blockStartOffset, blockStartId, blockStartPosition) );
blockStartOffset = m_BGZF->Tell();
currentBlockCount = 0;
return false;
// store offset & return success
-/* cerr << "BTI::GetOffsets() : calculated offset = " << previousOffset << endl;*/
offsets.push_back(previousOffset);
return true;
}