// open new index file (read & write)
string indexFilename = m_reader->Filename() + Extension();
if ( !OpenFile(indexFilename, "w+b") ) {
- cerr << "BamStandardIndex ERROR: could not open ouput index file: " << indexFilename
+ cerr << "BamStandardIndex ERROR: could not open output index file: " << indexFilename
<< ", aborting index creation" << endl;
return false;
}
return false;
}
+ // if not candidate offsets are present in the indexed (most likely sparce coverage)
+ // then silently bail
+ if( offsets.size() == 0 ) {
+ return false;
+ }
+
// ensure that offsets are sorted before processing
sort( offsets.begin(), offsets.end() );