Ask Your Question

Revision history [back]

I believe that issues is simply that your BAM file is in fact truncated (corrupted).

BAM files are essentially a specific type of compressed gz file with a series of compressed chunks. When reading a file for indexing, we are reading the entire contents and following the internal structure. This error says a given chunk expected more bytes than the file contained, usually indicating that the BAM file was copied from some other location but not in its entirety.

Without a valid BAM file, we can't build an index and display it.