- // creates index for BAM file, saves to file\r
- // default behavior is to create the BAM standard index (".bai")\r
- // set flag to false to create the BamTools-specific index (".bti")\r
- bool CreateIndex(bool useStandardIndex = true);\r
- // returns whether index data is available for reading \r
- // (e.g. if true, BamReader should be able to seek to a region)\r
- bool HasIndex(void) const;\r
- // change the index caching behavior\r
- // default BamReader/Index mode is LimitedIndexCaching\r
- // @mode - can be either FullIndexCaching, LimitedIndexCaching, \r
- // or NoIndexCaching. See BamIndex.h for more details\r
- void SetIndexCacheMode(const BamIndex::BamIndexCacheMode mode);\r
- \r
- // deprecated methods\r
- public:\r
- \r
- // deprecated (but still available): prefer HasIndex() instead\r
- //\r
- // Deprecated purely for API semantic clarity - HasIndex() should be clearer \r
- // than IsIndexLoaded() in light of the new caching modes that may clear the \r
- // index data from memory, but leave the index file open for later random access \r
- // seeks.\r
- //\r
- // For example, what would (IsIndexLoaded() == true) mean when cacheMode has been \r
- // explicitly set to NoIndexCaching? This is confusing at best, misleading about \r
- // current memory behavior at worst.\r
- //\r
- // returns whether index data is available \r
- // (e.g. if true, BamReader should be able to seek to a region)\r
- bool IsIndexLoaded(void) const;\r
+ // creates an index file for current BAM file, using the requested index type\r
+ bool CreateIndex(const BamIndex::IndexType& type = BamIndex::STANDARD);\r
+ // returns true if index data is available\r
+ bool HasIndex(void) const;\r
+ // looks in BAM file's directory for a matching index file\r
+ bool LocateIndex(const BamIndex::IndexType& preferredType = BamIndex::STANDARD);\r
+ // opens a BAM index file\r
+ bool OpenIndex(const std::string& indexFilename);\r
+ // sets a custom BamIndex on this reader\r
+ void SetIndex(BamIndex* index);\r
+ // changes the caching behavior of the index data\r
+ void SetIndexCacheMode(const BamIndex::IndexCacheMode& mode);\r
+\r
+ // ----------------------\r
+ // error handling\r
+ // ----------------------\r
+\r
+ // returns a human-readable description of the last error that occurred\r
+ std::string GetErrorString(void) const;\r