This is maybe a noobish question but I'm working on a program that visualizes some data from a SAM/BAM file, it also has an option to lookup certain reads by their names and stuff like that. I've been tasked to compare how much (if any) are some operations faster when performed on an indexed BAM file than on a simple SAM file but I don't know how would I go about utilizing a BAM index in my program. The program is written in java and I've been using htsjdk library for reading SAM/BAM files. I don't expect anyone to write my code for me, but some general pointers to how would I go about doing this would be much appreciated.
Thanks in advance
I haven't used htsjdk, but their documentation shows support for BAM index files through their BAM reader API. Someone with more knowledge might come along and provide more info.