]> git.donarmstrong.com Git - bamtools.git/blobdiff - BamIndex.cpp
Minor formatting cleanup in BamIndex.*
[bamtools.git] / BamIndex.cpp
index 282326f9f79a20049b8b262c28adaccebc39ed36..d74e751cd902c546760afa42e3ba7c5bbe90b0ca 100644 (file)
@@ -1,7 +1,19 @@
+// ***************************************************************************
+// BamIndex.cpp (c) 2009 Derek Barnett
+// Marth Lab, Department of Biology, Boston College
+// All rights reserved.
+// ---------------------------------------------------------------------------
+// Last modified: 17 August 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>
-#include <iostream>
+// #include <iostream>
 #include <map>
 #include "BamIndex.h"
 #include "BamReader.h"
@@ -40,6 +52,8 @@ bool BamIndex::HasAlignments(const int& referenceID) {
  
 namespace BamTools { 
 
+// --------------------------------------------------
+// BamDefaultIndex data structures & typedefs
 struct Chunk {
 
     // data members
@@ -76,7 +90,7 @@ struct ReferenceIndex {
     { }
 };
 
-typedef vector<ReferenceIndex> BamDefaultIndexData;  
+typedef vector<ReferenceIndex> BamDefaultIndexData;
 
 } // namespace BamTools
  
@@ -747,15 +761,6 @@ bool BamToolsIndex::Build(void) {
         // 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;
@@ -796,7 +801,6 @@ bool BamToolsIndex::GetOffsets(const BamRegion& region, const bool isRightBoundS
         return false;
     
     // store offset & return success
-/*    cerr << "BTI::GetOffsets() : calculated offset = " << previousOffset << endl;*/
     offsets.push_back(previousOffset);
     return true; 
 }