- // (typically whose format did not accomodate a particular bug fix)
-
- else if ( (Version)m_inputVersion == BamToolsIndex::BTI_1_0 ) {
- cerr << "BamToolsIndex ERROR: could not load index file. This version of the index contains a bug related to accessing data near reference ends."
- << endl << endl
- << "Please run 'bamtools index -bti -in yourData.bam' to generate an up-to-date, fixed BTI file."
- << endl << endl;
- return false;
+ // (the format had to be modified to accomodate a particular bug fix)
+
+ // Version 2.0: introduced support for half-open intervals, instead of the old closed intervals
+ // respondBy: throwing exception - we're not going to try to handle the old BTI files.
+ else if ( (Version)m_inputVersion < BamToolsIndex::BTI_2_0 ) {
+ const string message = "unsupported format: this version of the index may not properly handle "
+ "coordinate intervals. Please run 'bamtools index -bti -in yourData.bam' "
+ "to generate an up-to-date, fixed BTI file.";
+ throw BamException("BamToolsIndex::CheckVersion", message);