// BamIndex.h (c) 2009 Derek Barnett
// Marth Lab, Department of Biology, Boston College
// ---------------------------------------------------------------------------
// BamIndex.h (c) 2009 Derek Barnett
// Marth Lab, Department of Biology, Boston College
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Provides basic BAM index interface
// ***************************************************************************
// ---------------------------------------------------------------------------
// Provides basic BAM index interface
// ***************************************************************************
- virtual bool Create(void) =0; // creates index file from BAM file
+ virtual bool Create(void) =0;
+
+ // returns a human-readable description of the last error encountered
+ std::string GetErrorString(void) { return m_errorString; }
+
// returns whether reference has alignments or no
virtual bool HasAlignments(const int& referenceID) const =0;
// returns whether reference has alignments or no
virtual bool HasAlignments(const int& referenceID) const =0;
// attempts to use index data to jump to @region, returns success/fail
// a "successful" jump indicates no error, but not whether this region has data
// * thus, the method sets a flag to indicate whether there are alignments
// available after the jump position
virtual bool Jump(const BamTools::BamRegion& region, bool* hasAlignmentsInRegion) =0;
// attempts to use index data to jump to @region, returns success/fail
// a "successful" jump indicates no error, but not whether this region has data
// * thus, the method sets a flag to indicate whether there are alignments
// available after the jump position
virtual bool Jump(const BamTools::BamRegion& region, bool* hasAlignmentsInRegion) =0;
// change the index caching behavior
virtual void SetCacheMode(const BamIndex::IndexCacheMode& mode) =0;
// change the index caching behavior
virtual void SetCacheMode(const BamIndex::IndexCacheMode& mode) =0;